Working with disks
Written by
Updated at February 17, 2025
Working with a boot disk
When creating a VM from a Container Optimized Image, mind the following:
-
You cannot create a boot disk from a disk snapshot.
-
By default, you create a disk that is the same size as the image. Therefore, a VM from a Container Optimized Image may not have enough free space to deploy a Docker container. To avoid this, specify the required boot disk size using this flag:
--create-boot-disk size=<disk_size_in_GB>
.To find out the minimum boot disk size required to install the image, run one of these commands:
yc compute image get-latest-from-family container-optimized-image --folder-id standard-images
if you are installing a Container Optimized Image.yc compute image get-latest-from-family container-optimized-image-gpu --folder-id standard-images
if you are installing a GPU Container Optimized Image.
You can find the minimum boot disk size in the
min_disk_size
parameter.
Working with secondary disks
You can mount a secondary disk into a container using the x-yc-disks
extension in the Docker Compose specification:
- To mount a disk into a VM from a Container Optimized Image and to search using the
/dev/disk/by-id/virtio-...
tree, you need to use the disk’sdevice-name
. If you do not specify this parameter when connecting the disk to the VM, you may get a mount error. - When using a partitioned secondary disk, provide the
partition: x
parameter in the Docker Compose specification, wherex
is the number of the partition to mount.