简体   繁体   English

谷歌云平台 KVM 支持

[英]Google Cloud Platform KVM Support

I have just created a server in GCP.我刚刚在 GCP 中创建了一个服务器。 It is a Ubuntu that i want to use with GNS3.这是我想与 GNS3 一起使用的 Ubuntu。 The problem is that machines created in GCP does not have KVM support.问题是在 GCP 中创建的机器不支持 KVM。 Is there sone way to use it in GCP?有没有办法在 GCP 中使用它? Regards!!问候!!

For now GCP Compute Engine supports KVM based nested virtualization - check docs here .目前 GCP Compute Engine 支持基于 KVM 的嵌套虚拟化 - 请在此处查看文档。

The GCP Compute Engine supports KVM virtualization module but isn't super clear about how to actually create the instance. GCP Compute Engine 支持 KVM 虚拟化模块,但并不清楚如何实际创建实例。 Here is a concrete way to create a cloud instance that supports KVM.下面是创建支持 KVM 的云实例的具体方法。

gcloud compute instances create kvm1 \
    --zone=us-central1-a \
    --min-cpu-platform="Intel Haswell" \
    --image-project=ubuntu-os-cloud \
    --image=ubuntu-2004-focal-v20220610 \
    --boot-disk-size 200GB \
    --machine-type=n1-standard-16 \
    --enable-nested-virtualization

After creating the instance I SSHd into the machine to verify that KVM can be used:创建实例后,我通过 SSHd 进入机器以验证 KVM 是否可以使用:

>> ls /dev/kvm
/dev/kvm

>> egrep -c '(vmx|svm)' /proc/cpuinfo
32

>> sudo apt install cpu-checker
>> sudo kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used

This worked for my use-case of building AOSP.这适用于我构建 AOSP 的用例。

GCE doesn't have support for nested. GCE 不支持嵌套。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM