How to configure thin-provisioned raw disks for storage for KVM slave?
Note: the feature is not completely implemented - migration and AutoFTP Backup with raw disks does not work.
- Connect to a slave server over SSH.
- Create the directory for disks - commands have to be executed as below:
# mkdir /vmdata
# chown solusvm.solusvm /vmdata
# touch /usr/local/solusvm/data/.disk_image_storage
If adding a slave to a master - volume group is required. To workaround that:
- Create a file disk.img which will be used as a disk:
# touch disk.img
- Set virtual size of the disk:
# truncate --size=+1T disk.img
Note: the actual size of the file will be 0, so you can set the size of the disk how you see fit. However the maximum size of a VPS will be limited by the size of the disk (dummy volume group), so it makes sense to set it big.
- Create a device for it:
# losetup -Pf --show disk.img
- Create a physical volume form the device:
# pvcreate /dev/loop0
- Create a volume group:
# vgcreate -s 32M solusvm /dev/loop0
- Set this volume group in SolusVM > Node > Edit Node of the KVM node.