简体   繁体   English

如何在现有的 Google Cloud VM 实例上启用嵌套虚拟化?

[英]How to enable Nested Virtualization on an existing Google cloud VM instance?

I'm trying to enable Nested Virtualization on a existing VM instance.我正在尝试在现有 VM 实例上启用嵌套虚拟化。 The VM is on the Intel Haswell CPU platform so Nested Virtualization is possible. VM 位于 Intel Haswell CPU 平台上,因此可以实现嵌套虚拟化。

Now I've read this support article at Google: https://cloud.google.com/compute/docs/instances/enable-nested-virtualization-vm-instances现在我在谷歌阅读了这篇支持文章: https : //cloud.google.com/compute/docs/instances/enable-nested-virtualization-vm-instances

Under the first section Enabling nested virtualization on an instance it says the following:在第一部分在实例上启用嵌套虚拟化它说如下:

Create a boot disk from a public image or from a custom image with an operating system.从公共映像或具有操作系统的自定义映像创建启动磁盘。 Alternatively, you can skip this step and apply the license to an existing disk from one of your VM instances.或者,您可以跳过此步骤并将许可证应用到您的一个 VM 实例中的现有磁盘。

However I can't figure out how to apply the Nested Virtualization license to an existing VM instance.但是我不知道如何将嵌套虚拟化许可证应用于现有的 VM 实例。 The only steps described are for new disks and I want to apply it to an existing disk.描述的唯一步骤适用于新磁盘,我想将其应用于现有磁盘。

My question is: How can I enable Nested Virtualization on a existing Google Cloud Instance?我的问题是:如何在现有的 Google Cloud 实例上启用嵌套虚拟化?

Thanks in advance, Hugo.提前致谢,雨果。

I will share with you instructions on how to enable Nested Virtualization on an existing GCP VM instance.我将与您分享有关如何在现有 GCP 虚拟机实例上启用嵌套虚拟化的说明。 More detailed steps are described in the article you shared . 您分享的文章中描述更详细的步骤。

  1. From your existing VM instance, you should already have a boot disk in your project.从现有的 VM 实例中,您的项目中应该已经有一个启动盘 If not, you should create a boot disk from that VM instance.如果没有,您应该从该 VM 实例创建一个启动磁盘。

  2. Using the boot disk from that existing VM instance, please create a custom image with the special license key required for virtualization.使用来自该现有 VM 实例的启动磁盘,请使用虚拟化所需的特殊许可证密钥创建自定义映像。

    a- If you are creating an image using the gcloud command-line tool, provide the following license URL using the --licenses flag: a- 如果您使用gcloud命令行工具创建映像,请使用--licenses标志提供以下许可证 URL:

    https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx

    For example, the following command creates an image named nested-vm-image from an example disk named disk1 :例如,以下命令从名为disk1的示例磁盘创建名为nested-vm-image

    $ gcloud compute images create nested-vm-image \\ --source-disk disk1 --source-disk-zone us-central1-b \\ --licenses "https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx"

    b- If you are using the API, please include the licenses property in your API request: b- 如果您正在使用 API,请在您的 API 请求中包含 licenses 属性:

    POST https://www.googleapis.com/compute/v1/projects/[PROJECT_ID]/global/images { "licenses": ["projects/vm-options/global/licenses/enable-vmx"], "name": "nested-vm-image", "sourceDisk": "zones/us-central1-b/disks/disk1" }

    where [PROJECT_ID] is your project ID.其中 [PROJECT_ID] 是您的项目 ID。

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

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