problem
Restore from NAS backup is not failing for VM with template / disks < 1 GB, fails with "Root disk size should be a positive number." error.
It seems regression from create VM from backup feature (#10140)
The size computation below, returns 0 for disks < 1 GB.
|
Long size = volume.getSize() / (1024 * 1024 * 1024); |
|
rootDiskOffering = new VmDiskInfo(diskOffering, size, volume.getMinIops(), volume.getMaxIops()); |
|
Long size = volume.getSize() / (1024 * 1024 * 1024); |
|
vmDiskInfoList.add(new VmDiskInfo(diskOffering, size, volume.getMinIops(), volume.getMaxIops(), volume.getDeviceId())); |
versions
ACS 4.21.0, KVM Hypervisor, NAS repo configured
The steps to reproduce the bug
- Register a template (< 1 GB) - http://dl.openvm.eu/cloudstack/macchinina/x86_64/macchinina-kvm.qcow2.bz2
- Deploy a VM using the above template
- Assign backup offering and take backup
- Go to the backup ,and restore from it.
What to do about it?
Support Restore from NAS backup for VM with template / disks < 1 GB, document it if unsupported.