Move Virtual Machine ZVOL to a new server (Cobia)

crisman

Explorer
Joined
Feb 8, 2012
Messages
97
Hello, could someone explain me if its possible to move a Virtual Machine ZVOL to a new Scale server?

My current server (192.168.10.80) has this ZVOL:
Path: storage/virtual_machines/Ubuntu_UniFi-yqsu58

New server (192.168.10.120): already created the dataset:
Path: speeder/virtual_machines

I would create the new VM in the new server and would like to attach the moved ZVOL.

How to move the ZVOL inside that path?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
You should probably understand that ZVOLs don't actually live in the dataset structure in the way you might expect them to.

They actually live in /dev/zvol/path/to/your/pool/dataset

and even those are just friendly links... to something like ../../../zd304

The important thing to know is it's still important which pool you want them to live in and the dataset is really just there to help organize that and to have you maintain a level of sanity when looking for things in the GUI.

You can transfer it by starting in the shell on your current server and using this syntax:
zfs send storage/virtual_machines/Ubuntu_UniFi-yqsu58 | ssh root@192.168.10.120 zfs recv speeder/virtual_machines/Ubuntu_UniFi-yqsu58

You could also add in pv if it's big/slow and you want to have an idea of how far it's gone...
zfs send storage/virtual_machines/Ubuntu_UniFi-yqsu58 | pv | ssh root@192.168.10.120 zfs recv speeder/virtual_machines/Ubuntu_UniFi-yqsu58
 

crisman

Explorer
Joined
Feb 8, 2012
Messages
97
You should probably understand that ZVOLs don't actually live in the dataset structure in the way you might expect them to.

They actually live in /dev/zvol/path/to/your/pool/dataset

and even those are just friendly links... to something like ../../../zd304

The important thing to know is it's still important which pool you want them to live in and the dataset is really just there to help organize that and to have you maintain a level of sanity when looking for things in the GUI.

You can transfer it by starting in the shell on your current server and using this syntax:
zfs send storage/virtual_machines/Ubuntu_UniFi-yqsu58 | ssh root@192.168.10.120 zfs recv speeder/virtual_machines/Ubuntu_UniFi-yqsu58

You could also add in pv if it's big/slow and you want to have an idea of how far it's gone...
zfs send storage/virtual_machines/Ubuntu_UniFi-yqsu58 | pv | ssh root@192.168.10.120 zfs recv speeder/virtual_machines/Ubuntu_UniFi-yqsu58

Hi,

I know that the Zvols where the VM's are located are different from other hypervisors that use virtual hard disks.
The main goal is to move the current ubuntu vm that lives in the "storage" pool and dataset "virtual_machines" in the old server to the pool "speeder" and dataset "virtual_machines" into the new server and then recreate the ubuntu vm and attach that zvol to keep all data in the ubuntu vm.

I'll try that command later in the night and then will post the results.

Thanks.
 

crisman

Explorer
Joined
Feb 8, 2012
Messages
97
You should probably understand that ZVOLs don't actually live in the dataset structure in the way you might expect them to.

They actually live in /dev/zvol/path/to/your/pool/dataset

and even those are just friendly links... to something like ../../../zd304

The important thing to know is it's still important which pool you want them to live in and the dataset is really just there to help organize that and to have you maintain a level of sanity when looking for things in the GUI.

You can transfer it by starting in the shell on your current server and using this syntax:
zfs send storage/virtual_machines/Ubuntu_UniFi-yqsu58 | ssh root@192.168.10.120 zfs recv speeder/virtual_machines/Ubuntu_UniFi-yqsu58

You could also add in pv if it's big/slow and you want to have an idea of how far it's gone...
zfs send storage/virtual_machines/Ubuntu_UniFi-yqsu58 | pv | ssh root@192.168.10.120 zfs recv speeder/virtual_machines/Ubuntu_UniFi-yqsu58


Hi,

thanks for your help, the commands worked fine! :wink:
 

AMiGAmann

Contributor
Joined
Jun 4, 2015
Messages
106
You can transfer it by starting in the shell on your current server and using this syntax:
zfs send storage/virtual_machines/Ubuntu_UniFi-yqsu58 | ssh root@192.168.10.120 zfs recv speeder/virtual_machines/Ubuntu_UniFi-yqsu58

How is this done when the destination server is a current SCALE with admin instead of root?

I tried zfs send storage/virtual_machines/Ubuntu_UniFi-yqsu58 | ssh admin@192.168.10.120 zfs recv speeder/virtual_machines/Ubuntu_UniFi-yqsu58

...which ends in
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper sudo: a password is required

when tryingzfs send storage/virtual_machines/Ubuntu_UniFi-yqsu58 | ssh admin@192.168.10.120 -S zfs recv speeder/virtual_machines/Ubuntu_UniFi-yqsu58

...it seems that the zfs send is sent to the standard input and I am unable to type a password.

:(
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
How is this done when the destination server is a current SCALE with admin instead of root?

I tried zfs send storage/virtual_machines/Ubuntu_UniFi-yqsu58 | ssh admin@192.168.10.120 zfs recv speeder/virtual_machines/Ubuntu_UniFi-yqsu58

...which ends in
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper sudo: a password is required

when tryingzfs send storage/virtual_machines/Ubuntu_UniFi-yqsu58 | ssh admin@192.168.10.120 -S zfs recv speeder/virtual_machines/Ubuntu_UniFi-yqsu58

...it seems that the zfs send is sent to the standard input and I am unable to type a password.

:(


try setting up an SSH Connection in System -> SSH Connections on your CORE box

If that doesn't do it for you, then you can probably generate an SSH key pair and paste the public key into the scale Keypairs... assuming there is one.
 
Top