Skip to content

Restore from NAS backup is not failing for VM with template / disks < 1 GB #11707

@sureshanaparti

Description

@sureshanaparti

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.

Image

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

  1. Register a template (< 1 GB) - http://dl.openvm.eu/cloudstack/macchinina/x86_64/macchinina-kvm.qcow2.bz2
  2. Deploy a VM using the above template
  3. Assign backup offering and take backup
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    Todo

    Status

    Todo

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions