is it possible to run KVM on Azure
Asked Answered
S

1

5

Azure Fabric runs on a customized version of Hyper-V, it appears. Is it possible to run a KVM virtualized instance on Azure (using nested virtualization)?

I have a custom VHD which is based on Debian (say). Based on this document https://learn.microsoft.com/en-us/azure/virtual-machines/linux/create-upload-generic, it seems that it might be possible, if the Hyper-V drivers are built into the kernel.

Has anyone run successfully run a KVM instance on Azure? If so, could you please share your experience.

Sea answered 4/3, 2018 at 19:20 Comment(4)
I have no experience of running KVM in Azure, but as for nested virtualization, there are the Dv3 and Ev3 VM series with support for nested virtualization. See azure.microsoft.com/en-us/blog/nested-virtualization-in-azure for the announcement and for more info learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/….Edmondo
Reading a bit more about nested virtualization on Azure, one of the requirements is "host and guest must both be Windows Server 2016/Windows 10 Anniversary Update or later.". So, running KVM in a nested virtualization environment doesn't seem possible, at least not at the moment.Edmondo
This isn't programming-related and is off-topic. Also: StackOverflow isn't a discussion forum, so asking people to share experiences... is off topic as well.Entitle
It is possible. I test in my lab, it works for me. imgur.com/a/TovNVStealth
S
6

This is possible, but you need select Dv3 and Ev3 series VM. Also, based on my knowledge, Windows VM is also not supported, Linux VM is supported.

You need install kvm and virt-manager firstly.

apt-get update
apt-get install kvm qemu-kvm libvirt-bin virtinst
apt install virt-manager 
adduser `id -un` libvirt
adduser `id -un` kvm

You also need config nic like below: vi /etc/network/interfaces

iface br0 inet static
        address 192.168.0.100
        network 192.168.0.0
        netmask 255.255.255.0
        broadcast 192.168.0.255
        gateway 192.168.0.1
        bridge_ports eth0
        bridge_fd 9
        bridge_hello 2
        bridge_maxage 12
        bridge_stp off

Restart nic by using /etc/init.d/networking restart.

Now, you could create a VM by using virt-install --connect qemu:///system -n vm10 -r 512 --vcpus=2 --disk path=/var/lib/libvirt/images/vm10.img,size=12 -c /dev/cdrom --vnc --noautoconsole --os-type linux --os-variant debiansqueeze --accelerate --network=bridge:br0 --hvm .

You could check the VM's status by using virsh -c qemu:///system list, you will get like below:

root@shui:~# virsh -c qemu:///system list
 Id    Name                           State
----------------------------------------------------
 4     vm10                           running
Stealth answered 5/3, 2018 at 5:59 Comment(2)
More information about this, you could check this blog. I test in my lab, install kvm on a Linux is possible. Of course, your VM is a V3 series VM.Stealth
Works on Debian instance on Azure. I guess this was a text-book scenario, since the Hyper-V drivers were pre-installed (you'll have to use mkinitrd if you are using a custom image). Make sure that hv_vmbus is available. Again, the waagent agent was already running. You'll have to install this service if you are creating a custom image. Was able to spin up a VM and console in.Sea

© 2022 - 2024 — McMap. All rights reserved.