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
Change the type
-
Stop the instance if it’s running. See Stop and start an instance.
-
Pick a type whose
availableistrue:terminal origin compute list-instance-types -
Change the type:
terminal 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 origin compute get-instance --instance-urn <instance-urn> -
Start the instance:
terminal 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.