Oracle Enterprise Linux 7.8 (LVM) on Azure User Guide
Videos
Overview
This guide covers the deployment and configuration of Oracle Enterprise Linux 7.8 (LVM) on Microsoft Azure using cloudimg's virtual machine image from the Azure Marketplace (offer prod-gyn56k4iwbshq).
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.8 and has since taken updates from the Oracle Linux 7 channels. Its release file still reads 7.8, while most of its packages are the newer 7.9 errata builds. What sets it apart is its LVM disk layout: the root filesystem, /home and the swap space are each a logical volume, so you can grow them with standard LVM tools instead of repartitioning. Step 6 shows the layout and how to grow it.
⚠️ End of life status — read before deploying
Oracle Linux 7 reached the end of Oracle Premier Support in December 2024. 7.8 was followed by 7.9 in October 2020, and 7.9 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 (LVM), 9 (LVM) or 10 (LVM).
What's included:
- Oracle Linux 7 (release file 7.8, packages from the Oracle Linux 7.9 update channel), binary compatible with RHEL 7
- An LVM disk layout:
/,/homeand a swap volume each on their own logical volume, with thelvm2tools installed - The Red Hat Compatible Kernel (3.10, booted by default) and the Unbreakable Enterprise Kernel Release 6 (5.4)
- 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-gyn56k4iwbshq:prod-gyn56k4iwbshq:latest
az vm create \
--resource-group myResourceGroup \
--name my-oel-7-8-lvm-vm \
--image cloudimg1647283583153:prod-gyn56k4iwbshq:prod-gyn56k4iwbshq: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-8-lvm-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.
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 the services of the tools it was migrated with, first by AWS Application Migration Service and then by Azure Site Recovery. None of them does anything for your machine, and four of them fail at every boot. List the failed units:
systemctl --failed --no-legend
Expected output:
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
aws-replication-prepareandaws-replication-shutdownbelong to the AWS replication agent, whose files are already gone.rc-localruns/etc/rc.d/rc.local, which tries to copy an Amazon EC2 instance key for anec2-useraccount that does not exist on this machine.vxagentis the Azure Site Recovery mobility agent (packageInMageVx); its configuration directories hold keys that belong to that migration.
Remove them all: the package, its init scripts, the units, the udev rule, the dracut module, the directories, the rc.local hook and a sudoers file left for an ssm-user account that does not exist:
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 stop 'aws-replication*'
sudo systemctl disable asr-installga.service involflt_start.service involflt_stop.service aws-replication.target aws-replication-post-convert.service
sudo rm -f /usr/lib/systemd/system/asr-installga.service /etc/systemd/system/involflt_start.service /etc/systemd/system/involflt_stop.service /etc/systemd/system/aws-replication* /etc/udev/rules.d/09-inm_udev.rules /etc/sudoers.d/ssm-agent-users
sudo rm -rf /usr/local/InMage /usr/local/asr-installga /etc/vxagent /usr/lib/dracut/modules.d/95involflt /opt/aws
sudo chmod -x /etc/rc.d/rc.local
sudo systemctl daemon-reload
sudo systemctl reset-failed
systemctl --failed --no-legend
The last command prints nothing, meaning no unit has failed, and it stays that way after a reboot. 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. Taking the execute bit off /etc/rc.d/rc.local is how systemd's rc-local unit is switched off on Oracle Linux 7. Do this step before the full update in Step 7, so that the new kernel's initramfs is built without the agent's dracut module.
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 it:
sudo userdel -r cloud-user
getent passwd cloud-user || echo "cloud-user removed"
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, which is why getent passwd cloud-user finds nothing and the second line prints cloud-user removed.
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.8
NAME="Oracle Linux Server"
VERSION="7.8"
ID="ol"
VERSION_ID="7.8"
3.10.0-1160.92.1.0.1.el7.x86_64 x86_64
oraclelinux-release-7.8-1.0.7.el7.x86_64
redhat-release-server-7.9-6.0.1.el7_9.x86_64
The release file and oraclelinux-release say 7.8. The el7_9 tag on most packages, such as redhat-release-server above, shows they are already 7.9 errata builds. The 3.10 el7 kernel is the Red Hat Compatible Kernel, which this image boots by default. 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: The LVM disk layout
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT
sudo vgs
sudo lvs
Expected output:
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
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lv_home lv_home -wi-ao---- 15.00g
lv_root lv_root -wi-ao---- 23.00g
lv_swap lv_swap -wi-ao---- 9.87g
The 50 GB OS disk (sda) holds /boot on a plain partition and three LVM physical volumes, each with its own volume group and one logical volume:
| Volume group / logical volume | Size | Use |
|---|---|---|
lv_root/lv_root (on /dev/sda2) |
23 GB | / root filesystem (ext4) |
lv_home/lv_home (on /dev/sda3) |
15 GB | /home (ext4) |
lv_swap/lv_swap (on /dev/sda5) |
9.9 GB | swap volume, not enabled (free -h shows 0B swap) |
/dev/sdb1 |
varies | /mnt, the Azure temporary resource disk (not LVM) |
The partitions sit back to back on the OS disk, so making the OS disk larger in Azure does not grow / on its own. The LVM way to give / more room is to add a data disk to its volume group.
Growing the root filesystem with a data disk
Attach a new data disk in Azure, from your workstation:
az vm disk attach --resource-group myResourceGroup --vm-name my-oel-7-8-lvm-vm --name my-oel-data-1 --new --size-gb 32 --lun 0
On the VM, the Azure Linux Agent links each data disk by its LUN under /dev/disk/azure/scsi1/. Make the disk an LVM physical volume, add it to the root volume group, then extend the root logical volume and its ext4 filesystem in one step. All of this runs online, with no reboot:
sudo pvcreate /dev/disk/azure/scsi1/lun0
sudo vgextend lv_root /dev/disk/azure/scsi1/lun0
sudo lvextend -r -l +100%FREE /dev/lv_root/lv_root
df -h /
pvcreate reports Physical volume "/dev/disk/azure/scsi1/lun0" successfully created and vgextend reports Volume group "lv_root" successfully extended. lvextend prints the logical volume's old and new size, then resize2fs reports on-line resizing required and the filesystem's new length, and df -h / shows / larger by the size of the data disk.
/home grows the same way with vgextend lv_home and lvextend -r ... /dev/lv_home/lv_home. Once a disk is part of a volume group, keep it attached: the volume group needs every one of its disks.
Turning on the swap volume
The swap volume is formatted but not in use. To turn it on now and at every boot:
sudo swapon /dev/lv_swap/lv_swap
echo '/dev/mapper/lv_swap-lv_swap swap swap defaults 0 0' | sudo tee -a /etc/fstab
free -h
free -h then shows a Swap: total of 9.9G.
Step 7: 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
After the reboot, the machine reports the final Oracle Linux 7 release, and yum check-update returns exit code 0, meaning nothing further is available from the enabled channels. The update also makes the newest Unbreakable Enterprise Kernel the default, so from now on the machine boots UEK (el7uek) rather than the Red Hat Compatible Kernel:
cat /etc/oracle-release
uname -r
sudo yum -q check-update; echo "exit code: $?"
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 8: Security posture
getenforce
sudo sshd -T | grep -E '^(pubkeyauthentication|passwordauthentication|challengeresponseauthentication) '
systemctl is-active firewalld || true
Expected output:
Disabled
pubkeyauthentication yes
passwordauthentication no
challengeresponseauthentication no
unknown
- SSH is key only. Password and challenge response logins are disabled. The root,
azureuserandcloud-userpasswords are locked, and no account has a password hash. - 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.
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 9: Verify Azure integration
systemctl is-active waagent
systemctl is-enabled waagent
cloud-init --version
sudo cloud-init status
systemctl is-active chronyd
df -h /
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 4.9G 17G 23% /
The used and available figures on / 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 IOError: [Errno 13] Permission denied: '/run/cloud-init/cloud.cfg', because it cannot read its root only configuration. Provisioning itself completes, and sudo cloud-init status reports status: done.
Step 10: 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 11: 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, with storage you can grow by LVM
- 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
A new data disk is not under /dev/disk/azure/scsi1
The links are made by the Azure Linux Agent's udev rules when the disk arrives. Check that the disk is attached at the LUN you expect and list what the VM sees:
ls -l /dev/disk/azure/scsi1/ 2>/dev/null
lsblk -o NAME,SIZE,TYPE
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, each available from cloudimg with an LVM layout.
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