TrueNAS VM - snapshots of VMs vdisks and recognizing changes


MrX

Recommended Posts

I'm running TrueNAS as VM and I want to do snapshots of other VMs - just like in Spaceinvader Video "Ransomeware VS Snapshots with VMS". The problem is that TrueNAS doesn't recognize changes on vdisk- I can create snapshot, then save couple files in VM, turn VM off, Rollback (with "No Safety Check") and the files are still there. I assume it's because vdisks have always the same size, but somehow it worked by Spaceinvader. Is there something I forgot to change in TrueNAS or VM?

 

My pool looks like this:

BACKUP_POOL

      VMs (Dataset)

             Manjaro (Dataset)

 

I do snapshot for BACKUP_POOL/Vms/Manjaro

 

 

Link to comment

I rewatched Spaceinvader video and I noticed, that:
1. His Windows vdisk is in /mnt/remotes/zfs_vms/sandbox_windows_10/vdisk1.qcow2
2. There are 3 snapshots:
- Neo/vm-storage/big_sur
- Neo/vm-storage/sandbox_windows_10
- Neo/vm-storage/
When he uses Rollback, he selected "Neo/vm-storage/" and not "Neo/vm-storage/sandbox_windows_10" which means, that changes in "big_sur VM" were also reversed (if there were any).
I checked this in on my system and it works. Rollback on snapshot BACKUP_POOL/VMs restores my Manjaro.

So it looks like the vdisk has to be under another Dataset to recognize the changes, in my test example it looks like this:
Pool:
BACKUP_POOL/VMs/TEST2/TEST3

 

NFS share in Unraid:
nfs    TRUENAS:/mnt/BACKUP_POOL/VMs/TEST2

 

VM vdisk location:
/mnt/remotes/TRUENAS_TEST2/TEST3/vdisk1.img

 

I did Snapshots and Rollback for:
BACKUP_POOL/VMs/TEST2

 

 

EDIT:

I found better solution. Instead creating additional Dataset, just create a Folder inside existing Dataset and place there the vdisk :)

 

 

Edited by MrX
final solution :P
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.