Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Linux
Questo documento descrive il supporto di Compute Engine per la virtualizzazione nidificata.
La virtualizzazione nidificata ti consente di eseguire istanze di macchine virtuali (VM) all'interno di
altre VM in modo da poter creare i tuoi ambienti di virtualizzazione. Per supportare
la virtualizzazione nidificata, Compute Engine aggiunge
le istruzioni Intel Virtualization Technology (VT-x)
alle VM, in modo che quando crei una VM, l'hypervisor già presente
in quella VM possa eseguire altre VM.
Le VM Compute Engine vengono eseguite su un host fisico con l'hypervisor basato su KVM di Google
con sicurezza avanzata.
Con la virtualizzazione nidificata, l'host fisico e il relativo hypervisor costituiscono l'ambiente di livello 0 (L0). L'ambiente L0 può ospitare più VM di livello 1 (L1). Su ogni VM L1 è presente un altro hypervisor, utilizzato per installare le VM di livello 2 (L2).
La Figura 1 mostra la relazione tra l'host fisico, le VM L1 e le
VM L2:
Figura 1. Host fisico L0 con VM L1 e VM L2.
Casi d'uso
Di seguito sono riportati alcuni scenari in cui potresti prendere in considerazione l'utilizzo della virtualizzazione nidificata:
Hai VM che non puoi eseguire su Compute Engine: ad esempio, potresti avere una soluzione di ripristino di emergenza per un workload on-premise in esecuzione su VM che eseguono il failover sulle VM Compute Engine. L'esecuzione
della virtualizzazione nidificata potrebbe farti risparmiare tempo che altrimenti impiegheresti per eseguire il porting
delle VM in Compute Engine.
Hai un framework di convalida del software che utilizzi per testare e convalidare nuove versioni di un pacchetto software su numerose versioni di diversi sistemi operativi: l'utilizzo della virtualizzazione nidificata ti consente di evitare di convertire e gestire una libreria di immagini Compute Engine.
Considerazioni sulle prestazioni
Anche con la virtualizzazione nidificata assistita dall'hardware, le VM nidificate potrebbero subire una
riduzione delle prestazioni del 10% o superiore per i carichi di lavoro vincolati alla CPU e
possibilmente superiore al 10% per i carichi di lavoro vincolati all'input/output.
Limitazioni
Le VM L1 presentano le seguenti limitazioni:
L'unico hypervisor supportato in una VM L1 è Linux KVM; Microsoft Hyper-V
non è supportato.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-08-18 UTC."],[[["\u003cp\u003eNested virtualization in Compute Engine allows running virtual machines (VMs) inside other VMs, enabling the creation of custom virtualization environments.\u003c/p\u003e\n"],["\u003cp\u003eCompute Engine uses a security-hardened, KVM-based hypervisor at level 0 (L0), which hosts level 1 (L1) VMs, each capable of running another hypervisor for level 2 (L2) VMs.\u003c/p\u003e\n"],["\u003cp\u003eNested virtualization can be useful for running VMs incompatible with Compute Engine or for testing software on various operating systems without managing numerous Compute Engine images.\u003c/p\u003e\n"],["\u003cp\u003eNested VMs may experience a performance decrease of 10% or more, especially in CPU or input/output-bound workloads, and certain VM types are not compatible.\u003c/p\u003e\n"],["\u003cp\u003eEnabling nested virtualization involves checking constraints, creating an L1 VM with the feature enabled, and then creating the nested L2 VM.\u003c/p\u003e\n"]]],[],null,["# About nested virtualization\n\nLinux\n\n*** ** * ** ***\n\nThis document describes Compute Engine support for nested virtualization.\nNested virtualization lets you run virtual machine (VM) instances inside of\nother VMs so you can create your own virtualization environments. To support\nnested virtualization, Compute Engine adds\n[Intel Virtualization Technology (VT-x)](https://en.wikipedia.org/wiki/X86_virtualization#Intel_virtualization_(VT-x))\ninstructions to VMs, so when you create a VM, the hypervisor that is already on\nthat VM can run additional VMs.\n\nCompute Engine VMs run on a physical host that has [Google's\nsecurity-hardened, KVM-based hypervisor](https://cloud.google.com/blog/products/gcp/7-ways-we-harden-our-kvm-hypervisor-at-google-cloud-security-in-plaintext).\nWith nested virtualization, the physical host and its hypervisor are the level 0\n(L0) environment. The L0 environment can host multiple level 1 (L1) VMs. On each\nL1 VM is another hypervisor, which is used to install the level 2 (L2) VMs.\nFigure 1 shows the relationship between the physical host, the L1 VMs, and the\nL2 VMs:\n[](/static/compute/images/nested-virtualization-diagram.svg) **Figure 1.** L0 physical host with L1 VMs and L2 VMs.\n\nUse cases\n---------\n\nScenarios where you might consider using nested virtualization include the\nfollowing:\n\n- You have VMs that you can't run on Compute Engine: For example, you\n might have a disaster recovery solution for an on-premises workload that is\n running on VMs that fail over to Compute Engine VMs. Running\n nested virtualization might save you time that you would use to port\n your VMs to Compute Engine.\n\n- You have a software-validation framework that you use to test and validate new\n versions of a software package on numerous versions of different OSes: Using\n nested virtualization lets you avoid converting and managing a library of\n Compute Engine images.\n\nPerformance considerations\n--------------------------\n\nEven with hardware-assisted nested virtualization, nested VMs might experience a\n10% or greater decrease in performance for workloads that are CPU-bound and\npossibly greater than a 10% decrease for workloads that are input/output bound.\n\nRestrictions\n------------\n\nL1 VMs have the following restrictions:\n\n- The only hypervisor supported in an L1 VM is Linux KVM; Microsoft Hyper-V\n isn't supported.\n\n- You can't use the following VMs:\n\n - E2 VMs\n\n - [Memory-optimized VMs](/compute/docs/machine-resource#memory-optimized_machine_family_guide)\n\n - VMs powered by [AMD and Arm processors](/compute/docs/cpu-platforms)\n\n For information about the processors supported in each zone, see\n [Available regions and zones](/compute/docs/regions-zones#available).\n\nL2 VMs have the following restrictions:\n\n- For licensed operating systems, you must [bring your own licenses](/compute/docs/nodes/bringing-your-own-licenses).\n\nUsing nested virtualization\n---------------------------\n\nTo use nested virtualization, complete the following steps:\n\n1. [Check whether the nested virtualization constraint is\n disabled](/compute/docs/instances/nested-virtualization/managing-constraint)\n\n2. [Create an L1 VM that has nested virtualization\n enabled](/compute/docs/instances/nested-virtualization/enabling)\n\n3. [Create a nested L2\n VM](/compute/docs/instances/nested-virtualization/creating-nested-vms)\n\nIf you run into any issues while creating a VM that has nested virtualization\nenabled or creating nested VMs, see [Troubleshoot nested virtualization](/compute/docs/troubleshooting/troubleshooting-nested-vms)."]]