Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clone/copy your instance on Compute Engine?

I created a VM Instance with Ubuntu Precise. Then I installed tons of libraries and set up my environment. I will be using another server with slightly different configurations therefore I want to copy or clone my current instance.

I thought the clone button which appears when I edit an instance was going to do the thing I desired but after I cloned my instance and go into the server, I haven't see any library installed or whatever.

Is there any way to completely create a new copy of a server (instance) like I can in Amazon?

like image 680
Emin Bugra Saral Avatar asked Oct 27 '15 13:10

Emin Bugra Saral


2 Answers

  • Create a snapshot of your current instance
  • Create a new instance with this snapshot as a disk
  • There you go.
like image 68
Emin Bugra Saral Avatar answered Sep 29 '22 01:09

Emin Bugra Saral


There is no native way to clone using gcloud. However you can fake it.

Use the UI console for this.

Navigate to the compute you wish to clone, and click clone.

At the bottom of the clone screen, click the 'Equivalent Rest or command line'; command line for the gcloud commands.

Copy that over to your console and execute the gcloud command.

like image 21
Chad K Avatar answered Sep 29 '22 00:09

Chad K