Disks, snapshots, and images
How much disk space can I use for a virtual machine?
For disk space limits, see Quotas and limits in Compute Cloud.
How do I resize a disk?
To increase your disk size within the limits, follow this guide. This will not affect your disk data. Be sure to wait until the operation is complete.
Due to the architectural constraints of Yandex Cloud technologies, disk downsizing is not supported. The same applies to creating a disk from a snapshot: it cannot be smaller than the parent disk.
If resizing the disk does not automatically expand the partition on your Linux boot disk, use these commands:
sudo growpart /dev/vda 2
sudo resize2fs /dev/vda2
Non-bootable disks do not have the partition size increased automatically. You will need to use native OS tools to work with disks and their partitions, such as parted
, fdisk
, cfdisk
, sfdisk
, and growpart
. For more information, see Increasing the size of a Linux disk partition.
To avoid accidentally losing data when resizing, we recommend that you first create a disk snapshot.
How do I upload a custom image?
See Uploading a custom disk image to Yandex Cloud.
To ensure your VM created from a custom image works properly, follow all steps in the guide.
If you have followed all recommended steps but still have issues with the image, or in case you have other questions, create a support request.
What happens to VMs running outdated OS versions?
You can use images with outdated OS versions on your VMs; however, you will not be able to get support for these VMs if you have any issues.
Should I use swap?
Swap is strongly discouraged in cloud environments, as the disk subsystem can become a bottleneck for the entire guest system. Network disk limits are too low to use the disk as a RAM extension.
Instead of swap, you can use zram-config
. It enables you to create a swap-like space within RAM itself, leveraging compression that is significantly faster than disk I/O. Keep in mind that under high I/O and/or vCPU loads, zram-config
may negatively impact iowait
, affecting network, disk, and vCPU performance.
The most effective way to increase available memory is to expand vRAM on your VM.
What should I do if a snapshot is larger than the actual data on the disk?
This happens when deleted files leave behind filled sectors on the disk.
To resolve this, create a zero-filled file to overwrite all unused disk space, flush the cache to the disk, and then delete the file entry.
-
For Windows: Stop disk operations and use
SDelete
. You can learn more about this utility and download it from the relevant Microsoft article . -
For Linux: Stop disk operations and run the following commands one by one:
dd if=/dev/zero | pv > full.disk
sync
rm full.disk
Now, all unused space becomes actually empty and you can create a disk snapshot. The snapshot size will be nearly the same as the currently used disk space.
Can I create multiple snapshots of the same disk at a time?
No, you can only create a single snapshot of a disk at a time. While a disk snapshot is being created (either manually or on a schedule), all other scheduled operations for the disk will be skipped.
How do snapshots count towards quotas?
Snapshots are billed and count towards quotas
How do I move a VM to a different folder or cloud?
-
Assign the following roles in your cloud to a user from a different cloud:
- Role for the cloud:
resource-manager.clouds.member
. - Role for the folder:
viewer
orcompute.images.user
.
For details, see Assigning rolesthis guide.
- Role for the cloud:
-
Create an image from your snapshot under Snapshots or from the disk itself under Disks.
A user in the cloud you want to move your VM to must follow these steps:
-
Run this CLI command:
yc compute image create --source-image-id=<your_image_ID>
-
When creating a VM, specify this image as the boot disk.
How do I attach a new disk to my VM?
After creating a new disk and attaching it to your VM, you need to mount it or assign it a letter, depending on your operating system. See Mounting a disk created from a snapshot or image.
How do I set up automatic backups?
For disk backups in Compute Cloud, you can make disk copies called snapshots. To automatically create snapshots, use schedules.
For more information, see Backups in Compute Cloud.
Why was a disk snapshot created later than scheduled?
Scheduled snapshots may be created with a slight delay depending on the current Compute Cloud load.
Can I add a single disk to multiple schedules to create snapshots?
Yes, you can add a disk to multiple schedules. There are fixed limits on the number of schedules for a disk.
What time zone is used for configuring snapshot schedules?
All times are UTC±00:00
Can I choose a folder for scheduled disk snapshots?
All snapshots will be created in the same folder as the schedule, regardless of whether the schedule includes disks from other folders.
What cron expression format is supported for disk snapshot schedules?
See Cron expressions.
If a schedule is configured to keep only the most recent disk snapshots, are older snapshots deleted before or after new ones are created?
After. A new snapshot is created first, then the oldest one is deleted. For example, if you want to keep only the most recent five snapshots, the first snapshot will only be deleted after the sixth one is created, the second snapshot will be deleted after the seventh one is created, and so on.
What happens to running operations and existing snapshots when I change, disable, or delete a disk snapshot schedule?
All running snapshot creation or deletion operations initiated prior to changing, disabling, or deleting the schedule will be completed. Snapshots that were not deleted according to schedule retention settings will stay unaffected.
What happens to my data when I delete a VM?
When selecting a disk to attach to your VM, you can specify whether to delete that disk when deleting the VM. You can enable this option when creating or updating a VM, or when attaching a new disk to it.
Disks attached to a VM prior to its deletion will automatically be detached. This will not affect disk data, and you will be able to attach this disk to another VM when needed.
If you want to have a disk deleted with the VM is it attached to, enable the relevant option when creating the VM, updating it, or attaching the disk. Such disks will be deleted along with the VM.
Do I have to stop a VM to create disk snapshots? Do I have to wait until disk snapshots are created before I can start a VM?
You do not have to stop your VM. However, keep in mind that a snapshot only contains the data available on the disk at the time of creating the snapshot. You need to take care of data integrity yourself. For more information on how to create a disk snapshot, see Creating a disk snapshot.
Snapshots are created asynchronously. You can resume writing data to your disk immediately after running the create snapshot command, without waiting for it to complete.
Can I download an image of a created VM?
This option is not currently supported. However, you can copy data from your VM using application software, such as rsync
, dd
, or GNU Wget
.
If you would like us to implement an option to manually download or upload VM images and disk snapshots from or to external resources or a local device, consider suggesting this feature or voting for a similar one. We regularly review all suggestions and add them to our development roadmap. We will notify you as soon as the feature you suggested or voted for has been implemented.
How do I detect processes that are putting a heavy load on the disk?
You can detect these processes using iotop
/usr/sbin/iotop -botqqqk --iter=60 | grep -P "\d\d\d\d.\d\d K/s" >> /var/log/iotop.log
How can I find out the terms and conditions of technical support for public images?
The terms and conditions of technical support for public images may differ. For more information, see the product page in Yandex Cloud Marketplace.