dcloud ec2 instances change-network

Move an instance to another VPC or subnet, running or stopped

IAM ec2:ModifyInstanceNetworkChanges stateAsks before it deletes (-y skips)

The instance joins the new network and waits until its new address is up before leaving the old one; when the two ranges overlap, or for another subnet of the same VPC, it leaves first and has no private address for about 16 seconds. When the new interface appears, the operating system renews every address, so public traffic pauses for about 150 ms. Its old private address stops answering.

Synopsis

dcloud ec2 instances change-network id --vpc-id vpcId [flags]

Arguments

  • <id>Required

    string

    Also accepted as --id. Constraints: /^i-[0-9a-f]{6,32}$/

Flags

  • --vpc-idRequired

    string

    The VPC to move the instance to (the same VPC with a subnet moves it there)

    Constraints: uuid

  • --subnet-idOptional

    string

    A subnet of that VPC in the instance’s zone; an address is chosen inside it

    Constraints: uuid

  • --private-ipOptional

    string

    A free address to take; omitted, one is chosen for you

    Constraints: ipv4

Example

dcloud ec2 instances change-network id --vpc-id 00000000-0000-0000-0000-000000000000

Generated from the API description, the same one the API checks requests against and the CLI is built from.