Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Moving Google Compute VM instances between Networks

Does anyone know how to move an existing VM instance between Google Cloud Networks configured on a project? I know you can specify the Network at the point of creating an new VM, but there doesn't appear to be a facility for changing it once instantiated. Any pointers appreciated! -Paul

like image 719
user3446361 Avatar asked May 27 '15 16:05

user3446361


1 Answers

In order to move an existing GCE VM instance to a different network, you will first need to delete the VM instance while keeping all its disks (--keep-disks all flag with gcloud command) [1]. Then create a new VM instance with the existing boot disk [2],[3] and attach other disks to the new VM instance if there is any.

All of the above mentioned steps can be done using the Developers Console as well.

Link 1: gcloud compute instances delete NAME --keep-disks all
Link 2: Using an existing root persistent disk
Link 3: gcloud compute instances create

like image 156
Kamran Avatar answered Oct 02 '22 09:10

Kamran