Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Linux
Dokumen ini menjelaskan dukungan Compute Engine untuk virtualisasi bertingkat.
Dengan virtualisasi bertingkat, Anda dapat menjalankan instance virtual machine (VM) di dalam
VM lain sehingga Anda dapat membuat lingkungan virtualisasi Anda sendiri. Untuk mendukung
virtualisasi bertingkat, Compute Engine menambahkan
instruksi Intel Virtualization Technology (VT-x)
ke VM, sehingga saat Anda membuat VM, hypervisor yang sudah ada di
VM tersebut dapat menjalankan VM tambahan.
VM Compute Engine berjalan pada host fisik yang dilengkapi hypervisor
Google berbasis KVM yang telah melalui proses hardening dengan keamanan.
Dengan virtualisasi bertingkat, host fisik dan hypervisor-nya adalah lingkungan level 0
(L0). Lingkungan L0 dapat menghosting beberapa VM level 1 (L1). Pada setiap
VM L1 terdapat hypervisor lain, yang digunakan untuk menginstal VM level 2 (L2).
Gambar 1 menunjukkan hubungan antara host fisik, VM L1, dan
VM L2:
Gambar 1. Host fisik L0 dengan VM L1 dan VM L2.
Kasus penggunaan
Skenario yang dapat Anda pertimbangkan untuk menggunakan virtualisasi bertingkat meliputi
hal berikut:
Anda memiliki VM yang tidak dapat dijalankan di Compute Engine: Misalnya, Anda
mungkin memiliki solusi pemulihan dari bencana untuk workload lokal yang
berjalan di VM yang dialihkan ke VM Compute Engine. Dengan menjalankan
virtualisasi bertingkat, waktu yang Anda perlukan untuk mentransfer
VM ke Compute Engine menjadi lebih singkat.
Anda memiliki framework validasi software yang digunakan untuk menguji dan memvalidasi versi
baru paket software di berbagai versi OS yang berbeda: Dengan
virtualisasi bertingkat, Anda dapat menghindari konversi dan pengelolaan library
image Compute Engine.
Pertimbangan performa
Dengan virtualisasi bertingkat yang dibantu hardware sekalipun, VM bertingkat dapat mengalami
penurunan performa sebesar 10% atau lebih untuk workload yang terikat ke CPU dan
penurunan yang kemungkinan lebih besar dari 10% untuk workload yang terikat input/output.
Pembatasan
VM L1 memiliki pembatasan berikut:
Satu-satunya hypervisor yang didukung di VM L1 adalah KVM Linux; Hyper-V Microsoft
tidak didukung.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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)."]]