Moving a virtual machine to a new disk

adam23450

Contributor
Joined
Feb 19, 2020
Messages
142
I bought a new disk for my NAS and wanted to attach my virtual machines without data protection to it. How can I do this?
 

adam23450

Contributor
Joined
Feb 19, 2020
Messages
142
*without losing data
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
Assuming you have used ZVOLs for your VM HD files, here's the theory...

Create a pool on the new disk
Create the dataset structure you want to house the VM disks
Stop the VMs
Use zfs send | zfs recv (plenty of examples around the forum for that) to copy the zvols to the new location
Update the HDD devices in the VM config to the new locations
Start the VMs
(optional) destroy the original zvols with zfs destroy once you're happy that it works.
 
Top