If you are working on Google Cloud, you might need to create copies of your virtual machines (VM) or instances for various reasons, such as testing, backup, or creating a similar configuration.
This article will discuss the step-by-step process of copying an instance on Google Compute Engine and the options available to achieve this task.

Contents
Understanding Google Compute Engine
Google Compute Engine (GCE) is a part of Google Cloud Platform (GCP) that allows users to create and run virtual machines on Google’s infrastructure.
GCE offers various features such as custom machine types, persistent disks, and global load balancing, allowing users to customize their virtual machines according to their specific needs.
To create a copy of an instance on GCE, you need to create a machine image of the source VM and then create a new instance from that image.
Different options exist to create a machine image, depending on your requirements and the resources you have available.
Creating a Machine Image
The first step in copying a GCE instance is to create a machine image. A machine image is a pre-configured template of a virtual machine that includes all the necessary software, configurations, and files.
Creating a machine image allows you to replicate the exact configuration of the source VM and use it to create a new instance.
To create a machine image, follow these steps:
- Go to the Google Cloud Console and select the VM instance you want to copy.
- Click on the “Create Similar” button at the top right of the VM instance details page.
- In the “Create Similar Instance” dialog box, select the new instance’s machine type, boot disk, and other parameters.
- Click the “Management, security, disks, networking, sole tenancy” link to open the “Management” page.
- Scroll to the “Cloud API access scopes” section and select “Allow full access to all Cloud APIs.”
- Click on the “Create Similar” button to create a new instance.
Once the new instance is created, you can create a machine image. Follow these steps to create a machine image:
- Go to the Google Cloud Console and select the new instance you just created.
- Click on the “Create Similar” button at the top right of the VM instance details page.
- In the “Create Similar Instance” dialog box, select the new instance’s machine type, boot disk, and other parameters.
- Click the “Management, security, disks, networking, sole tenancy” link to open the “Management” page.
- Scroll to the “Cloud API access scopes” section and select “Allow full access to all Cloud APIs.”
- Check the “Create a new machine image from this instance” box.
- Enter a name and description for the new machine image.
- Click on the “Create Similar” button to create the machine image.
Creating a New Instance
Once you have created a machine image, you can use it to create a new instance. Follow these steps to create a new instance:
- Go to the Google Cloud Console and select “Compute Engine” from the menu on the left.
- Click on the “Images” tab and select the machine image you created.
- Click on the “Create Instance” button at the page’s top.
- In the “Create a new instance” dialog box, select the new instance’s machine type, boot disk, and other parameters.
- Click the “Management, security, disks, networking, sole tenancy” link to open the “Management” page.
- Scroll down to the “Cloud API access scopes” section
- Select “Allow full access to all Cloud APIs.”
- Click on the “Create” button to create the new instance.
Your new instance will be created with the same configuration as the original instance, including the operating system, software, and files. You can now use this instance for testing, backup, or other purposes.
Copying an Instance Using a Snapshot

Another option to create a copy of an instance on GCE is to use a snapshot of the source disk. A snapshot is a read-only copy of a disk that can be used to create new disks or instances.
You can create a snapshot of the source disk and then use it to create a new disk and instance.
To create a snapshot, follow these steps:
- Go to the Google Cloud Console and select the VM instance you want to copy.
- Click on the boot disk of the instance to open the “Boot disk details” page.
- Click on the “Create Snapshot” button at the page’s top.
- Enter a name and description for the snapshot.
- Click on the “Create” button to create the snapshot.
Once the snapshot is created, you can create a new disk and instance. Follow these steps to create a new instance using a snapshot:
- Go to the Google Cloud Console and select “Compute Engine” from the menu on the left.
- Click the “Disks” tab and select the snapshot you created.
- Click on the “Create Instance” button at the page’s top.
- In the “Create a new instance” dialog box, select the new instance’s machine type, boot disk, and other parameters.
- Click the “Management, security, disks, networking, sole tenancy” link to open the “Management” page.
- Scroll to the “Cloud API access scopes” section and select “Allow full access to all Cloud APIs.”
- Click on the “Create” button to create the new instance.
The new instance will be created with the same configuration as the original instance, including the operating system, software, and files.
Conclusion
Creating a copy of a Google Compute Engine instance is an essential task for many users of the Google Cloud Platform.
Different options are available to create a copy of an instance, including creating a machine image or using a snapshot.
Each method has its own advantages and disadvantages, and you should choose the one that best suits your requirements.
In this article, we discussed the step-by-step process of copying a GCE instance using both methods, and we provided different tips and best practices to help you achieve this task.
Following these steps and recommendations, you can create a copy of your instance on GCE for testing, backup, or any other purpose.