Manage Volumes
Table of Contents
When storing a large amount of data in a virtual machine instance, it is advisable to use a separate volume and not the root file system containing the operating system. It adds flexibility and often prevents data loss. Volumes can be attached and detached from instances at any time, their creation and deletion are managed separately from instances.
1. In Project > Volumes > Volumes, select Create Volume.
2. Provide name, description, and size in GBs. If not instructed otherwise, leave all other fields unchanged and click on Create Volume.
3. (optional) In Project > Compute > Instances, select Attach Volume from the Actions menu for the given instance.
4. (optional) Select Volume ID from the drop-down list and click Attach Volume.
For details, refer to the official documentation.
It is possible to create volume snapshots or backups. In this guide we will focus on volume backups. When creating a backup it is recommended to turn off the instance if possible to prevent data errors.
1. (optional) In Project > Compute > Instances Turn off the affected instance.
2. In Project > Volumes > Volumes open the Actions menu of selected volume an select Create Backup.
3. Specify Backup Name and optional information and press Create Volume Backup
3. Wait for the Backup to be created, it will be then stored in Project > Volumes > Backups.
1. (optional) In Project > Compute > Instances Turn off the affected instance.
2. In Project > Volumes > Backups open the Actions menu of selected backup an select Restore Backup.
3. Wait for the Backup to be restored.
We can distinghuish two types of volumes, namely
- Attachable volumes: additional volumes that don’t contain the system image and the VM can startup without their presence.
- System volumes: The boot image must be always present.
When working with volumes, we highly recommend to always make a volume backup before any operations with the volume.
1. Turn off the instance in Project > Compute > Instances.
2. Detach the volume from the instance in Project > Volumes > Volumes. On selected volume open the Actions menu and select Manage Attachments
3. Select Detach Volume and confirm.
4. Open the Actions menu again an select Extend Volume.
5. Specify new size of the volume and press Extend Volume.
6. Attach the volume back to the instance via Manage Attachments.
7. Verify correct mounting of the volume in the instance.
Resizing the system volume is not possible. It is however possible to create a backup of the system volume, make necessary changes and deploy new VM with the modified volume.
1. Turn off the instance in Project > Compute > Instances.
2. First create a volume backup.
3. Next restore volume backup, this will create a copy volume that can be attached to new instance.
4. In Project > Volumes > Volumes find created backup volume, its name should begin with restore_backup and in the Actions menu select Extend Volume.
5. Specify new volume size and press Extend Volume.
6. In Actions menu select Launch as Instance and deploy a new instance with this volume, or if you need to make additional changes to the volume, you can attach it to another instance via Manage Attachments.