bhyve How to manage snapshots?

Hi,

Trying to figure out how to configure the snapshot process on my bhyve vms. Don’t have a full understanding. Using VM-Bhyve utility to manage the administration but have no idea how to take a snapshot, merge them, promote, clone and what else.

As I understand you do something like zfs snapshot /zroot/bhyve/vm1@1stimage ?

Thanks
 
Also I have a clone of Server 2016 that exists in its own zvol dev path as a sparse image and after using vm clone server2016 to server2019 even though this worked I notice that the clone does not have its own independent sparse image. The conf file in the VM root folder still refers to the original path of server2016 image. So was wonder would 'VM image' command work to make a new independent image? Not sure how to accomplish this?

Thanks
 
Using VM-Bhyve utility to manage the administration but have no idea how to take a snapshot
sysutils/vm-bhyve has a snapshot utility build in: vm snapshot [-f] name|name@snapshot. For details see vm(8).

As for
how to take a snapshot, merge them, promote, clone and what else.
FreeBSD Handbook, chapter 21.4.5. Managing Snapshots


 
Thank you for the informative leads. Unfortunately my attempt to backup my VM's ended up in disaster with complete corruption of two sparse volumes.
This is what happened. I created a clone of 'Server 2016' VM and updated that to Server 2019 using the VM-Bhyve VM Clone command. This resulted in
both VMs having different UUIDs though originally I had a third VM (my original 2016 one) that existing as disk.img file in a Zroot ZFS pool. The other
two that had corrupted existing in /dev/zvol/zroot/bhyve/server2016.

In anycase what happened was I created another sparse volume for testing purposes existing in the dev zvol folder and tried to delete it with 'ZFS destroy -r '/dev/zvol/zroot/testvm'.
This resulted in the entire DEV folder disappearing for a minute causing me to panic and so I loaded up each of my Zvol Server 2016+19 Vms at once.
Nest thing I know both installations got corrupted and no matter how much I tried rolling back to a prior snapshot nothing helped.

So I had to start over using my /zroot/bhyve/server16/disk0.img that I had in working order (saving the UUIDs as I had activated Windows Licenses I didn't want
to loose) and create new sparse volumes in /dev/zvol and use DD to copy the disk image over and create new VMs but things still were not trouble free.
The first one booted into a Blue Screen Troubleshooting page and the second one booted up fine but the Windows Start button was non-functional!

So at this point sticking with using traditional disk images and not use thin sparse volumes until I can figure this out. Not sure if using the same UUIDs accross
a few installs messes up Bhyve or not.

Need help

Thanks
 
Hi,

Trying to figure out how to configure the snapshot process on my bhyve vms. Don’t have a full understanding. Using VM-Bhyve utility to manage the administration but have no idea how to take a snapshot, merge them, promote, clone and what else.

As I understand you do something like zfs snapshot /zroot/bhyve/vm1@1stimage ?

Thanks
You can use the vm snapshot command.
I prefer to do it myself

1. doas zfs snapshot maxpool/vms/ubuntu01@backup
2. doas zfs send maxpool/vms/ubuntu01@backup|doas zfs recv -F maxpool/vms/ubuntu02
3. rename ubuntu01.conf to ubuntu02.conf in the cloned/backup vm folder (change mac-addr)
4. doas vm list
 
Back
Top