Change an instance’s type to resize it, or to move it off a type that is no longer offered. Only the size changes. The instance keeps its URN, its addresses and its volumes.
Before you begin
- An instance that you stopped and that reads
STOPPED. AFAILEDinstance still holds capacity on its machine, so you can’t change its type. Start and stop it cleanly first, or terminate it. - Free vCPU quota if the new type is larger. Growing is checked against the same vCPU quota as a launch. Shrinking never is. See Limits.
Change the type
-
Stop the instance if it’s running. See Stop and start an instance.
-
Pick a type whose
availableistrue:Terminal window origin compute list-instance-types -
Change the type:
Terminal window origin compute change-instance-type \--instance-urn <instance-urn> \--instance-type gp1.core.4 -
Verify the change.
instanceTypeon the instance now reads the new type:Terminal window origin compute get-instance --instance-urn <instance-urn> -
Start the instance:
Terminal window origin compute start-instance --instance-urn <instance-urn>
Using the API
mutation { compute { changeInstanceType(input: { instanceUrn: "<instance-urn>" instanceType: "gp1.core.4" }) { accepted message } }}If this fails
PRODUCT_UNAVAILABLE: the type you named is no longer offered. Pick one whoseavailableistrue. See Instance types.- Quota exceeded: the larger type would take the organization or project past its vCPU limit. Choose a smaller type or request a higher limit.
- The instance isn’t stopped: stop it first and wait for
STOPPED.