Emin Bugra Saral
Emin Bugra Saral

Reputation: 3786

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?

Upvotes: 5

Views: 4703

Answers (2)

Chad K
Chad K

Reputation: 21

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.

Upvotes: 2

Emin Bugra Saral
Emin Bugra Saral

Reputation: 3786

  • Create a snapshot of your current instance
  • Create a new instance with this snapshot as a disk
  • There you go.

Upvotes: 11

Related Questions