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. Open the navigation menu, click Networking, and then click Virtual cloud networks.
    2. Find the VCN in the list, click the Actions menu, and then click Move Resource.
    3. Choose the destination compartment from the list.
    4. Click 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 remove-vcn-cidr 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 flags and variable options for CLI commands, see the Command Line Reference.

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