是否可以 运行 Azure 上的 KVM

is it possible to run KVM on Azure

Azure Fabric 运行s 在自定义版本的 Hyper-V 上,出现了。是否可以 运行 Azure 上的 KVM 虚拟化实例(使用嵌套虚拟化)?

我有一个基于 Debian(比方说)的自定义 VHD。根据此文档 https://docs.microsoft.com/en-us/azure/virtual-machines/linux/create-upload-generic,如果 Hyper-V 驱动程序内置到内核中,似乎是可能的。

有没有人运行成功运行Azure 上的 KVM 实例?如果有,能否请您分享一下您的经验。

这是可能的,但您需要select Dv3 和 Ev3 系列 VM。另外,据我所知,Windows VM 也不支持,Linux VM 受支持。

您需要先安装 kvmvirt-manager

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

您还需要如下配置网卡: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

使用/etc/init.d/networking restart重启网卡。

现在,您可以使用 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 创建 VM。

您可以使用 virsh -c qemu:///system list 查看 VM 的状态,您将得到如下结果:

root@shui:~# virsh -c qemu:///system list
 Id    Name                           State
----------------------------------------------------
 4     vm10                           running