Version 1.15. This version is no longer supported. For information about how to upgrade to version 1.16, see Upgrade clusters in the latest documentation. For more information about supported and unsupported versions, see the Version history page in the latest documentation.
This document is for platform administrators and application owners that run
virtual machines (VMs) in VM Runtime on GDC. This document shows you
how to manually convert an existing virtual disk image to the
qcow2
format so that you can create and run VMs in Anthos VM Runtime using that source
image. You then learn how to create a VM directly from this converted virtual
disk image.
VM Runtime on GDC automatically converts an existing disk image to
the qcow2 format during deployment if needed. However, if you want to create
multiple VMs from a non-qcow2 virtual disk image, VM Runtime on GDC
must convert the image every time. This process to convert the image to the
qcow2 format increases the amount of time it takes to create and start the VM.
To reduce the time it takes to create each VM, convert the virtual disk image to
the qcow2 format first, as shown in this document.
Before you begin
To create a VM after you convert your existing virtual disk image, you need
access to the following resources:
In this document, you use the
QEMU disk image utility
to convert existing virtual disk images to the qcow2 format. The qemu-img
tool can convert virtual disk images from multiple formats, such as vmdk or
vhdx, to the qcow2 format for use with VM Runtime on GDC.
To convert virtual disk images to the qcow2 format, complete the following
steps:
Install the qemu-utils package using your Linux distro's package manager.
Ubuntu
apt-getinstallqemu-utils
RHEL / CentOS
yuminstallqemu-utils
Use qemu-img to convert the existing virtual disk image:
If you want to see your converted virtual disk image in action, create a VM and
use the local qcow2-formatted image created in the previous section. For
production use, you should upload your converted virtual disk image to a central
repository and then
create a VM boot disk from HTTP source
or
from Cloud Storage using a Secret.
To use your local converted virtual disk image, complete the following steps:
This command creates a VM with the defaults of 2 CPU, 4 Gi memory.
Replace the following values:
VM_NAME: name for your VM
OS_TYPE: the OS type of your converted virtual disk image. Can be
linux or windows.
CONVERTED_DISK_IMAGE_NAME: the path and name of your converted qcow2
virtual disk image from the previous section.
It can take 10-20 minutes to create the VM from your locally converted
virtual disk image, depending on the size of your image. Check the status of
the VM with the kubectl command:
kubectlgetgvmVM_NAME
Replace VM_NAME with the name of your VM.
The following example output shows the VM in a Running state when the
process is complete:
NAMESTATUSAGEIP
MY_VMRunning64s192.168.2.124
What's next
You can upload your converted virtual disk image in qcow2 format to an HTTP
source or Cloud Storage. The following documents show you how to then create a
VM from those sources:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis guide demonstrates how to manually convert virtual disk images to the \u003ccode\u003eqcow2\u003c/code\u003e format for use with VM Runtime on GDC, enabling faster VM creation compared to automatic on-the-fly conversion.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eqemu-img\u003c/code\u003e tool is used to convert existing disk images of various formats (e.g., \u003ccode\u003evmdk\u003c/code\u003e, \u003ccode\u003evhdx\u003c/code\u003e) into \u003ccode\u003eqcow2\u003c/code\u003e format, with instructions provided for installing \u003ccode\u003eqemu-utils\u003c/code\u003e on both Ubuntu and RHEL/CentOS systems.\u003c/p\u003e\n"],["\u003cp\u003eYou can create a VM in your cluster directly using the locally converted \u003ccode\u003eqcow2\u003c/code\u003e image by using \u003ccode\u003ekubectl virt create vm\u003c/code\u003e command, specifying the VM name, OS type, and path to the converted image.\u003c/p\u003e\n"],["\u003cp\u003eFor production environments, it's recommended to upload your converted \u003ccode\u003eqcow2\u003c/code\u003e image to a central repository like HTTP source or Cloud Storage, and then subsequently creating VM boot disks from those locations.\u003c/p\u003e\n"]]],[],null,["# Convert a virtual disk image to qcow2 format for use in VM Runtime on GDC\n\n\u003cbr /\u003e\n\nThis document is for platform administrators and application owners that run\nvirtual machines (VMs) in VM Runtime on GDC. This document shows you\nhow to manually convert an existing virtual disk image to the\n[`qcow2`](https://wikipedia.org/wiki/Qcow)\nformat so that you can create and run VMs in Anthos VM Runtime using that source\nimage. You then learn how to create a VM directly from this converted virtual\ndisk image.\n\nVM Runtime on GDC automatically converts an existing disk image to\nthe `qcow2` format during deployment if needed. However, if you want to create\nmultiple VMs from a non-`qcow2` virtual disk image, VM Runtime on GDC\nmust convert the image every time. This process to convert the image to the\n`qcow2` format increases the amount of time it takes to create and start the VM.\nTo reduce the time it takes to create each VM, convert the virtual disk image to\nthe `qcow2` format first, as shown in this document.\n\nBefore you begin\n----------------\n\nTo create a VM after you convert your existing virtual disk image, you need\naccess to the following resources:\n\n- Access to Google Distributed Cloud version 1.12.0 (`anthosBareMetalVersion: 1.12.0`) or higher cluster. You can use any cluster type capable of running workloads. If needed, [try Distributed Cloud on Compute Engine](/anthos/clusters/docs/bare-metal/1.15/try/gce-vms) or see the [cluster creation overview](/anthos/clusters/docs/bare-metal/1.15/installing/creating-clusters/create-clusters-overview).\n- The `virtctl` client tool installed as a plugin for `kubectl`. If needed, [install the virtctl client tool](/anthos/clusters/docs/bare-metal/1.15/vm-runtime/quickstart#install_the_virtctl_client_tool).\n\nConvert a virtual disk image\n----------------------------\n\nIn this document, you use the\n[QEMU disk image utility](https://www.qemu.org/docs/master/tools/qemu-img.html)\nto convert existing virtual disk images to the `qcow2` format. The `qemu-img`\ntool can convert virtual disk images from multiple formats, such as `vmdk` or\n`vhdx`, to the `qcow2` format for use with VM Runtime on GDC.\n\nTo convert virtual disk images to the `qcow2` format, complete the following\nsteps:\n\n1. Install the `qemu-utils` package using your Linux distro's package manager.\n\n ### Ubuntu\n\n apt-get install qemu-utils\n\n ### RHEL / CentOS\n\n yum install qemu-utils\n\n2. Use `qemu-img` to convert the existing virtual disk image:\n\n qemu-img convert -f \u003cvar label=\"existing_disk_image_format\" translate=\"no\"\u003eEXISTING_DISK_IMAGE_FORMAT\u003c/var\u003e -O qcow2 \\\n \u003cvar label=\"existing_disk_image_name\" translate=\"no\"\u003eEXISTING_DISK_IMAGE_NAME\u003c/var\u003e \\\n \u003cvar label=\"converted_disk_image_name\" translate=\"no\"\u003eCONVERTED_DISK_IMAGE_NAME\u003c/var\u003e.qcow2\n\n Replace the following values:\n - \u003cvar translate=\"no\"\u003eEXISTING_DISK_IMAGE_FORMAT\u003c/var\u003e: the format of your existing virtual disk image, such as `vmdk`.\n - \u003cvar translate=\"no\"\u003eEXISTING_DISK_IMAGE_NAME\u003c/var\u003e: the path and name of your existing virtual disk image.\n - \u003cvar translate=\"no\"\u003eCONVERTED_DISK_IMAGE_NAME\u003c/var\u003e: the path and name for your converted `qcow2` virtual disk image.\n\n For more information on the `qemu-img` tool, such as the different image format\n options, see the\n [QEMU disk image utility documentation](https://www.qemu.org/docs/master/tools/qemu-img.html).\n\nCreate a VM with your converted image\n-------------------------------------\n\nIf you want to see your converted virtual disk image in action, create a VM and\nuse the local `qcow2`-formatted image created in the previous section. For\nproduction use, you should upload your converted virtual disk image to a central\nrepository and then\n[create a VM boot disk from HTTP source](/anthos/clusters/docs/bare-metal/1.15/vm-runtime/create-manage-disks#from_image)\nor\n[from Cloud Storage using a Secret](/anthos/clusters/docs/bare-metal/1.15/vm-runtime/create-storage-credentials#use_a_secret_to_import_an_image).\n\nTo use your local converted virtual disk image, complete the following steps:\n\n1. Create a VM in your cluster:\n\n kubectl virt create vm \u003cvar label=\"vm_name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e \\\n --os-type \u003cvar label=\"os_type\" translate=\"no\"\u003eOS_TYPE\u003c/var\u003e \\\n --image \u003cvar label=\"converted_disk_image_name\" translate=\"no\"\u003eCONVERTED_DISK_IMAGE_NAME\u003c/var\u003e.qcow2\n\n This command creates a VM with the defaults of 2 CPU, 4 Gi memory.\n\n Replace the following values:\n - \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e: name for your VM\n - \u003cvar translate=\"no\"\u003eOS_TYPE\u003c/var\u003e: the OS type of your converted virtual disk image. Can be `linux` or `windows`.\n - \u003cvar translate=\"no\"\u003eCONVERTED_DISK_IMAGE_NAME\u003c/var\u003e: the path and name of your converted `qcow2` virtual disk image from the previous section.\n2. It can take 10-20 minutes to create the VM from your locally converted\n virtual disk image, depending on the size of your image. Check the status of\n the VM with the `kubectl` command:\n\n kubectl get gvm \u003cvar label=\"vm_name\" translate=\"no\"\u003eVM_NAME\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of your VM.\n\n The following example output shows the VM in a `Running` state when the\n process is complete: \n\n NAME STATUS AGE IP\n MY_VM Running 64s 192.168.2.124\n\nWhat's next\n-----------\n\nYou can upload your converted virtual disk image in `qcow2` format to an HTTP\nsource or Cloud Storage. The following documents show you how to then create a\nVM from those sources:\n\n- [Create a VM boot disk from HTTP source](/anthos/clusters/docs/bare-metal/1.15/vm-runtime/create-manage-disks#from_image)\n- [Create a VM boot disk from Cloud Storage using a Secret](/anthos/clusters/docs/bare-metal/1.15/vm-runtime/create-storage-credentials#use_a_secret_to_import_an_image)"]]