Moving a disk to another folder
When a disk is being created, it's placed in the current folder.
In Yandex Cloud, you can move a disk to another folder within one cloud.
You can learn more about the resource hierarchy in Yandex Cloud here.
Limitations
Limitations when moving a disk:
- In Yandex Monitoring, metrics are not movable. The metrics in the previous folder stay there and new metrics will already be created in the new folder.
- You can move VMs only within a single cloud.
Moving a disk
To change a disk's folder:
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
Get a list of all the disks in the default folder:
yc compute disk list
Result:
+----------------------+--------------+-------------+---------------+--------+----------------------+-------------------------+ | ID | NAME | SIZE | ZONE | STATUS | INSTANCE IDS | DESCRIPTION | +----------------------+--------------+-------------+---------------+--------+----------------------+-------------------------+ | a7lqgbt0bb9s******** | first-disk | 20401094656 | ru-central1-a | READY | a7lcvu28njbh******** | | | a7lv5j5hm1p1******** | second-disk | 21474836480 | ru-central1-a | READY | | | +----------------------+--------------+-------------+---------------+--------+----------------------+-------------------------+
-
Get a list of all folders in the default cloud:
yc resource-manager folder list
Result:
+----------------------+--------------------+------------------+--------+ | ID | NAME | LABELS | STATUS | +----------------------+--------------------+------------------+--------+ | b1gd129pp9ha******** | my-folder | | ACTIVE | | b1g66mft1vop******** | default | | ACTIVE | +----------------------+--------------------+------------------+--------+
-
View the description of the CLI disk move command:
yc compute disk move --help
-
Move the disk to another folder with the following parameters:
yc compute disk move \ --id a7lqgbt0bb9s******** \ --destination-folder-id b1gd129pp9ha********
Where:
--id
: Disk ID, e.g.,a7lqgbt0bb9s********
.--destination-folder-id
: Destination folder ID, e.g.,b1gd129pp9ha********
.
For more information about the
yc compute disk move
command, see the CLI reference.
Use the move REST API method for the Disk resource or the DiskService/Move gRPC API call.