Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rename Google Compute Engine VM Instance

How do I rename a Google Compute Engine VM instance?

I created a new LAMP server and I'd like to rename it in the "VM Instances" dashboard.

I've tried renaming the Custom metadata, but that didn't seem to replicate to the dashboard.

like image 200
mickeylieu Avatar asked Jan 14 '15 10:01

mickeylieu


People also ask

How do I change my VM instance name GCP?

Before renaming the instance, stop it by using the gcloud compute instances stop command. After renaming, start the instance by using the gcloud compute instances start command. Replace the following: INSTANCE_NAME : name of the instance to rename.

Is Google Compute Engine a VM?

Google Compute Engine provides a scalable number of virtual machines (VMs) to serve as large compute clusters for that purpose. GCE can be managed through a RESTful application program interface (API), command line interface or web console.

What is instance in Google Compute Engine?

An instance is a virtual machine (VM) hosted on Google's infrastructure. You can create an instance or create a group of managed instances by using the Google Cloud console, the Google Cloud CLI, or the Compute Engine API.


1 Answers

I tried the solution provided by @Marius I . It works, but I lost my description, my metas, the tags and the permissions I've set on the old instance. I had to copy my metas, had to make sure the zone for the new instance was the same as the original, and had to check that the pricing was the same.

I think, it's best to just create a clone of your original instance, this way don't have to manually copy/set them on the new instance.

  1. As @Marius said, create a snapshot of your disk ( DO NOT skip this part: you may lose all your files/configuration )
  2. Make sure you completed the step 1.
  3. Clone your instance (“Create similar” button)
  4. Name your cloned instance the way you want.
  5. Make sure to select the snapshop of your disk created at #1 ( make sure you select the same typeof disk as well: if your original disk was SSD for example, you have to select if you want the new disk to be SSD too )
  6. Make sure your IPs are set correctly

You're done :)

like image 164
gabriel-kaam Avatar answered Sep 18 '22 16:09

gabriel-kaam