transfer VDI to ZFS FS

Discussions related to using VirtualBox on Linux hosts.
Post Reply
vigilian
Posts: 36
Joined: 11. Dec 2013, 02:13

transfer VDI to ZFS FS

Post by vigilian »

Hi,

with ubuntu 16.04 I've migrated part of my system to ZFS FS.
I would like to use the most of it by using zfs partition for image disk in place of VDI. (removing the virtualization layer for the disk) How should I proceed?
Should I convert it to raw image then move each raw images to each zfs partition and then make a vmdk for the link? Or is it another way to do it?
best regards
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: transfer VDI to ZFS FS

Post by mpack »

Don't. What you are describing is called raw disk mode, which is incredibly risky for non experts to use. See the user manual. Failure to take these warnings seriously can lead to catastrophic total loss of data on your HOST.

By all means locate your VMs on a ZFS volume. See Howto: Move a VM.

Note that raw disks do NOT lead to better performance. Raw disks are still virtual (it is impossible to remove the virtualization layer from a virtual machine!). The only thing that makes it raw is that sectors on the virtual drive have a 1:1 mapping to sectors on the host drive, but without host OS caching it will almost certainly be slower.

Raw disks cannot be shared in any practical way, so you also can't do it with any drive which the host is using.
vigilian
Posts: 36
Joined: 11. Dec 2013, 02:13

Re: transfer VDI to ZFS FS

Post by vigilian »

Since it's files I don't know how loss of data on host could be possible + if it's different sub-pools. But okey maybe I don't see what you refer to.

okay I though that raw disk were precisely designed to avoid any virtualization of the I/O but okey. Then I guess to use the real cache function of vdi files I should add a SSD for caching. I was thinking of doing that because of the proxmox way to put preferably all vm disk in raw mode for better access time.
but thanks for the advice.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: transfer VDI to ZFS FS

Post by mpack »

A typical usage scenario for a raw disk would be when you have a Linux / Windows dual boot system, and you want the Windows system to be available as a VM when running the Linux host, and vice versa. It's about convenience, not performance.

The raw disk is still virtual, the only difference being that when (say) the virtual disk code goes to read virtual sectors, it calls the host sector read function instead of the host file read function. The overhead of the virtual call is the same, so the only difference would come from how quickly a host OS could return a drive or partition sector vs how quickly it can fetch 512 bytes from a file. File I/O is an OS's bread and butter: it is designed to be very efficient when accessing disk files, because an OS that is slow in that department cannot survive in the market. Providing sector level access to user level code does not have the same importance, plus by definition would bypass any file caches.
Post Reply