Geekflare is supported by our audience. We may earn affiliate commissions from buying links on this site.
In Cloud Computing Last updated: September 6, 2022
Share on:
Invicti Web Application Security Scanner – the only solution that delivers automatic verification of vulnerabilities with Proof-Based Scanning™.

Cloning is an art!

Duplicating your VM is an excellent way to fast-track your project without human error. There are some reasons you may want to clone your VM for a quick application setup.

Update: Google has made it a lot easier now to clone the VM.

Create Similar Approach

  • Login to GCP and go to VM instances under Compute Engine.
  • Click on the respective VM to be cloned.
  • On top, you will see a create a similar button.
gcp-clone-vm
  • Adjust the necessary (name, machine type, etc.) according to the requirement
  • Click on create

Much easy!

The following I wrote when the “CREATE SIMILAR” button didn’t exist.

Snapshot Approach

Lately, I set up my tools website on one Google Cloud VM and had to set up another one for high availability, and cloning was a life-saver.

Not only was it faster, but also I didn’t have to go through all the configurations, and installation manually, which has excellent room for missing/human error.

You may want to consider cloning VM if:

  • You want to save time.
  • You should set up a replica for another reason.
  • Have to set up multiple instances for high-availability
  • Want to avoid manual work/human error

If you are in a situation to duplicate the Google Cloud Virtual Machine, then here is how you can do it.

This is two steps process. First, where you create a snapshot, and next, you use that snapshot to create a VM instance.

You can do this while VM is running. This will ensure you don’t have any downtime and have the same replica of the existing VM.

  • Go to VM instances under Computer Engine
  • Click on Snapshots at the left navigation
google-cloud-snapshot
  • Click Create Snapshot
  • Enter the name and select the source disk of the VM, which you want to get it cloned.
google-vm-snapshot

It will take a few seconds (based on the disk size), and you will get a confirmation on completion. You can see the newly created snapshot in the list.

google-vm-snapshot-list

Now, it’s time to create an instance from the snapshot.

  • Go inside the snapshot from the list and click “Create Instance.”
google-snapshot-create-instance
  • Enter the new instance details

Note: Google will not show you the existing VM instance configuration like CPU/Memory, so you got to ensure they are at your needs level.

You may also need to select firewall configuration as if you want to allow HTTP or HTTPS traffic.

google-cloud-creating-vm-snapshot
  • Click create once you have changed the configuration settings.

It will take a few seconds based on the disk size, and once done, and you will see the newly created VM in the list.

google-vm-new-instance

To confirm the VM is cloned with the data, log into newly created VM, and verify.

I found this is the quickest way to ensure VM on Google Cloud Platform is duplicated.

If you are interested in learning GCP, then I would recommend taking this Architecting with Google Cloud course.

  • Chandan Kumar
    Author
    As the founder of Geekflare, I’ve helped millions to excel in the digital realm. Passionate about technology, I’m on a mission to explore the world and amplify growth for professionals and businesses alike.
Thanks to our Sponsors
More great readings on Cloud Computing
Power Your Business
Some of the tools and services to help your business grow.
  • Invicti uses the Proof-Based Scanning™ to automatically verify the identified vulnerabilities and generate actionable results within just hours.
    Try Invicti
  • Web scraping, residential proxy, proxy manager, web unlocker, search engine crawler, and all you need to collect web data.
    Try Brightdata
  • Monday.com is an all-in-one work OS to help you manage projects, tasks, work, sales, CRM, operations, workflows, and more.
    Try Monday
  • Intruder is an online vulnerability scanner that finds cyber security weaknesses in your infrastructure, to avoid costly data breaches.
    Try Intruder