Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Losing snapshots when rebooting

Featured Replies

I know (I think ?) snapshots aren't actually supported in the current UnRaid version however I'm thinking you guys might still be able to help.

 

Basically I was using the virsh snapshot feature using the commandline, on qcow disks:

virsh snapshot-create-as --domain MyVM --name "FirstSnapshot" --description "My first snapshot"

 

And everything seemed to work fine. I could

virsh snapshot-list --domain MyVM

to get the snapshot list, and I could

virsh snapshot-revert

to get back to a point.

 

However, when I reboot the UnRaid server all my snapshots are gone ! Is there a way to keep my snapshots ? Is there a way to get them back ? Where are they supposed to be saved ? What method do you use to take snapshots ? I was thinking I could rdiff-backup to only save a diff of the VMs, but that's just a bit more involved than using virsh snaphots.

 

Thanks !

Full libvirt snapshots are created under /var/lib/libvirt/images, which is in RAM, and lost on reboot.

 

The only snapshots you'll be able to keep between reboots, for now, is qcow2 snapshots taken while they are unmounted. You'll have to manage those with qemu-img:

 

qemu-img snapshot -c "new snapshot" <path to.img>

qemu-img snapshot -l <path to.img>

qemu-img snapshot -a "apply this snapshot" <path to.img>

qemu-img snapshot -d "delete this snapshot" <path to.img>

 

So, create, list, apply, delete, all except for list take a snapshot name after their respective switches. I assume you'll want to do this with an unmounted image, or an image for a VM that's suspended to disk.

Full libvirt snapshots are created under /var/lib/libvirt/images, which is in RAM, and lost on reboot.

 

The only snapshots you'll be able to keep between reboots, for now, is qcow2 snapshots taken while they are unmounted. You'll have to manage those with qemu-img:

 

qemu-img snapshot -c "new snapshot" <path to.img>

qemu-img snapshot -l <path to.img>

qemu-img snapshot -a "apply this snapshot" <path to.img>

qemu-img snapshot -d "delete this snapshot" <path to.img>

 

So, create, list, apply, delete, all except for list take a snapshot name after their respective switches. I assume you'll want to do this with an unmounted image, or an image for a VM that's suspended to disk.

Couldn't you symlink the /var/lib/libvirt/images folder to somewhere on the system (cache or array drive) and then just put the symlink command in the go file so it is done at every boot?
  • Author

Wow !

So I ran this command to list the snapshots for a particular domain:

qemu-img snapshot -l /mnt/user/domains/Creative/vdisk1.img

 

and to my surprise, all the previous snapshots I took using `virsh snapshot-create-as` were listed ! So even if I couldn't list them using `virsh snapshot-list --domain Creative` after the server is rebooted, they were still listed using qemu-img.

 

So as you might have guessed, my next experiment was to try to revert to one of those. So I used:

qemu-img snapshot -a "AdobeInstalled" /mnt/user/domains/Creative/vdisk1.img

and it worked ! Yes, somehow the actual snapshots were still saved within the .img and I could revert back to a past snapshot. But this doesn't stop there, you can even go back and forth to any snapshots (not just back) !

 

I did some testing (not extensive testing mind you), and so far the best method I came up with is this:

[*]Stop the VM

[*]Create a snapshot using the command `virsh snapshot-create-as --domain Creative --name "AdobeInstalled" --description "Installed Adobe Creative Suite"`

[*]List snapshots using `qemu-img snapshot -l /mnt/user/domains/Creative/vdisk1.img`

[*]Go to any snapshot using `qemu-img snapshot -a "AdobeInstalled" /mnt/user/domains/Creative/vdisk1.img`

 

Not sure why this is not integrated in the UnRaid UI yet, as this would bring the value up by 500%.

 

I'll continue experimenting with this, but so far this is perfect as the images are retained between reboots and it adds a lot of flexibility to the system.

 

Thanks !

Note that only works for snapshots taken while the VM is powered off. Live snapshots will require the memory and system state data from the /var/lib/libvirt/images directory. Of course, if you're using passthrough of anything but USB devices, you're already prevented from taking live snapshots.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.