Stay organized with collections Save and categorize content based on your preferences.
Linux Windows
If you have virtual disks in your on-premises environment with software and configurations that you need (sometimes referred to as golden disks or golden images), you can save time by importing those virtual disks into Compute Engine and using the resulting image to create virtual machines. The Migrate to Virtual Machines import tool supports most virtual disk file formats, including VMDK and VHD.
Before you beginYou can import virtual disk image files in the following formats using Migrate to Virtual Machines:
In addition to these formats, a raw file compressed as a .tar.gz is also supported. Verify that the compressed file contains a single file named disk.raw.
LimitationsYou can import disk images with Arm architecture to the following regions:
Region description Region name Jurong West, Singaporeasia-southeast1
Tokyo, Japan asia-northeast1
Sydney, Australia australia-southeast1
Stockholm, Sweden europe-north2
St. Ghislain, Belgium europe-west1
London, England europe-west2
Frankfurt, Germany europe-west3
Eemshaven, Netherlands europe-west4
Paris, France europe-west9
Damman, Saudi Arabia me-central2
Tel Aviv, Israel me-west1
Montréal, Québec northamerica-northeast1
Queretaro, Mexico northamerica-south1
São Paulo, Brazil southamerica-east1
Iowa, North America us-central1
South Carolina, North America us-east1
Virginia, North America us-east4
Columbus, North America us-east5
Dallas, North America us-south1
Oregon, North America us-west1
California, North America us-west2
Utah, North America us-west3
Nevada, North America us-west4
Image import process
To import a virtual disk image to a Compute Engine image using Migrate to Virtual Machines, use the following steps:
To import a virtual disk image to a Compute Engine image, you must first prepare the virtual disk image file for import. The following sections discuss these tasks in detail.
Add the virtual disk image file to Cloud StorageTo import a virtual disk image to a Compute Engine image, you must first add the virtual disk image file to Cloud Storage. For more information, see Upload objects from a file system. For better performance, we recommend that you upload the virtual disk image file to a bucket in the same cloud region in which you want to create the image.
Grant the required permissionsTo import a virtual disk image to a Compute Engine image, grant permissions as described in the following table.
Role Permissions required Description Storage Object Viewerroles/storage.objectViewer
Grant the default Migrate to Virtual Machines service account in the host project (service-HOST_PROJECT_NUMBER@gcp-sa-vmmigration.iam.gserviceaccount.com
) the roles/storage.objectViewer
role on the bucket where the image you want to import resides. This permission lets Migrate to Virtual Machines access the source image. VM Migration Administrator roles/vmmigration.admin
In the host project, grant the user account that you want to use to import the source image the roles/vmmigration.admin
role. VM Migration Service Account roles/vmmigration.serviceAgent
Grant the default Migrate to Virtual Machines service account in the host project (service-HOST_PROJECT_NUMBER@gcp-sa-vmmigration.iam.gserviceaccount.com
) the roles/vmmigration.serviceAgent
role on the target project. For example, if service-1234567890@gcp-sa-vmmigration.iam.gserviceaccount.com
is the Migrate to Virtual Machines service account in the host project, you must grant this service account the roles/vmmigration.serviceAgent
role to be able to create the image in the target project. Choose a target project
To host the Compute Engine image, you must create or choose a target project. A target project defines the destination project for a Compute Engine image. For more information on creating or choosing a target project, see Adding a target project.
Import a virtual disk image to Compute EngineYou can import a virtual disk image to Compute Engine using the Google Cloud console, Google Cloud CLI, or REST API commands.
ConsoleTo import a virtual disk image to Compute Engine using the Google Cloud console, use the following steps.
gs://
prefix. .vmdk
and .tar.gz
files. Region The region in which you want to create the image. For a list of supported regions, see Regions and zones. Target project The target project in which you want to create the image. If you've not already added a target project, do so using the instructions given in Add a target project. Family (Optional) Select the image family. Compute Engine provides image families to help you make sure that your automation systems can reference the latest images. As an administrator, you can group a set of images as an image family. For more information, see Public image families. Description (Optional) Add a description for the image. Skip OS adaptation To skip OS adaptation, click the Skip OS adaptation toggle to the on position. https://www.googleapis.com/compute/beta/projects/windows-sql-cloud/global/licenses/sql-server-2012-enterpriseLabels To organize your project, add labels as key-value pairs to your resources. See Organize resources using labels. Encryption Google-managed encryption key Choose this option to use Google-owned and Google-managed encryption keys to encrypt your data during the import process. For more information, see encrypts data when it is at rest. Customer managed encryption key Choose this option to use customer-managed encryption keys (CMEK) to encrypt your data during the import process, and the data of the image created by the import process. If you have specific compliance or regulatory requirements related to the keys that protect your data, you can use CMEK to encrypt and decrypt your data. These encryption keys are created, managed, and owned by you. For more information, see Protect resources by using Cloud KMS keys.
roles/vmmigration.serviceAgen
Grant this permission to the Compute Engine service account to encrypt data of the image created during the import process. Compute Engine Service Agent roles/compute.serviceAgent
Grant this permission to the Migrate to Virtual Machines service agent to encrypt the data during the import process.To import a virtual disk image to Compute Engine using the Google Cloud CLI, use the following request.
gcloud compute migration image-imports create IMAGE_NAME \ --source-file=SOURCE_FILE \ --location=REGION_ID \ --target-project=projects/HOST_PROJECT_ID/locations/global/targetProjects/TARGET_PROJECT
Replace the following:
IMAGE_NAME
: the name of the image that you want to create. For more information on the naming rules, see Naming convention.SOURCE_FILE
: the file from which you want to import the image. Enter the path in the format gs://bucket/folder/file
. To get the path of an object inside a bucket, see View object metadata. Note that you can only import images from .vmdk
and .tar.gz
files.REGION_ID
: the region in which you want the image import process to run. The image is created in the closest multi-region. If you want the image to be created in a region, make sure that singleRegionStorage
is set to true. For a list of supported regions, see Regions and Zones.HOST_PROJECT_ID
: the name of the host project from which you want to migrate the virtual disk image.TARGET_PROJECT
: the target project in which you want to create the image. If you've not already added a target project, do so using the instructions given in Add a target project.For more information, see gcloud compute migration image-imports
.
To import a virtual disk image to Compute Engine using the REST API, use the following steps.
Create an image import resource using the following request.
POST https://vmmigration.googleapis.com/v1/projects/HOST_PROJECT_ID/locations/REGION_ID/imageImports?imageImportId=IMPORT_NAME { "cloudStorageUri": "SOURCE_FILE", "diskImageTargetDefaults": { "imageName": "IMAGE_NAME", "targetProject": "projects/HOST_PROJECT_ID/locations/global/targetProjects/TARGET_PROJECT", ... } }
Replace the following:
HOST_PROJECT_ID
: the name of the host project from which you want to migrate the virtual disk image.REGION_ID
: the region in which you want the image import process to run. The image is created in the closest multi-region. If you want the image to be created in a region, make sure that singleRegionStorage
is set to true. For a list of supported regions, see Regions and Zones.SOURCE_FILE
: the file from which you want to import the image. Enter the path in the format gs://bucket/folder/file. To get the path of an object inside a bucket, see View object metadata. Note that you can only import images from .vmdk
and .tar.gz
files.IMAGE_NAME
: the name of the image that you want to create. For more information on the naming rules, see Naming convention.TARGET_PROJECT
: the target project in which you want to create the image. If you've not already added a target project, do so using the instructions given in Add a target project.In this example, IMPORT_NAME
is an ID that represents the image import resource. When you import an image to Compute Engine, Migrate to Virtual Machines creates an first creates an image import resource. The image import resource represents the image import process. You can use the IMPORT_NAME
to get the link to the image that was imported as part of the image import process.
See the following table for the full list of image import create request fields supported fields.
Field name DescriptioncloudStorageUri
string .vmdk
and .tar.gz
files. diskImageTargetDefaults.targetProject
string TargetProject
. The target project in which you want to create the image. For more information, see target project API reference. For example, projects/HOST_PROJECT_ID/locations/global/targetProjects/TARGET_PROJECT
HOST_PROJECT_ID
: the name of the host project from which you want to migrate the virtual disk image.TARGET_PROJECT
: the target project in which you want to create the image.diskImageTargetDefaults.imageName
string diskImageTargetDefaults.description
string diskImageTargetDefaults.familyName
string diskImageTargetDefaults.labels
map (key: string, value: string) diskImageTargetDefaults.additionalLicenses
string[] https://www.googleapis.com/compute/beta/projects/windows-sql-cloud/global/licenses/sql-server-2012-enterprise
diskImageTargetDefaults.singleRegionStorage
boolean storageLocations
to be a region. If you set this flag to false, the closest multi-region is selected. diskImageTargetDefaults.dataDiskImageImport
boolean diskImageTargetDefaults.osAdaptationParameters.licenseType
string diskImageTargetDefaults.osAdaptationParameters.generalize
boolean diskImageTargetDefaults.encryption
string encryption
string You should see a response similar to the following sample response.
{
"name": "projects/HOST_PROJECT_ID/locations/REGION_ID/operations/OPERATION_ID",
"metadata": {
"createTime": "2023-10-31T09:12:26.94928636Z",
"target": "projects/HOST_PROJECT_ID/locations/us-central1/imageImports/IMPORT_NAME",
"verb": "create",
"apiVersion": "v1",
"@type": "type.googleapis.com/google.cloud.vmmigration.v1.OperationMetadata"
}
}
Check if the image import job is complete by polling the operation using the following command.
GET https://vmmigration.googleapis.com/v1/projects/HOST_PROJECT_ID/locations/REGION_ID/operations/OPERATION_ID
Replace the following:
HOST_PROJECT_ID
: the name of the host project from which you are migrating the virtual disk image.REGION_ID
: the region in which you want the image import process to run. The image is created in the closest multi-region. If you want the image to be created in a region, make sure that singleRegionStorage
is set to true. For a list of supported regions, see Regions and Zones.OPERATION_ID
: the operation ID of the migrate job.You should see an operation completion response similar to the following sample response.
{
"done": true,
"name": "projects/HOST_PROJECT_ID/locations/REGION_ID/operations/OPERATION_ID",
"response": {
"@type": "type.googleapis.com/google.cloud.vmmigration.v1.ImageImport",
"name": "projects/<HOST_PROJECT_ID>/locations/us-central1/imageImports/IMPORT_NAME",
"cloudStorageUri": "SOURCE_FILE",
"createTime": "2023-10-31T09:04:04.413664947Z",
"diskImageTargetDefaults": {
"imageName": "IMAGE_NAME",
"targetProject": "projects/HOST_PROJECT_ID/locations/global/targetProjects/TARGET_PROJECT"
},
"recentImageImportJobs": [
{
"name": "projects/HOST_PROJECT_ID/locations/us-central1/imageImports/IMPORT_NAME/imageImportJobs/image-import-job",
"diskImageTargetDetails": {
"imageName": "IMAGE_NAME",
"targetProject": "projects/HOST_PROJECT_ID/locations/global/targetProjects/TARGET_PROJECT"
},
"state": "PENDING"
}
]
},
"metadata": {
"createTime": "2023-10-31T09:04:04.416740716Z",
"endTime": "2023-10-31T09:05:36.79987142Z",
"target": "projects/HOST_PROJECT_ID/locations/us-central1/imageImports/IMPORT_NAME",
"verb": "create",
"apiVersion": "v1",
"@type": "type.googleapis.com/google.cloud.vmmigration.v1.OperationMetadata"
}
}
Monitor the image import job for completion using the following command.
GET https://vmmigration.googleapis.com/v1/projects/HOST_PROJECT_ID/locations/REGION_ID/imageImports/IMPORT_NAME/imageImportJobs/image-import-job
Replace the following:
HOST_PROJECT_ID
: the name of the host project from which you are migrating the virtual disk image.REGION_ID
: the region in which you want the image import process to run. The image is created in the closest multi-region. If you want the image to be created in a region, make sure that singleRegionStorage
is set to true. For a list of supported regions, see Regions and Zones.IMPORT_NAME
: the ID that represents the image import resource. When you import an image to Compute Engine, Migrate to Virtual Machines creates an first creates an image import resource. The image import resource represents the image import process. You can use the IMPORT_NAME
to get the link to the image that was imported as part of the image import process.You should see a job completion response similar to the following sample response.
{
"createTime":"2023-10-31T09:12:27.053788394Z",
"createdResources":[
"https://www.googleapis.com/compute/v1/projects/USER_PROJECT/global/images/IMAGE_NAME"
],
"diskImageTargetDetails": {
"imageName":"IMAGE_NAME",
"targetProject":"projects/HOST_PROJECT_ID/locations/global/targetProjects/TARGET_PROJECT"
},
"endTime":"2023-10-31T09:16:50.224865783Z",
"name":"projects/HOST_PROJECT_ID/locations/us-central1/imageImports/IMPORT_NAME/imageImportJobs/image-import-job",
"state":"SUCCEEDED"
}
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-07 UTC.
[[["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-08-07 UTC."],[[["Migrate to Virtual Machines allows importing on-premises virtual disks (golden disks/images) into Compute Engine to create virtual machines, supporting various formats like VMDK, VHD, QCOW, and raw files."],["Before importing, enable the VM Migration API, ensure the operating system is supported, and confirm the virtual disk format is compatible."],["The import process involves preparing the virtual disk file, uploading it to Cloud Storage, granting necessary permissions, and selecting a target project."],["You can initiate the import process through the Google Cloud console, Google Cloud CLI, or REST API, defining parameters such as the image name, source file, region, target project, and optional configurations like OS adaptation and license types."],["The import procedure creates an image import resource to track progress, and once the import is complete, you can monitor the status, and will have access to the link of the imported image."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4