Oracle Enterprise Linux 7.6 (LVM) on Azure User Guide
Overview
This guide covers the deployment and configuration of Oracle Enterprise Linux 7.6 (LVM) on Microsoft Azure using cloudimg's virtual machine image from the Azure Marketplace (offer prod-td5brjbeffmi2).
Oracle Linux is a free, enterprise grade Linux distribution built by Oracle to be binary compatible with Red Hat Enterprise Linux 7. Oracle provides the binaries at no cost and permits redistribution, so there is no subscription and no licence key needed to use or patch it.
This image is an established Oracle Linux 7 system that was built on Oracle Linux 7.6 and has since taken updates from the Oracle Linux 7 channels. Its release file still reads 7.6, while most of its packages are the newer 7.9 errata builds. Its root, home and swap space each live on an LVM logical volume. Steps 5 and 6 show the release and explain how to bring the whole machine to 7.9; the Disk layout section in Step 8 shows the volumes and how to grow them.
⚠️ End of life status — read before deploying
Oracle Linux 7 reached the end of Oracle Premier Support in December 2024. 7.6 was followed by 7.7, 7.8 and 7.9, and 7.9 (October 2020) is the final Oracle Linux 7 release: there is no 7.10. Oracle's paid Extended Support for Oracle Linux 7 runs to July 2029; the free public channel no longer receives new Oracle Linux 7 errata. This image is a fixed baseline for legacy applications and compatibility testing that still need an Oracle Linux 7 or RHEL 7 base. It is not a system that keeps itself patched.
You own ongoing patching. For continued security updates, take an Oracle Linux Extended Support subscription, or plan a migration to a supported release such as Oracle Linux 8, 9 or 10.
What's included:
- Oracle Linux 7 (release file 7.6, packages from the Oracle Linux 7.9 update channel), binary compatible with RHEL 7
- The Red Hat Compatible Kernel (3.10, booted at first) and the Unbreakable Enterprise Kernel Release 6 (5.4, booted by default once you update)
- LVM storage: separate logical volumes for
/,/homeand swap - A first boot script that applies the security errata available on the enabled channels, without kernel changes
ol7_latest,ol7_UEKR6,ol7_addons, EPEL and Azure CLI repositories enabled- Azure Linux Agent (waagent) and cloud-init 19.4 for Azure provisioning
- Azure CLI 2.38 and Python 3.6
- Chronyd for NTP time synchronisation
- Generation 1 (BIOS) Hyper V virtual machine
- cloudimg's support team on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours
Platform: Microsoft Azure (Generation 1 Hyper V)
Default user: azureuser
Prerequisites
Before deploying this image, ensure you have:
- An active Microsoft Azure subscription
- The Azure CLI, installed locally or in Azure Cloud Shell
- An SSH key pair for Linux VM access
- Familiarity with Azure VM management
Step 1: Deploy the Virtual Machine
Deploy the image by its Marketplace URN. The image carries a purchase plan, so accept its terms once per subscription first:
az vm image terms accept --urn cloudimg1647283583153:prod-td5brjbeffmi2:prod-td5brjbeffmi2:latest
az vm create \
--resource-group myResourceGroup \
--name my-oel-7-6-vm \
--image cloudimg1647283583153:prod-td5brjbeffmi2:prod-td5brjbeffmi2:latest \
--admin-username azureuser \
--generate-ssh-keys \
--public-ip-sku Standard
Add --size with the size your workload needs. This is a Generation 1 image. The Azure CLI may print a warning that new virtual machines default to Trusted Launch; with this image the machine is still created as a standard Generation 1 virtual machine, and the warning needs no action.
Step 2: Connect via SSH
Run these on your own workstation, not on the VM. Find the public IP, then connect:
az vm show --resource-group myResourceGroup --name my-oel-7-6-vm --show-details --query publicIps -o tsv
ssh azureuser@<vm-ip>
There is no password to enter. If SSH asks you for one, the key you supplied at create time is not the key your client is offering.
Your first login prints a Last login line dated January 2024 from azure-bastion.internal.cloudapp.net. That line comes from the login history the image was built with, not from anyone using your machine.
Step 3: Give the machine its own SSH host keys and machine ID
Do this first, before you rely on the machine. The SSH host keys and the systemd machine ID in this image were created when the image was built, and they are not regenerated at first boot, so every virtual machine deployed from this image starts with the same host keys and the same machine ID. Replace them with ones unique to your machine:
sudo rm -f /etc/ssh/ssh_host_*
sudo /usr/sbin/sshd-keygen
sudo systemctl restart sshd
sudo rm -f /etc/machine-id
sudo systemd-machine-id-setup
Expected output:
Generating SSH2 RSA host key: [ OK ]
Generating SSH2 ECDSA host key: [ OK ]
Generating SSH2 ED25519 host key: [ OK ]
Initializing machine ID from random generator.
If the first boot script (Step 6) has just updated OpenSSH, systemctl also prints Warning: sshd.service changed on disk. Run 'systemctl daemon-reload' to reload units. The warning is harmless here: sshd restarts with its new keys either way, and Step 4 runs daemon-reload.
Your current session stays open. The next time you connect, your SSH client warns that the remote host identification has changed, because the machine now presents its new keys. That warning is expected exactly once, after this step. Remove the old entry on your workstation, then connect again and accept the new key:
ssh-keygen -R <vm-ip>
ssh azureuser@<vm-ip>
Step 4: Remove the migration agents
The image still carries two migration agents from the way it was moved between clouds: the Azure Site Recovery mobility agent (InMageVx) and the AWS replication agent. Neither does anything useful on your machine. At every boot their services fail, one of them restarts in a loop, an /etc/rc.d/rc.local line tries to fetch an AWS ec2-user key, and their kernel driver and boot hooks are built into every kernel's initramfs. Remove both before the full update in Step 6, so that the new kernel is set up without them.
The first boot script (Step 6) holds the yum lock for a few minutes after each boot. If the yum remove below prints Another app is currently holding the yum lock, it waits and then continues on its own.
Check the failed units first:
systemctl --failed --no-legend
Expected output on a fresh machine:
aws-replication-prepare.service loaded failed failed AWS Replication Environment Preparation
aws-replication-shutdown.service loaded failed failed AWS Replication Shutdown
rc-local.service loaded failed failed /etc/rc.d/rc.local Compatibility
vxagent.service loaded failed failed SYSV: This script is the daemon script for volume replication agent
Remove the Azure Site Recovery agent
Remove the package, its init scripts, units, udev rule, dracut module, directories and the initramfs backups it made:
sudo yum -q -y remove InMageVx
for s in vxagent uarespawnd boottimemirroring_phase1 boottimemirroring_phase2 vConService_linux; do sudo chkconfig --del $s 2>/dev/null; sudo rm -f /etc/init.d/$s; done
sudo systemctl disable asr-installga.service involflt_start.service involflt_stop.service
sudo rm -f /etc/systemd/system/involflt_start.service /etc/systemd/system/involflt_stop.service /etc/udev/rules.d/09-inm_udev.rules /etc/udev/rules.d/75-persistent-net-generator.rules-INMAGE-ORG /boot/*-INMAGE_ORG
sudo rm -rf /usr/local/InMage /usr/local/asr-installga /etc/vxagent /usr/lib/dracut/modules.d/95involflt
While removing the package, yum prints warning: file /tmp/MobSvcInstaller/...: remove failed lines; they refer to installer files that are already gone and are harmless.
Remove the AWS replication agent
The AWS replication agent is not a package, so remove its files directly: its systemd units, scripts, udev rule, GRUB script and saved GRUB variables, modprobe option, kernel driver, dracut module, the rc.local lines and an unused sudo rule:
sudo systemctl disable aws-replication.target aws-replication-post-convert.service
sudo rm -f /etc/systemd/system/aws-replication* /bin/aws-replication-post-convert.sh /bin/aws-replication-udev-script.sh /etc/udev/rules.d/10-aws-replication-udev-boot.rules /etc/grub.d/42-aws-replication-grub-script /etc/modprobe.d/10-aws-replication-modprobe.conf /etc/sudoers.d/ssm-agent-users
sudo rm -rf /usr/lib/dracut/modules.d/91aws-replication /opt/aws
sudo find /lib/modules -name aws-replication-driver.ko -delete
sudo sed -i '/ec2-user/d' /etc/rc.d/rc.local
sudo grub2-editenv - unset aws_replication_current_boot aws_replication_previous_boot aws_replication_error
Rebuild the boot files
Rebuild the GRUB menu, the kernel module lists and every initramfs without the removed agents, then reload systemd. The dracut run takes a few minutes and prints nothing:
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
for k in $(ls /lib/modules); do sudo depmod -a "$k"; done
sudo dracut -f --regenerate-all
sudo systemctl daemon-reload
sudo systemctl reset-failed
systemctl --failed --no-legend
rpm -q InMageVx
grub2-mkconfig lists each kernel it finds and ends with done. The last two commands print nothing for the failed units, meaning none is left, and package InMageVx is not installed. Carry on to Steps 5 and 6 without rebooting: the full update in Step 6 installs the kernel the machine boots next and makes it the default.
Remove the unused cloud-user account
The image also creates the cloud-init default account cloud-user, which has no password, no SSH key and passwordless sudo. If you do not use it, remove the account and its sudo rules:
sudo userdel -r cloud-user
sudo sed -i '/^cloud-user /d' /etc/sudoers.d/90-cloud-init-users
getent passwd cloud-user
sudo visudo -c
userdel reports /var/spool/mail/cloud-user not owned by cloud-user, not removing and exits with code 12; the account and its home directory are removed all the same, as getent passwd cloud-user (which then prints nothing) confirms. visudo -c ends with /etc/sudoers.d/90-cloud-init-users: parsed OK.
Step 5: Confirm the release
cat /etc/oracle-release
grep -E '^(NAME|VERSION|ID|VERSION_ID)=' /etc/os-release
uname -rm
rpm -q oraclelinux-release redhat-release-server
Expected output:
Oracle Linux Server release 7.6
NAME="Oracle Linux Server"
VERSION="7.6"
ID="ol"
VERSION_ID="7.6"
3.10.0-1160.92.1.0.1.el7.x86_64 x86_64
oraclelinux-release-7.6-1.0.15.el7.x86_64
redhat-release-server-7.9-6.0.1.el7_9.x86_64
The release file and oraclelinux-release say 7.6. The el7_9 tag on most packages, such as redhat-release-server above, shows they are already 7.9 errata builds. The el7 tag on the running kernel shows the machine starts on the Red Hat Compatible Kernel (3.10). The Unbreakable Enterprise Kernel (5.4, el7uek) is installed alongside it:
rpm -q kernel kernel-uek
Expected output:
kernel-3.10.0-1160.el7.x86_64
kernel-3.10.0-1160.92.1.0.1.el7.x86_64
kernel-uek-5.4.17-2102.201.3.el7uek.x86_64
kernel-uek-5.4.17-2136.320.7.1.el7uek.x86_64
Step 6: Updates and the first boot script
At every boot, root's crontab runs /stage/scripts/initial_boot_update.sh, which applies the security errata available on the enabled channels, leaving out kernels and the release package:
sudo crontab -l
cat /stage/scripts/initial_boot_update.sh
Expected output:
@reboot /stage/scripts/initial_boot_update.sh
#!/bin/bash
yum -y update --security --exclude=kernel* --exclude=oraclelinux-release >> /stage/scripts/initial_boot_update.log
On a fresh machine this run takes a few minutes after boot, and other yum commands wait for its lock until it finishes. It does not bring the machine fully up to date. Afterwards, yum check-update still lists pending updates (exit code 100), including the newer kernels and the 7.9 release package:
sudo yum -q check-update; echo "exit code: $?"
List the enabled repositories:
yum -q repolist enabled
Expected output:
repo id repo name status
azure-cli Azure CLI 123
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 13,791
ol7_UEKR6/x86_64 Latest Unbreakable Enterprise Kernel Release 6 for Orac 1,401
ol7_addons/x86_64 Oracle Linux 7Server Add ons (x86_64) 981
ol7_latest/x86_64 Oracle Linux 7Server Latest (x86_64) 27,429
To apply everything the channels carry, including the kernels and the 7.9 release package, run a full update and reboot:
sudo yum -y update
sudo systemctl reboot
The image's kernel settings (DEFAULTKERNEL=kernel-uek in /etc/sysconfig/kernel) make the newest Unbreakable Enterprise Kernel the default when it is installed. After the reboot, the machine reports the final Oracle Linux 7 release and runs that kernel, and yum check-update returns exit code 0, meaning nothing further is available from the enabled channels:
cat /etc/oracle-release
uname -r
sudo yum -q check-update; echo "exit code: $?"
systemctl --failed --no-legend
Expected output:
Oracle Linux Server release 7.9
5.4.17-2136.338.4.2.el7uek.x86_64
exit code: 0
Because Oracle Linux 7 is end of life, a machine with nothing left to apply is caught up only with the frozen free channel. It is not free of vulnerabilities found after that channel stopped receiving errata.
Step 7: Security posture
getenforce
sudo sshd -T | grep -E '^(pubkeyauthentication|passwordauthentication|challengeresponseauthentication) '
systemctl is-active firewalld
Expected output:
Disabled
pubkeyauthentication yes
passwordauthentication no
challengeresponseauthentication no
unknown
- SSH is key only. Password and challenge response logins are disabled. The root and
azureuserpasswords are locked (as iscloud-user's, if you kept that account). - SELinux is disabled on this image (
SELINUX=disabledin/etc/selinux/config). If your policy needs SELinux, plan to enable it yourself, which needs a full filesystem relabel and a reboot. - The host firewall is off.
firewalldis installed but disabled and has never been started, which is whysystemctl is-activereportsunknown. The Azure Network Security Group is the only network control until you turn it on. - The time zone is
America/New_York.timedatectlshows it; set your own withsudo timedatectl set-timezone <zone>, for exampleUTC.
Root's entry in /etc/shadow still holds the locked password hash it was built with, the same on every machine from this image. It cannot be used to log in while locked. To remove it as well, so that no account stores a password hash:
sudo usermod -p '!!' root
sudo passwd -S root
passwd -S still reports Password locked.
To turn on the host firewall:
sudo systemctl enable --now firewalld
sudo firewall-cmd --list-all
The default public zone lists dhcpv6-client ssh under services, so your SSH session keeps working. To expose another service, open it in both the Azure NSG and firewalld, for example HTTPS:
sudo firewall-cmd --permanent --add-port=443/tcp
sudo firewall-cmd --reload
Step 8: Verify Azure integration
systemctl is-active waagent
systemctl is-enabled waagent
cloud-init --version
sudo cloud-init status
systemctl is-active chronyd
df -h / /home /boot
Expected output on a fresh machine:
active
enabled
/usr/bin/cloud-init 19.4
status: done
active
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/lv_root-lv_root 23G 5.1G 17G 24% /
/dev/mapper/lv_home-lv_home 15G 72K 14G 1% /home
/dev/sda1 2.0G 250M 1.6G 14% /boot
The used and available figures change as you install and update packages.
waagent lets Azure run extensions and report VM health. cloud-init handles provisioning: it creates azureuser, installs your SSH key and runs any custom data you supply.
Run cloud-init status with sudo, as above. Without sudo, the cloud-init 19.4 build on Oracle Linux 7 (Python 2.7) stops with NameError: global name 'PermissionError' is not defined when it cannot read its root only status file. Provisioning itself completes, and sudo cloud-init status reports status: done.
Disk layout
The 50 GB OS disk holds a /boot partition and three LVM physical volumes, each in its own volume group:
| Partition | Size | Volume group / logical volume | Use |
|---|---|---|---|
| 1 | 2 GB | none | /boot (ext4) |
| 2 | 23 GB | lv_root / lv_root |
/ root filesystem (ext4) |
| 3 | 15 GB | lv_home / lv_home |
/home (ext4) |
| 5 | 9.9 GB | lv_swap / lv_swap |
swap, not enabled |
The Azure temporary resource disk is mounted at /mnt. Its contents can be lost when the machine is stopped, resized or moved to another host.
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT
sudo vgs
Expected output (the disk letters and the order of the lines can differ between boots: the OS disk is the one with the LVM partitions, and the resource disk is the one mounted at /mnt):
NAME SIZE TYPE FSTYPE MOUNTPOINT
fd0 4K disk
sda 50G disk
├─sda1 2G part ext4 /boot
├─sda2 23G part LVM2_member
│ └─lv_root-lv_root 23G lvm ext4 /
├─sda3 15G part LVM2_member
│ └─lv_home-lv_home 15G lvm ext4 /home
├─sda4 1K part
└─sda5 9.9G part LVM2_member
└─lv_swap-lv_swap 9.9G lvm swap
sdb 8G disk
└─sdb1 8G part ext4 /mnt
sr0 630K rom
VG #PV #LV #SN Attr VSize VFree
lv_home 1 1 0 wz--n- 15.00g 0
lv_root 1 1 0 wz--n- 23.00g 0
lv_swap 1 1 0 wz--n- 9.87g 0
Every volume group is full, and the swap partition follows the root and home partitions, so making the OS disk larger in Azure does not grow / or /home on its own. Use LVM instead: attach a data disk and add it to the volume group you want to grow.
Grow the root filesystem with a data disk
On your workstation, attach a new data disk to the machine (here 32 GB):
az vm disk attach --resource-group myResourceGroup --vm-name my-oel-7-6-vm --name my-oel-7-6-data1 --new --size-gb 32
On the machine, find the new disk (the one with no partitions and no mount point), make it a physical volume, add it to lv_root and grow the root logical volume and its filesystem in one step:
lsblk -d -o NAME,SIZE,TYPE
sudo pvcreate /dev/sdc
sudo vgextend lv_root /dev/sdc
sudo lvextend -r -l +100%FREE /dev/lv_root/lv_root
df -h /
Expected output, here with the new disk at sdc:
NAME SIZE TYPE
sdb 8G disk
sr0 1024M rom
sdc 32G disk
sda 50G disk
Physical volume "/dev/sdc" successfully created.
Volume group "lv_root" successfully extended
Size of logical volume lv_root/lv_root changed from 23.00 GiB (5888 extents) to <55.00 GiB (14079 extents).
Logical volume lv_root/lv_root successfully resized.
resize2fs 1.45.4 (23-Sep-2019)
Filesystem at /dev/mapper/lv_root-lv_root is mounted on /; on-line resizing required
old_desc_blocks = 3, new_desc_blocks = 7
The filesystem on /dev/mapper/lv_root-lv_root is now 14416896 (4k) blocks long.
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/lv_root-lv_root 54G 6.1G 46G 12% /
Replace /dev/sdc with the device lsblk shows for your new disk. lvextend -r grows the ext4 filesystem online, so / is larger at once, with no reboot. The same commands with lv_home grow /home.
Turn on swap
The image ships the lv_swap volume formatted as swap but not in use (free -h shows 0B swap). To use it, turn it on and add it to /etc/fstab so it stays on after a reboot:
sudo swapon /dev/lv_swap/lv_swap
echo '/dev/lv_swap/lv_swap swap swap defaults 0 0' | sudo tee -a /etc/fstab
free -h | grep -i swap
Expected output:
/dev/lv_swap/lv_swap swap swap defaults 0 0
Swap: 9.9G 0B 9.9G
Step 9: Networking
sudo ss -tlnp
On a fresh machine the only external listener is sshd on port 22. Postfix listens for local mail on the loopback address only ([::1]:25).
Step 10: Install software and add a user
Install packages from the enabled repositories in the usual way, for example:
sudo yum -y install git
To add another administrator, create the account with sudo adduser <name>, add it to the wheel group with sudo usermod -aG wheel <name>, then copy your public key into /home/<name>/.ssh/authorized_keys with mode 600 and the .ssh directory mode 700, owned by that user.
Common Use Cases
- Hosting legacy applications that require an Oracle Linux 7 or RHEL 7 base
- Compatibility and regression testing against Oracle Linux 7
- Lift and shift of existing Oracle Linux 7 workloads to Azure that expect an LVM layout
Troubleshooting
Cannot connect via SSH
- Verify the VM is in Running state in the Azure Portal
- Check that port 22 is allowed in the Network Security Group
- Ensure you are using the correct username:
azureuser - Verify your SSH key matches the one you supplied at create time. Password login is disabled, so a wrong key cannot fall back to a password prompt.
- If SSH reports that the remote host identification has changed right after Step 3, run
ssh-keygen -R <vm-ip>on your workstation and connect again. At any other time, treat that warning seriously and find out why the key changed.
A yum command waits for a lock after boot
The first boot script holds the yum lock for a few minutes after each boot. Wait for it to finish:
sudo tail -3 /stage/scripts/initial_boot_update.log
Azure agent not running
sudo systemctl status waagent
If it is not running, start it with sudo systemctl enable --now waagent.
Package manager issues
Refresh the metadata cache first:
sudo yum clean all
sudo yum makecache
If repositories are unreachable, check DNS resolution with getent hosts yum.oracle.com.
Important Notes
End of life. Oracle's Lifetime Support Policy lists Oracle Linux 7 with Premier Support ending in December 2024 and Extended Support ending in July 2029 (Oracle Lifetime Support Policy: Oracle Open Source Service Offerings). Oracle Linux 7.9, released in October 2020, is the last Oracle Linux 7 update (endoflife.date: Oracle Linux). This image is not kept patched by the free channel; you own ongoing patching. For continued security updates, take an Oracle Linux Extended Support subscription, or migrate to a supported release such as Oracle Linux 8, 9 or 10.
Oracle Linux is free and open source, and Oracle permits its redistribution. It is a distribution assembled from thousands of independently packaged components, each carrying its own terms, including the GPL, LGPL, MIT, BSD, Apache 2.0 and MPL; every package's terms are readable with rpm -qi <package>. No subscription, licence key or Red Hat entitlement is required.
Oracle and Oracle Linux are trademarks of Oracle Corporation. The names are used here only to identify the distribution this image contains. cloudimg is not affiliated with, endorsed by or sponsored by Oracle Corporation.
Support
For assistance with this image, contact cloudimg support:
- Website: www.cloudimg.co.uk
- Product Catalogue: www.cloudimg.co.uk/products
- User Guides: www.cloudimg.co.uk/guides
- SLA: 24 hour response guaranteed