Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Jika Anda memiliki disk virtual di lingkungan lokal dengan software dan
konfigurasi yang Anda butuhkan, yang terkadang disebut sebagai disk emas atau
image emas, Anda dapat menghemat waktu dengan mengimpor disk virtual tersebut ke
perangkat air-gapped GDC dan menggunakan image yang dihasilkan untuk membuat mesin
virtual. Alat impor mendukung format gambar RAW dan QCOW.
Sebelum memulai
Sebelum melanjutkan, pastikan Anda memiliki hal berikut:
gdcloud CLI didownload, diinstal, dan dikonfigurasi. Semua perintah CLI untuk
GDC menggunakan CLI gdcloud atau kubectl, dan memerlukan
lingkungan sistem operasi (OS).
Akses ke server Management API. Ikuti langkah-langkah CLI di
Login
untuk login ke server Management API.
Meminta izin dan akses
Untuk melakukan tugas yang tercantum di halaman ini, Anda harus memiliki peran Project VirtualMachine Admin dan Project VirtualMachine Image Admin. Ikuti langkah-langkah untuk memverifikasi atau meminta Admin IAM Project menetapkan peran Project VirtualMachine Admin (project-vm-admin) dan Project VirtualMachine Image Admin (project-vm-image-admin) kepada Anda di namespace project tempat VM berada.
Untuk operasi VM menggunakan konsol GDC atau gdcloud CLI, minta Admin IAM Project Anda untuk memberi Anda peran yang tercantum di paragraf sebelumnya dan peran Project Viewer (project-viewer).
Untuk mendapatkan izin yang diperlukan untuk mengimpor image, minta Admin IAM Organisasi Anda untuk memberi Anda peran Project VirtualMachine Image Admin (project-vm-image-admin) untuk project Anda.
gdcloud
Gunakan perintah gdcloud compute images import untuk membuat image yang dapat di-booting.
Perintah import memastikan bahwa disk memiliki paket yang diperlukan, termasuk lingkungan tamu, yang diperlukan untuk mengonfigurasi kredensial agar terhubung ke instance menggunakan secure shell (SSH) di Linux dan Remote Desktop Protocol (RDP) di Windows.
Di Linux, perintah ini juga menginstal paket untuk Network Time Protocol (NTP)
dan cloud-init agar instance berjalan dengan benar di
GDC.
Anda dapat mengimpor file disk virtual langsung dari workstation Anda. Alat impor otomatis mengupload file ke bucket penyimpanan objek di project Anda.
IMAGE_NAME: nama image tujuan Anda. Nama tidak boleh lebih dari 35 karakter.
SOURCE_FILE: file disk virtual Anda. File ini adalah file lokal di workstation Anda. Anda dapat memberikan jalur
absolut atau relatif.
IMAGE_OS: OS pada disk yang akan diimpor.
TIMEOUT: durasi waktu impor dapat berlangsung sebelum gagal
dengan "TIMEOUT". Misalnya, jika Anda menentukan 2h, proses akan gagal setelah 2 jam.
Waktu tunggu default adalah 1h.
Operasi upload dapat memerlukan waktu yang lama, bergantung pada ukuran
disk virtual dan kecepatan koneksi jaringan Anda. Operasi impor dapat membutuhkan waktu puluhan menit untuk dijalankan, bergantung pada ukuran disk.
API
Sebelum memulai proses impor dengan API, Anda harus mengupload disk virtual ke bucket penyimpanan objek bernama vm-images-bucket. Untuk membuat bucket penyimpanan objek, lihat Membuat bucket penyimpanan untuk project.
Untuk mengimpor disk virtual melalui API, lakukan hal berikut:
Buat objek VirtualMachineImageImport di server Management API untuk memulai proses impor gambar:
Nama gambar yang akan diimpor. Nama tidak boleh lebih dari 35 karakter.
PROJECT_ID
Project ID untuk project tempat Anda ingin mengimpor image.
SOURCE_FILE
Nama file sumber yang berisi upload disk virtual ke penyimpanan objek. Nilai ini adalah bagian dari jalur penyimpanan objek setelah vm-images-bucket/.
OPERATING_SYSTEM
OS di disk yang akan diimpor.
DISK_SIZE
Ukuran minimum disk yang harus dimiliki untuk dibuat dengan image ini. Sebaiknya gunakan buffer minimal 20% di atas ukuran sistem file gambar asli. Misalnya: gunakan setidaknya 12 GiB untuk disk virtual dengan ukuran sistem file asli 10 GiB.
Pantau progres impor dengan membuat kueri status objek
VirtualMachineImageImport:
Proses impor melibatkan penguploadan file disk virtual Anda ke penyimpanan objek.
Jika Anda menggunakan gdcloud CLI, objek akan dibersihkan saat perintah selesai, baik berhasil maupun tidak. Jika perintah terganggu, atau
impor image dilakukan dengan API, file disk virtual mungkin tetap berada di
bucket penyimpanan objek bernama vm-images-bucket hingga Anda menghapus file
secara manual.
[[["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-09-04 UTC."],[[["\u003cp\u003eYou can import existing virtual disks (golden disks/images) from your on-premises environment into the GDC air-gapped appliance, saving time when creating new virtual machines.\u003c/p\u003e\n"],["\u003cp\u003eThe import tool supports both RAW and QCOW image formats and can be done through the \u003ccode\u003egdcloud\u003c/code\u003e CLI or the Virtual Machine Manager API, requiring the "Project VirtualMachine Image Admin" role.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egdcloud\u003c/code\u003e CLI allows direct import from your workstation, while the API requires you to first upload the virtual disk to an object storage bucket named \u003ccode\u003evm-images-bucket\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eimport\u003c/code\u003e command via the \u003ccode\u003egdcloud\u003c/code\u003e CLI ensures the disk has necessary packages, such as the guest environment for SSH or RDP and on Linux packages for NTP and \u003ccode\u003ecloud-init\u003c/code\u003e, for proper instance operation in GDC.\u003c/p\u003e\n"],["\u003cp\u003eAfter a successful import, a virtual machine instance can be created that utilizes the imported image.\u003c/p\u003e\n"]]],[],null,["# Import virtual disks\n\nIf you have virtual disks in your on-premises environment with software and\nconfigurations that you need, occasionally referred to as *golden disks* or\n*golden images*, you can save time by importing those virtual disks into\nGDC air-gapped appliance and using the resulting image to create virtual\nmachines. The import tool supports RAW and QCOW image formats.\n\nBefore you begin\n----------------\n\nBefore continuing, ensure that you have the following:\n\n- The [gdcloud CLI](/distributed-cloud/hosted/docs/latest/appliance/resources/gdcloud-overview) downloaded, installed, and configured. All CLI commands for GDC use the `gdcloud` or `kubectl` CLI, and require an operating system (OS) environment.\n\n\u003c!-- --\u003e\n\n- Access to the Management API server. Follow the CLI steps in\n [Sign in](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/iam/sign-in#cli)\n to sign in to the Management API server.\n\n | **Note:** Record the path to the generated file, such as `/tmp/org-1-admin-kubeconfig.yaml`. Use the path to replace \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER_KUBECONFIG\u003c/var\u003e in these instructions.\n\n### Request permissions and access\n\nTo perform the tasks listed in this page, you must have the Project\nVirtualMachine Admin and Project VirtualMachine Image Admin roles. Follow the\nsteps to either\n[verify](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/vms/preparation#verify-user-access)\nor have your Project IAM Admin\n[assign](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/vms/preparation#grant-user-access-vm-resources)\nyou the Project VirtualMachine Admin (`project-vm-admin`) and the Project\nVirtualMachine Image Admin (`project-vm-image-admin`) roles in the namespace\nof the project where the VM resides.\n\nFor VM operations using the GDC console or the gdcloud CLI,\nrequest your Project IAM Admin to assign you the roles listed in the previous\nparagraph and the Project Viewer (`project-viewer`) role.\n\nImport virtual disks\n--------------------\n\nYou can import your virtual disks using either the\ngdcloud CLI or the\n[Virtual Machine Manager API](/distributed-cloud/hosted/docs/latest/appliance/apis/service/virtualmachine/vmm-api-overview).\n\nTo get the permissions you need to import images, ask your Organization IAM\nAdmin to grant you the Project VirtualMachine Image Admin\n(`project-vm-image-admin`) role for your project. \n\n### gdcloud\n\nUse the `gdcloud compute images import` command to create a bootable image.\n\nThe `import` command ensures that the disk has the required packages,\nincluding the guest environment, which is required to configure credentials\nfor connecting to the instance using secure shell (SSH) on Linux and Remote\nDesktop Protocol (RDP) on Windows.\n\nOn Linux, the command also installs packages for network time protocol (NTP)\nand `cloud-init` for the instance to run properly in\nGDC.\n\nYou can import virtual disk files directly from your workstation. The import\ntool automatically uploads the file to an object storage bucket in your\nproject. \n\n gdcloud compute images import \u003cvar translate=\"no\"\u003eIMAGE_NAME\u003c/var\u003e \\\n --source-file=\u003cvar translate=\"no\"\u003eSOURCE_FILE\u003c/var\u003e \\\n --os=\u003cvar translate=\"no\"\u003eIMAGE_OS\u003c/var\u003e \\\n --timeout=\u003cvar translate=\"no\"\u003eTIMEOUT\u003c/var\u003e\n\nReplace the following variables:\n\n- \u003cvar translate=\"no\"\u003eIMAGE_NAME\u003c/var\u003e: the name of your destination image. The name must be no longer than 35 characters.\n- \u003cvar translate=\"no\"\u003eSOURCE_FILE\u003c/var\u003e: your virtual disk file. This file is a local file on your workstation. You can provide an absolute or relative path.\n- \u003cvar translate=\"no\"\u003eIMAGE_OS\u003c/var\u003e: the OS on the disk to import.\n- \u003cvar translate=\"no\"\u003eTIMEOUT\u003c/var\u003e: the time an import can last before it fails with \"TIMEOUT\". For example, if you specify `2h`, the process fails after 2 hours. The default timeout is `1h`.\n\nThe upload operation can take an extended period of time depending on the size\nof your virtual disk and the speed of your network connection. The import\noperation can take tens of minutes to run depending on the size of the disk.\n\n\u003cbr /\u003e\n\n### API\n\nBefore starting the import process with the API, you need to upload your\nvirtual disk to an object storage bucket named `vm-images-bucket`. To create\nan object storage bucket, see\n[Create storage buckets for projects](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/create-storage-buckets).\n\nTo import a virtual disk through the API, do the following:\n\n1. Create a `VirtualMachineImageImport` object in the Management API server to start the\n image import process:\n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER_KUBECONFIG\u003c/var\u003e \\\n apply -n \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e -f - \u003c\u003cEOF\n apiVersion: virtualmachine.gdc.goog/v1\n kind: VirtualMachineImageImport\n metadata:\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eIMAGE_NAME\u003c/span\u003e\u003c/var\u003e\n namespace: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003ePROJECT_ID\u003c/span\u003e\u003c/var\u003e\n spec:\n source:\n objectStorage:\n bucketRef:\n name: vm-images-bucket\n objectName: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eSOURCE_FILE\u003c/span\u003e\u003c/var\u003e\n imageMetadata:\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eIMAGE_NAME\u003c/span\u003e\u003c/var\u003e\n operatingSystem: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eOPERATING_SYSTEM\u003c/span\u003e\u003c/var\u003e\n minimumDiskSize: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eDISK_SIZE\u003c/span\u003e\u003c/var\u003e\n EOF\n\n Replace the following variables:\n\n2. Monitor the progress of the import by querying the status of the\n `VirtualMachineImageImport` object:\n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER_KUBECONFIG\u003c/var\u003e \\\n get virtualmachineimageimport --namespace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n \u003cvar translate=\"no\"\u003eIMAGE_NAME\u003c/var\u003e -o jsonpath='{.status}'\n\n### Clean up resources\n\nThe import process involves uploading your virtual disk file to object storage.\nIf you use the gdcloud CLI, the object is cleaned up when the command\nfinishes, whether or not it was successful. If the command is interrupted, or\nthe image import is done with the API, the virtual disk file might remain in\nthe object storage bucket named `vm-images-bucket` until you manually delete\nthe file.\n\nWhat's next\n-----------\n\nCreate a new VM instance that uses your image in the page,\n[Create and start a VM](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/vms/create-a-vm/create-and-start)."]]