r/homelab•
interfect

SATA III PCIe card for Booting Win7 under Xen

Help

I'm getting relatively disappointing IO performance under Win7 under Xen to my SATA III SSD, connected directly to my main SATA controller. I think I'm having trouble because the Dom0 is needing to get involved in every IO operation.

I suspect I might get better performance if I had a SATA controller I could run over PCI passthrough. Then I could connect the SATA drive to that and have the guest talk directly to the card through the IOMMU.

But I need a controller card that Windows will be able to boot off of (at least after I install applicable Windows drivers). Am I likely to be able to make that work with the PCIe 2.0 x2 SATA III cards I can find for about $20-$40 like this one? If not, are there cards people can recommend? Has anyone done this before? Is my logic just nonsense and this won't help at all?

Posted Oct 23, 2017, 12:33 AM UTC

57
DJChasma•

I've used Xen for a long time and I've never figured out PCI passthrough. Would be interested in seeing if you get this working.

1
interfectOP•

It's not well-documented, but it's also not that hard. I got it working for a GPU and for the sound device, and I can even toggle the sound device back and forth, giving it to the guest when I am running the guest and the host at other times.

The biggest problem I ran into was I got nonsense errors from Xen unless I left a chunk of RAM not allocated to any VM. That is a mystery wrapped in a riddle that I am not remotely qualified to solve.

The Xen error codes are useless; they all consist of stuff like "Failed to do the thing: -3".

I also had no luck pass-through-ing the first GPU and running the host on the second; I had to put the host GPU in the first slot (with all 16 lanes) and pass the guest's GPU through from another, sadly only 8 lane slot. Besides that I just had to put the PCI IDs I wanted to send over in the list for passing through to the VM in its Xen config, and in the GRUB config somewhere to tell the host not to use them.

I also made sure to buy an AMD GPU for this; nVidia writes their drivers to specifically interfere with you doing GPU passthrough.

2
quespul•

I don't know which motherboard you have but I know you'd be better off with a real HBA like the Dell H200 than the one you point it out, if you're using an intel motherboard imo the onboard controller is way better than that generic Marvell cheap card.
What SSD are you using though?

1
interfectOP•

I have a ~1TB Toshiba SSD, running on an Asus X370 AMD board. I definitely got better IO performance when I was running the drive on my last system on bare metal ~2011-vinatge consumer hardware, versus now when I have P2V'd it on top of Xen on 2017 Ryzen.

Is the H200 only a RAID controller, or will it also expose disks as just normal disks? And can Windows boot off of it?

1
quespul•

Really don't know if running Xen on a AMD X370 is supported, I mean that platform is pretty new to them afaik so that sata controller might not be entirely supported as of now but this is just my guess, the Dell H200 can be flashed to run as HBA and using a couple SAS to SATA breakout cables you can connect up to 8 drives separately which will be seen by Xen natively since it's on their HCL. ;)

1
interfectOP•

I'm running Xen on the X370 right now to post this; it works fine except for the relatively poor IO performance I'm complaining about. I didn't think of a lack of compatibility between the motherboard SATA controller and Xen itself as being a potential issue; I thought Dom0 (Ubuntu for me) was responsible for driving all of that? I'm not having any trouble getting Xen to see the drive or expose it to the guest, and the guest has the Xen block device drivers. Could it be that Xen is still somehow using the motherboard SATA controller wrong?

1
quespul•

The way I see it, it's not entirely supported just yet so Xen uses a generic? driver for that sata controller as of now, but maybe there could be a walk-around but you'll have to hit Xen email list or their forums to figure that out or to even see if they're planning to include support to that specific platform on their next mayor kernel upgrade, again this is only my guess since I no longer run Xen but this issue keeps coming over and over again on reddit and forums where there's a lack of compatible drivers for many hypervisors since the platform is relatively new.

1