Cloning a Google Compute Engine Virtual Machine

Once you have created a virtual network and configured a primary and secondary instance, you can then clone the secondary instance, allowing you to run migrations across large numbers of servers.

  1. Logon to the server you would like to clone.
    • Open a Command Prompt or Powershell as an administrator. (Right click on shortcut and click 'Run as Administrator')
    • Type 'GCESysprep' without the single quote and hit enter. Failure to do this will result in the inability for nodes to communicate.
    • This will then close your Remote Desktop Protocol session and shutdown the Virtual Machine.
  2. Setting the auto-delete state of a persistent disk.
    • Navigate to the Virtual Machine Instances page.
    • Click on the Virtual Machine Instance name which was previously prepared using 'GCESysprep'
    • Under 'Boot disk' check if 'When deleting instance' is set to 'Delete disk'. If so click on 'Edit' at the top of the page and change to 'Keep disk'. Save.
  3. Deleting an instance
    • Navigate to the Virtual Machine Instances page.
    • Click on the Virtual Machine Instance name.
    • Click on 'Delete' at the top of the page.  
  4. Go to Images and ‘Create Image’. Select your Disk as the source disk. Select Create.
  5. Go to Instance Templates and ‘Create Instance Template’. Select your desired machine type, select your image as the Boot disk and, in Networking, select your network
     
  6. Go to Instance Groups and ‘Create Instance Group’. Select your instance template and specify the number of Virtual Machines to create.

 

Was this article helpful?
0 out of 0 found this helpful