virt-lightning / virt-lightning

Starts your VM on libvirt in a couple of seconds!
185 stars 43 forks source link

Live snapshot is not supported #272

Closed BubaVV closed 11 months ago

BubaVV commented 11 months ago

In release 2.3.0, it is impossible to create snapshot of running VM. It is caused by cidata cdrom created as disk, generating such device XML:

<disk type="file" device="disk">
  <driver name="qemu" type="raw"/>
  <source file="/var/lib/virt-lightning/pool/vl_vm-cidata.qcow2" index="1"/>
  <backingStore/>
  <target dev="vdb" bus="virtio"/>
  <alias name="virtio-disk1"/>
  <address type="pci" domain="0x0000" bus="0x00" slot="0x07" function="0x0"/>
</disk>

Steps to reproduce:

  1. Startup the simplest VM. Here is example of yaml:
    - name: vl_vm
    distro: ubuntu-20.04
    memory: 512
    root_disk_size: 5
  2. Try to create snapshot of running VM: virsh snapshot-create-as --domain vl_vm --name snapshot_1

As a result, we have such error message: error: unsupported configuration: internal snapshot for disk vdb unsupported for storage type raw

Proposed PR #271 to fix an issue