Moving a VCN Between Compartments

You can move a VCN from one compartment to another.

When you move a VCN, its associated VNICs, private IPs, and ephemeral IPs move with it to the new compartment. This changes the management of the resources with no changes to the routing of the traffic.

The VCN is moved immediately. Resources attached to the VCN are moved asynchronously and don't appear in the new compartment until the move is complete.

    1. On the Virtual Cloud Networks list page, find the VCN that you want to move. If you need help finding the list page or the VCN, see Listing VCNs.
    2. From the Actions menu Actions Menu for the VCN, select Move Resource.
    3. In the Move resource panel, select the destination compartment from the list.
    4. Select Move resource.
    5. If alarms monitor the VCN, update the alarms to reference the new compartment. See Updating an Alarm After Moving a Resource.
  • Use the network vcn change-compartment command and required parameters to move a VCN from one compartment to another.

    oci network vcn change-compartment --compartment-id target-compartment-ocid --vcn-id vcn-ocid  ... [OPTIONS]

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • Run the ChangeVcnCompartment operation to move a VCN from one compartment to another.