Hello,
I cannot create a nested Ubuntu 20.04 image model on Google Cloud Platform (GCP).
I created a project in Google Cloud Platforn (GCP) and tried to create a nested Ubuntu 20.04 image model with the following command, but it returned an error and could not be created.
Command:
gcloud compute images create nested-ubuntu-focal-v2 --source-image-family=ubuntu-2004-lts --source-image-project=ubuntu-os-cloud --licenses https://www.googleapis.com/compute/v1/projects/vmoptions/global/licenses/enable-vmx
Error:
(gcloud.compute.images.create) Could not fetch resource: - The resource 'projects/vmoptions/global/licenses/enable-vmx' was not found
I have confirmed that the resource exists in GCP.
username@cloudshell:~ (my-project-ev-ng)$ gcloud compute images list
---snip---
NAME: ubuntu-minimal-2004-focal-v20230303
PROJECT: ubuntu-os-cloud
FAMILY: ubuntu-minimal-2004-lts
DEPRECATED:
STATUS: READY
---snip---
By the way, I did the same work on a different project in February of this year and was able to run the commands without problems then. Is it not possible to create the same image on multiple projects? If anyone knows a solution, I would appreciate it if you could help me.
Thanks for your help inadvance!
Hello wilkinson,
Welcome to GCC!
Can you confirm if nested virtualization is enabled on the VM? What do you get when you run:
grep -cw vmx /proc/cpuinfo
Any response other than 0, confirms that nested virtualization is already enabled.
If disabled, see Enabling nested virtualization
If enabled, see Creating nested VMs
Please also note if the grep returns 0 and reports that VM is not enabled for nesting, make sure that you started your VM with a CPU platform of Haswell or later.
For more info, see Nested virtualization overview.
Hello wilkinson,
actually you made a simple mistake,
command you used:
gcloud compute images create nested-ubuntu-focal-v2 --source-image-family=ubuntu-2004-lts --source-image-project=ubuntu-os-cloud --licenses https://www.googleapis.com/compute/v1/projects/vmoptions/global/licenses/enable-vmx.
you missed a (-) in between vm and options.
try this command : gcloud compute images create nested-ubuntu-focal --source-image-family=ubuntu-2004-lts --source-image-project=ubuntu-os-cloud --licenses https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx