Linux VM Performance on Hyper-V

, ,

I was recently on a call with a customer who had migrated their VMs to a new Hyper-V host (and away from VMWare) and had a few Ubuntu VMs for hosting their PHP stack of applications. Part of the call we were doing a review of some of the VMs and the customer complained that they were facing some performance issues with the Ubuntu VMs that they previously never had with VMWare.

Now while Linux Guest Support for VMWare is pretty much plug and play, the same cannot be said for Hyper-V. While the VM Guests are these days enlightened with some base integration services, Ubuntu still uses the generic kernel when being installed in Hyper-V, so there can be issues around integration services and performance around disk utilisation. So after the call with that customer, the action items were to adjust the kernel for these two VMs.

Microsoft recommend using the linux-azure kernel when running Linux under Hyper-V and if ever migrating into Azure. Switching Kernels is a fairly painless process, however isn’t fraught without danger (so make sure you backup or snapshot prior). Connecting to the VM, we firstly check the current kernel that is running by using the following command

uname -r

This returns linux-generic and confirms that we need to change, so we will now install the azure packages and kernel using the following command

sudo apt install linux-azure

While you can be more selective about what you’re installing, I’d generally just use this over-arching set of packages. Once saying yes to install and it completes, we need to reboot to load the new kernel. As the machine reboots, we should notice the heartbeat and network details get filled in as the Guest is now enlightened and providing information back to the Hypervisor.

There are other things to watch out for like file system block size matching your underlying storage infrastructure that can also hamper performance especially for systems with large files, so take note when creating the VM.


Leave a Reply

More Posts

Reset the Default Domain and Domain Controller Group Policy Objects to their out of box state

So, I recently inherited a small client with SBS 2011 and their previous IT admin only ever used the Default Domain Policy to apply computer and users settings (such as mapped drives and printers). Microsoft has quite a strong recommendation of best practice for the two policies which goes along the lines of; So I […]

Adopt Unifi Access Point over Internet or VPN using SSH

If you’ve shipped some Ubiquiti Unifi Wireless access points to a remote site before adopting them or happen to have your controller on another network, you can log into them via SSH and point them to your Unifi controller. It performs discovery via basic L2 broadcast and DNS resolution of hostname unifi, if either of […]

PowerShell Script to Install Updates Offline in a WIM image using DISM

I’ve been helping out a customer build a new MDT deployment environment and move away from Ghost and the 90’s. As they are not going to be implementing Systems Center Configuration Manager and SUP to automatically maintain their images offline any time soon, we need a way to keep their image up to date with […]