Move virtual machine disk to new pool

Status
Not open for further replies.

majerus

Contributor
Joined
Dec 21, 2012
Messages
126
My situation currently, I have a virtual machine that is on an SSD 3 Stripe pool which I thought was replicating to my Raidz2 pool. Well come to find out its not. Now my Stripe is failing and I want to move the virtual machine before its to late.

1) I tried to setup replication, however that is failing because of the corruption.
2) Was going to try DD however when I navigate to the location in the file system I do not see anything; is this because its a zvol?
3) My next idea is to try and setup lvm mirroring within ubuntu which the virtualmachine is running.

Is there a way to have bhyve storage vmotion the virtual machine disk to my other pool? Or is there some other zfs magic that I can do to help fix my current situation?



Code:
Vault# zpool status -v SSD
  pool: SSD
 state: DEGRADED
status: One or more devices has experienced an error resulting in data
		corruption.  Applications may be affected.
action: Restore the file in question if possible.  Otherwise restore the
		entire pool from backup.
   see: http://illumos.org/msg/ZFS-8000-8A
  scan: scrub repaired 72K in 0 days 00:06:17 with 10 errors on Thu Jun 28 20:17:55 2018
config:

		NAME										  STATE	 READ WRITE CKSUM
		SSD									 DEGRADED	 0	 0   156
		  gptid/f2cdb69a-6e2c-11e7-93c9-00074307e7be  DEGRADED	 0	 0   328  too many errors
		  gptid/6c8e4f8e-d6cb-11e7-a96e-00074307e7be  ONLINE	   0	 0	 0
		  gptid/12405d79-d6ce-11e7-a96e-00074307e7be  ONLINE	   0	 0	 0

errors: Permanent errors have been detected in the following files:

		SSD/VM1/BaseSSD:<0x1>
	   SSD/VM1/BaseSSD@auto-20180628.2129-2w:<0x1>



Code:
Vault# whoami
root
Vault# pwd
/mnt/SSD/VM1
Vault# ls
BaseSSD
Vault# ls -la
total 10
drwxr-xr-x   3 root	wheel		  3 Jan 10 08:34 .
drwxrwxr-x+ 17 nobody  WindowsGroup  18 Mar 13 12:07 ..
drwxr-xr-x   2 root	wheel		  2 Jan 10 08:34 BaseSSD
Vault#




Thanks!
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
bhyve is not yet a mature virtualization product and FreeNAS has an extremely limited implementation of it. There is no "vmotion" only zfs send/recv. As for your zvol you are correct, you will not see files. Think of a zvol like a hard drive. Its just a chunk of block storage that needs a file system to be used by the VM. In theory you could DD if=/dev/zvol/whatever of=/whereever/VM-ZVOL.img to backup the image or if the VM is bootable, just do a disk level backup from inside the VM.

Sorry but I have to say this... Did you learn your lesson about having backups and running important things on a stripe with no redundancy? ALWAYS verify your backups on a regular basis even going so far as doing test restores and booting them to verify your applications are consistent. (ZFS Snapshots/replication are NOT a safe way to backup running bhyve VMs; they MUST be shutdown for every snapshot to ensure a clean and consistent backup.)
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
My next idea is to try and setup lvm mirroring within ubuntu which the virtualmachine is running.
Seems over engineered but could work.
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457

majerus

Contributor
Joined
Dec 21, 2012
Messages
126
bhyve is not yet a mature virtualization product and FreeNAS has an extremely limited implementation of it. There is no "vmotion" only zfs send/recv. As for your zvol you are correct, you will not see files. Think of a zvol like a hard drive. Its just a chunk of block storage that needs a file system to be used by the VM. In theory you could DD if=/dev/zvol/whatever of=/whereever/VM-ZVOL.img to backup the image or if the VM is bootable, just do a disk level backup from inside the VM.

Sorry but I have to say this... Did you learn your lesson about having backups and running important things on a stripe with no redundancy? ALWAYS verify your backups on a regular basis even going so far as doing test restores and booting them to verify your applications are consistent. (ZFS Snapshots/replication are NOT a safe way to backup running bhyve VMs; they MUST be shutdown for every snapshot to ensure a clean and consistent backup.)


So, the virtual machine that is running hosts something that is not super important as its just a Ubuntu Server running Unifi Video, and Unifi Controller which their data is actually on the RaidZ2. (this was really me just screwing around with bhyve) Everything else runs on a ESXi cluster with a datastore pointed to the stripe. However backups for that are taken with Veeam, and actually work. Thanks for the help ill try to do the DD thing and see what happens.
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
So, the virtual machine that is running hosts something that is not super important as its just a Ubuntu Server running Unifi Video, and Unifi Controller which their data is actually on the RaidZ2. (this was really me just screwing around with bhyve) Everything else runs on a ESXi cluster with a datastore pointed to the stripe. However backups for that are taken with Veeam, and actually work. Thanks for the help ill try to do the DD thing and see what happens.
you may be able to use qemu tools to convert the raw (DD) disk image to a VMDK. From there build a new VM shell and copy the old MAC address over. You may be able to boot it up in ESXi and carry on with life as normal.
backups for that are taken with Veeam, and actually work.
I love Veeam! its as simple or complex as you need and fully integrates with your storage and vCenter. Stick with it! Yeah bhyve has a long ways to go to catch up with KVM let alone ESXi. Perhaps some day...
 

majerus

Contributor
Joined
Dec 21, 2012
Messages
126
Well DD command isnt working as I think it should, I only copy 2 bytes and it is done. Does this command look right, if i want to copy to the same pool?
Code:
 dd if=/mnt/SSD/VM1/BaseSSD of=/mnt/SSD/Test/vm.img
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
Well DD command isnt working as I think it should, I only copy 2 bytes and it is done. Does this command look right, if i want to copy to the same pool?
Code:
 dd if=/mnt/SSD/VM1/BaseSSD of=/mnt/SSD/Test/vm.img
No, if your using a zvol the if= path should be /dev/zvol/POOLNAME/ZVOLNAME
 

majerus

Contributor
Joined
Dec 21, 2012
Messages
126
Ah..
 
Status
Not open for further replies.
Top