How to move VMs to new pool

Patrick_3000

Contributor
Joined
Apr 28, 2021
Messages
167
I'm going to be migrating my pool from hard drives to SSD on the same SCALE server.

The one thing that has me confused is how to move the two VMs in the existing pool to the new pool. I can certainly replicate or move the zvols for the VMs to the new pool, but how will SCALE know that the VMs in the new pool are the correct ones to use when navigating to "virtualization" in the web UI? I can, of course, delete the old VMs after moving them to the new pool, but I don't see how that would solve the problem since SCALE still wouldn't know where the new ZVOLs are when navigating to "virtualization."

Another approach I've considered is cloning the VMs, then deleting the old ones. There is a "clone" button for each VM under "virtualization," but the clone feature does not appear to be well-documented.

Does anyone know the best approach for moving VMs to a new pool?
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Does anyone know the best approach for moving VMs to a new pool?
Stop your VM(s)

Move the ZVOL(s)

Go to the Devices in the VM(s) and update the location of the disk(s).

Start the VM(s)
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Move the ZVOL(s)
Which means zfs send <oldpool>/path/to/zvol | zfs receive <newpool>/path/to/zvol. After everything is working to your satisfaction the zvols on the old pool can be destroyed as well as the automatic snapshot ("@--HEAD--", IIRC) that is created by the replication command.
 
Joined
Oct 22, 2019
Messages
3,641
108682.jpg



Imposter. :mad:


I hope you have a good lawyer.

complaint_for_a_civil_case.png
 
Last edited:

Patrick_3000

Contributor
Joined
Apr 28, 2021
Messages
167
108682.jpg



Imposter. :mad:


I hope you have a good lawyer.

View attachment 69661
I've removed the Mint avatar since you don't like the fact that I started using it. It's no big deal to me either way.

Please be aware that I've been using Mint as my main Linux distro since around 2012, when Ubuntu switched to a different desktop that I didn't like and I moved over to Mint. I currently have Mint installed on approximately 10 physical and virtual PCs. Mint, Windows, and Truenas SCALE are the only OS's that I use, and I'm a huge fan of Mint and SCALE in particular.

I thought that me using a Mint avatar would be no big deal and thought it would get some positive exposure for Mint. I hadn't thought that anyone would get us confused given how different our names are. However, I don't feel strongly about it either way and, as noted, have removed the avatar.
 
Last edited:
Joined
Oct 22, 2019
Messages
3,641
I've removed the Mint avatar since you don't like the fact that I started using it. It's no big deal to me either way.
I was just kidding. :tongue: I actually enjoy the relatability!

I thought the "lawsuit court case filing" would have been a dead giveaway of my sarcasm... :wink:

Now I have to sue you to make you bring the avatar back?
 

Patrick_3000

Contributor
Joined
Apr 28, 2021
Messages
167
I was just kidding. :tongue: I actually enjoy the relatability!

I thought the "lawsuit court case filing" would have been a dead giveaway of my sarcasm... :wink:

Now I have to sue you to make you bring the avatar back?
I'm glad you were just kidding! And it's great that we're both fans of Mint and SCALE.
 

Patrick_3000

Contributor
Joined
Apr 28, 2021
Messages
167
Moving the VMs to the SSD pool worked perfectly. I ssh'd into the server and used the zfs send and receive command to copy the ZVOLs as suggested by Patrick M. Hausen. Then, under devices for each VM, I edited "DISK" and pointed each VM to the ZVOL in its new location.

The only thing I would point out, for anyone else doing this, is that the size of the ZVOLs shrunk when copying them to the new pool. It appears that when VMs and virtual disks are created, SCALE reserves the entire virtual disk size when sizing the ZVOL, but when moving the ZVOL, it compresses it so that empty space on the disk in the guest VM results in a smaller ZVOL. This confused me at first until I realized what was going on. There are some other threads about this, like this one: https://www.truenas.com/community/threads/moved-zvol-different-size-afterwards.107761/.
 
Top