Jump to content

So I've got my system finally set up all the way, got my second gpu and usb card in the mail and installed, got the second vm up and running. Last thing I need is to share a drive.

 

Basically I have 2 vms running on kvm on top of an ubuntu server install. I'm using virsh to manage them. Each vm has a dedicated gpu and usb card, a dedicated virtual disk on an ssd for OS, and a dedicated virtual disk on a raid 0 array for personal storage.

 

The first vm also has access to a second virtual image on the raid 0 that's meant to be shared between the 2 vms so that games need only be installed once to save space.

 

Before I try giving access to that disk to the second vm tonight I wanted to ask if anyone's done this and if it's okay or there are any caveats.

Build: Intel S2600gz, 2x E5-2670, EVGA SC 1070, Zotac 1060 6GB mini, 48GB Micron 1333mhz ECC DDR3, 2x Intel DPS-750XB 750 watt PSU

https://pcpartpicker.com/user/elerek/saved/3T7D4D

Link to comment
https://linustechtips.com/topic/703607-sharing-storage-between-2-vms/
Share on other sites

Link to post
Share on other sites

The problem you'll face is that even though most hypervisors support the ability to have a virtual disk mounted on multiple different VMs the file system on the virtual disk needs to be cluster aware and allow simultaneous read/write access which NTFS is not. Only 1 VM will allow the disk to come online.

 

What you should look in to is "Linked Clone" in VMware speak, most hypervisors have similar named function. Basically you have a master virtual disk and then link multiple virtual disks to it which are delta disks and can independently be mounted on different VMs, this is how VDI works and saves TONs of storage space.

 

http://superuser.com/questions/958739/create-linked-clone-or-layered-shared-disks-with-qemu 

Link to post
Share on other sites

9 hours ago, Mikensan said:

if you can run your games off a network share, then why not just share a folder on the ubuntu host (smb/nfs) then map it to your two guests? 

Because instead of an emulated network, each VM has its own physical Ethernet port passed through. Sending all that data over the one gigabit cable is a huge bottleneck. Kind of defeats the purpose of the raid 0 array.

Build: Intel S2600gz, 2x E5-2670, EVGA SC 1070, Zotac 1060 6GB mini, 48GB Micron 1333mhz ECC DDR3, 2x Intel DPS-750XB 750 watt PSU

https://pcpartpicker.com/user/elerek/saved/3T7D4D

Link to post
Share on other sites

12 minutes ago, Elerek said:

Because instead of an emulated network, each VM has its own physical Ethernet port passed through. Sending all that data over the one gigabit cable is a huge bottleneck. Kind of defeats the purpose of the raid 0 array.

Since the VMs are hosted on the same physical computer any networking will happen internally so will operate as fast as the computer can handle it. The actual physical networking only matters when traffic is leaving the host.

 

Edit: Any networking that you have configured that would forcibly require network traffic to exit then re-enter the host isn't really that optimal, i.e. if you have passed through physical NICs to the VMs this isn't actually the best configuration. Even if the VMs were accessing content on another physical computer on the network teaming the host NICs is a better approach and would still give each VM there own 1Gbps connections and allow internal host networking when possible.

Link to post
Share on other sites

48 minutes ago, leadeater said:

Since the VMs are hosted on the same physical computer any networking will happen internally so will operate as fast as the computer can handle it. The actual physical networking only matters when traffic is leaving the host.

 

Edit: Any networking that you have configured that would forcibly require network traffic to exit then re-enter the host isn't really that optimal, i.e. if you have passed through physical NICs to the VMs this isn't actually the best configuration. Even if the VMs were accessing content on another physical computer on the network teaming the host NICs is a better approach and would still give each VM there own 1Gbps connections and allow internal host networking when possible.

My router doesn't support teaming, so the only way to have more than one gigabit connection for all the vms and host to share was to pass nics through so each system has it's own one gig line. This works perfectly in all use cases except local sharing. That's why I'd like to avoid it and share the disk itself. There's no reason to use networking for that when it's all local to the machine anyway.

Build: Intel S2600gz, 2x E5-2670, EVGA SC 1070, Zotac 1060 6GB mini, 48GB Micron 1333mhz ECC DDR3, 2x Intel DPS-750XB 750 watt PSU

https://pcpartpicker.com/user/elerek/saved/3T7D4D

Link to post
Share on other sites

Just now, Elerek said:

My router doesn't support teaming, so the only way to have more than one gigabit connection for all the vms and host to share was to pass nics through so each system has it's own one gig line. This works perfectly in all use cases except local sharing. That's why I'd like to avoid it and share the disk itself. There's no reason to use networking for that when it's all local to the machine anyway.

True I agree a linked clone disk is going to work the best. Other than that Linux operating systems support teaming that doesn't require switch support, 'balance-alb', which actually works very well.

 

Quote

Adaptive load balancing (balance-alb)
includes balance-tlb plus receive load balancing (rlb) for IPV4 traffic, and does not require any special network switch support. The receive load balancing is achieved by ARP negotiation. The bonding driver intercepts the ARP Replies sent by the local system on their way out and overwrites the source hardware address with the unique hardware address of one of the NIC slaves in the single logical bonded interface such that different network-peers use different MAC addresses for their network packet traffic.

https://en.wikipedia.org/wiki/Link_aggregation#Linux_bonding_driver

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×