VM data sharing (no network)

Primož

Dabbler
Joined
Feb 5, 2015
Messages
29
Coming from FreeNAS and TrueNAS Core with the familiarity of Jails and VMs, TrueNAS Scale does VMs a bit different. There is a use case, where I could possibly consolidate two machines into one with TrueNAS Scale due to the fact Scale uses a Type-1 Hypervisor (as opposed to Type-2 in CORE). It would be a computer (VM), that is not connected to the internet, but runs on bare metal (due to performance benefits).

My question here would be, how to add storage and/or how to get files to said VM? One option for both options is to either send through a SATA controller with some hard drives attached and have a PCIe USB card and send that over and get files to the VM using USB sticks. Simple, functional, but cumbersome.

Here are my questions then.
First: Is it possible, to add a folder as a storage to a Type-1 hypervisor in some way, shape or form in TrueNAS Scale (I think it might be possible with some other Type-1 hypervisors, depending on the underlying platform and software packages to manage the VMs)? Similarly to how it's possible with jails. Ideally I would have a network shared folder, where I would be throwing files in on my main PC and it would show up in the VM, but not via a network share! (remember, no internet connectivity)

Second: is it possible to add hard drive storage to the VM via a virtual disk? I would like to be doing regular backups inside the VM and I have a pair of hard drives for that purpose in the current physical machine. If I were to run a joint Scale box, it would make sense to be able to backup said items onto my ZFS array essentially on a block level, which would be possible when using virtual hard drive files (again, no internet connectivity). Passing through the SATA controller would mean Scale would have no idea about the files inside the VM and no link. Having a virtual disk ont he ZFS array is sort of a happy medium (performance of this drive is not of essence).

I haven't played around with Scale, so these questions might be obvious (maybe the second is a simple yes), I'm merely getting a feel of the land before I commit too much with this idea.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
TrueNAS Scale due to the fact Scale uses a Type-1 Hypervisor (as opposed to Type-2 in CORE)

No one has a true type-1 hypervisor. All contemporary hypervisors provide complex interception, emulation, and filesystem layers that make a lie out of the conventional type classifications. Scale and Core both use a hypervisor implemented as a kernel module. Classic so-called "type-1" hypervisors such as ESXi differ mainly in that they are optimized to run virtualization workloads. ESXi evolved from ESX, which is virtually indistinguishable from a Linux system running as a KVM host or whatever, but ALL of them can run arbitrary non-virtualization workloads if you try.

Some people try to define "type-1" by saying "it has no desktop built in" or using other yardsticks. This is a rough road.

It's easier to look at a "type-2" hypervisor as being one where the process is held within a conventional userland process, such as VirtualBox (the poster child for this), or QEMU, and run all the interactions through kernel syscalls just like any other complex userland process.

You move on to stuff like VMware Workstation/Fusion or QEMU-with-KVM which started life as full type-2 hypervisors, but gained access to at least some bare metal resources directly over time. Perhaps these are "type-1.9". But this will fail for the people who want to define type-2 as "add-on" products to an existing OS.

Scale and Core both have hypervisor capabilities built in to the base OS, so that would qualify them as "type-1" using that yardstick, yet that still seems crappy because the primary goal of these OS's is not just virtualization. It's hard to define a clear distinction between Proxmox and Scale for purposes of "type-X" discussions, yet they are targeted at different use cases.

See the problem? :smile:

Type-1 hypervisor in some way, shape or form in TrueNAS Scale (I think it might be possible with some other Type-1 hypervisors

So you're looking for something like VMware's HGFS? That's not available on a type-1 for what might be obvious reasons relating to the discussion above. Also, no, I'm not aware of anything like that for TrueNAS.

where I would be throwing files in on my main PC and it would show up in the VM, but not via a network share! (remember, no internet connectivity)

So, bluntly, I think this is a dumb requirement. Create a private network that lets your VM see the NAS, and just the NAS. This is easy. If your home network is 192.168.1.0/24, then just create 172.16.1.0/24, assign the NAS to 172.16.1.1/24, assign your VM 172.16.1.2/24, and run SMB or NFS or whatever is convenient. You get to tap the full potential of the NAS and its storage, but there's no Internet connectivity. It's lovely.
 
Top