0

I have a QEMU image (qcow2) with a snapshot stored in it. Right now I'm using libvirt to start it.

However, I want to be able to run more than one instance of the same image snapshot.

I guess I can do that by cloning the virtual-hd and installing/creating a new domain (virsh) and then running revert from snapshot. But I want to be able to do that pretty much "on-the-fly" with as little as possible latency from the time I decide I need to run another instance of image X to the time that instance is running from the stored snapshot. (I wan't to avoid writing to the hard-drive as possible)

Anyone did anything like that? I started thinking maybe libvirt is not low-level enough for this?

masegaloeh
  • 18,236
  • 10
  • 57
  • 106
Ofir Israel
  • 101
  • 1
  • 1

1 Answers1

0

Libvirt supports this very well. Create one disk image that has everything you want to share between your domains. This will be your read-only backing file. When creating volumes for new domains, set backingStore to refer to it. The new volume you're creating for each domain will start out taking zero bytes but grow as you make changes.

sciurus
  • 12,678
  • 2
  • 31
  • 49
  • Thanks, but I also wanted the VM to start exactly in the same spot - as if I ran `virsh snapshot-revert`. With backing store it just creates a "snapshot" of the disk image.. – Ofir Israel Jun 04 '14 at 07:16
  • Your backing file should be in the state you want it to be before you start any VMs based on it. In your case, it sounds like you need to revert the snapshot it already has. – sciurus Jun 04 '14 at 13:09