Move Block Volume Resources Between Compartments

You can move Block Volume resources such as block volumes, boot volumes, volume backups, volume groups, and volume group backups from one compartment to another. When you move a Block Volume resource to a new compartment, associated resources are not moved. After you move the resource to the new compartment, inherent policies apply immediately and affect access to the resource through the Console. For more information, see Managing Compartments.

Important

When moving Block Volume resources between compartments you need to ensure that the resource users have sufficient access permissions on the compartment the resource is being moved to.

Required IAM Policy

To use Oracle Cloud Infrastructure, you must be granted security access in a policy  by an administrator. This access is required whether you're using the Console or the REST API with an SDK, CLI, or other tool. If you get a message that you don't have permission or are unauthorized, verify with your administrator what type of access you have and which compartment  to work in.

For administrators: The following policies allow users to move Block Volume resources to a different compartment:

Allow group BlockCompartmentMovers to manage volume-family in tenancy

If you're new to policies, see Getting Started with Policies and Common Policies.

Security Zones

Security Zones ensure that your cloud resources comply with Oracle security principles. If any operation on a resource in a security zone compartment violates a policy for that security zone, then the operation is denied.

The following security zone policies affect your ability to move Block Volume resources from one compartment to another:

  • You can't move a block volume or boot volume from a security zone to a compartment that is not in the security zone.
  • You can't move a block volume or boot volume to a compartment that is in a security zone if the volume violates any security zone policies.

Using the Console

To move a block volume to a new compartment
  1. Open the navigation menu and click Storage. Under Block Storage, click Block Volumes.
  2. In the Scope section, select a compartment.
  3. Find the block volume in the list, click the the Actions menu (Actions Menu), and then click Move Resource.
  4. Choose the destination compartment from the list.
  5. Click Move Resource.
To move a block volume backup to a new compartment
  1. Open the navigation menu and click Storage. Under Block Storage, click Block Volume Backups.
  2. In the Scope section, select a compartment.
  3. Find the block volume backup in the list, click the the Actions menu (Actions Menu), and then click Move Resource.
  4. Choose the destination compartment from the list.
  5. Click Move Resource.
To move a volume group to a new compartment
  1. Open the navigation menu and click Storage. Under Block Storage, click Volume Groups.
  2. In the Scope section, select a compartment.
  3. Find the volume group in the list, click the the Actions menu (Actions Menu), and then click Move Resource.
  4. Choose the destination compartment from the list.
  5. Click Move Resource.
To move a volume group backup to a new compartment
  1. Open the navigation menu and click Storage. Under Block Storage, click Volume Group Backups.
  2. In the Scope section, select a compartment.
  3. Find the volume group backup in the list, click the the Actions menu (Actions Menu), and then click Move Resource.
  4. Choose the destination compartment from the list.
  5. Click Move Resource.
To move a boot volume to a new compartment
  1. Open the navigation menu and click Storage. Under Block Storage, click Block Volumes. In the Block Storage menu on the sidebar, click Boot Volumes.
  2. In the Scope section, select a compartment.
  3. Find the boot volume in the list, click the the Actions menu (Actions Menu), and then click Move Resource.
  4. Choose the destination compartment from the list.
  5. Click Move Resource.
To move a boot volume backup to a new compartment
  1. Open the navigation menu and click Storage. Under Block Storage, click Block Volume Backups.
  2. In the Scope section, select a compartment.
  3. Find the boot volume backup in the list, click the the Actions menu (Actions Menu), and then click Move Resource.
  4. Choose the destination compartment from the list.
  5. Click Move Resource.

Using the CLI

For information about using the CLI, see Command Line Interface (CLI).

To move a block volume to a new compartment

Open a command prompt and run:

oci bv volume change-volume-compartment --volume-id <volume_OCID> --compartment-id <destination_compartment_OCID>
To move a block volume backup to a new compartment

Open a command prompt and run:

oci bv volume-backup change-volume-backup-compartment --volume-backup-id <volume_backup_OCID> --compartment-id <destination_compartment_OCID>
To move a volume group to a new compartment

Open a command prompt and run:

oci bv volume-group change-volume-group-compartment --volume-group-id <volume_group_OCID> --compartment-id <destination_compartment_OCID>
To move a volume group backup to a new compartment

Open a command prompt and run:

oci bv volume-group-backup change-volume-group-backup-compartment --volume-group-backup-id <volume_group_backup_OCID> --compartment-id <destination_compartment_OCID>
To move a boot volume to a new compartment

Open a command prompt and run:

oci bv boot-volume change-boot-volume-compartment --boot-volume-id <boot_volume_OCID> --compartment-id <destination_compartment_OCID>
To move a boot volume backup to a new compartment

Open a command prompt and run:

oci bv boot-volume-backup change-boot-volume-backup-compartment --boot-volume-backup-id <boot_volume_backup_OCID> --compartment-id <destination_compartment_OCID>