Rollback VM image on XCP-NG / FreeNAS

I have some VMs on XCP-NG with storage on FreeNAS via iSCSI like Tom discuses in several videos. The virtual disks exist in a single dataset that is periodically snapshotted ( is that a word?) in ZFS.

I need to rollback a single VM to its state in a two day old snapshot. What’s the best way to do this? I’ve considered running separate XEN to connect to the backed up copy of the dataset, make a new VM in it and use Clonezilla to copy the image back to the “real” VM. The reason I think I need a new XEN server is because when I tried hooking up a backed up copy of a dataset to the XEN server with the live version, it complained because some IDs were duplicates.

Any suggestions?

You should be able to restore the snapshot to new location and then attach a new iSCSI LUN to it and present it to XEN server. In the future the more ideal way to deal with VM’s in XEN is to use their snapshot feature.

Thanks, Tom. I cloned the snapshot and created a new iSCSI LUN. When I try to connect to it as an SR, I get this error: “Attaching SR. An SR with that uuid already exists. Check your settings and try again.” I’m starting to remember this was the problem I had when I tried this once before.

I did some digging and came up with this post from way back in 2011: https://discussions.citrix.com/topic/252339-change-uuid-of-sr-onbefore-xe-sr-introduce/ . Sounds like the same problem. Someone posted a rather long shell script that looks to change the offending UUID. Another suggestion was to set up a separate XEN server. I don’t have time to try either solution tonight, but I’ll follow up with whatever I do to solve the issue.

Thanks again for your help!