Moving a disk to a different folder
When you create a disk, it is placed in the current folder.
In Yandex Cloud, you can move a disk to a different folder within a single cloud.
Learn more about the Yandex Cloud resource hierarchy here.
Limitations
When moving a disk, keep in mind the following limitations:
- Yandex Monitoring does not support metric relocation: existing metrics remain in the source folder, and new ones will be created in the destination folder.
- You can only move disks within a single cloud.
Moving a disk
To change the disk folder:
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID>
command. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
Get a list of all 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 | +----------------------+--------------------+------------------+--------+
-
See the description of the CLI command for moving a disk:
yc compute disk move --help
-
Move the disk to a different 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.