I'm working with Google Compute Engine and to test it I created a small instance type which isn't very powerful. Now I want to change it to a more powerful CPU but can't seem to figure out how to do that.
Is it possible to change the instance type of a running VM?
Natively, once you have built Google Compute Engine (GCE) VMs, you are unable to easily move those VM resources into another project. There are a few how-to guides for leveraging disk snapshots, cloning, etc, but alot of those are difficult to operate at scale and open a plethora of potential issues in practice.
To perform this task, you must have the following permissions: In the Google Cloud Console, go to the VM instances page. In the Name column, click the name of the instance for which you want to change machine type. Click the Stop button to stop the instance, if you have not stopped it yet. Select the VM instance to edit.
To perform this task, you must have the following permissions: In the Google Cloud Console, go to the VM instances page. In the Name column, click the name of the VM for which you want to change machine type.
1 (Optional) If the new instance type requires drivers that are not installed on the existing instance, you must connect to your instance and install the drivers first. ... 2 Open the Amazon EC2 console. 3 In the navigation pane, choose Instances . 4 Select the instance and choose Actions, Instance state, Stop instance . More items...
You can't change the instance type of a running instance, so you'll have to shut it down and start a new one.
If you used a persistent root disk, you can reuse that disk on your replacement instance. If you used a scratch disk though, you'll have to make sure you back up your changes first.
In December 2013, Compute Engine was promoted to v1 (General Availability). Some notes to hopefully save folks time:
Before you delete the old instance, save off its settings for easy reference when creating the new one:
gcutil getinstance instance-name
The disk name to use later for addinstance
is the last part of the disk.source
setting.
If the disk.autoDelete
setting is True
, set it to False
to preserve the disk:
gcutil setinstancediskautodelete instance-name --auto_delete=False
Safely delete the old instance:
gcutil deleteinstance instance-name
To create a new instance using the old instance's persistent disk as the boot disk, you need to specify the boot
flag, e.g. using gcutil
:
gcutil addinstance --disk=instance-disk-name,mode=rw,boot [...]
Otherwise it complains that the disk already exists and fails the instance creation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With