是否可以在 Azure 上运行 KVM

top*_*pur 4 hyper-v kvm azure azure-virtual-machine

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

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

有没有人在 Azure 上成功运行过 KVM 实例?如果是这样,请您分享您的经验。

Shu*_*bao 5

这是可能的,但您需要选择 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
Run Code Online (Sandbox Code Playgroud)

您还需要像下面这样的配置 nic: 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
Run Code Online (Sandbox Code Playgroud)

使用/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,您将得到如下结果:

root@shui:~# virsh -c qemu:///system list
 Id    Name                           State
----------------------------------------------------
 4     vm10                           running
Run Code Online (Sandbox Code Playgroud)