Hi,
Today we will focus on configuring the pciback on Xen server.
Pciback ?
The pciback is assigning hardware to a domU. For example, you can connect your network card directly on the domU without passing by the dom0. Thanks to this method, you increase both performance and security.
In this article, we will see how to connect a network card to the domU firewall on a server OVH (Super Plan 2011), ie with one network card.
Requirements
To follow this how-to, you must have a functional dom0.
Practice
On all how-to I have read, the steps are the same : search the pci device number, configure your grub and configure your domU. These steps works on a server in our infrastructure, but doesn’t with OVH. I find an error message in logs :
DEBUG (pciif:317) pci: assign device 0000:00:19.0
XendError: Migration not permitted with assigned PCI device.
INFO (XendDomainInfo:2088) Domain has shutdown: name=fw00 id=1 reason=poweroff.
Find hereafter, my method which is less beautiful but working!
1. Create your domU, boot in and install the e1000e driver :
cd /usr/local/src
wget http://freefr.dl.sourceforge.net/project/e1000/e1000e%20stable/1.4.4/e1000e-1.4.4.tar.gz
tar -xzvf e1000e-1.4.4.tar.gz
cd /usr/local/src/e1000e-1.4.4/src
BUILD_KERNEL=2.6.32-5-xen-amd64 make install
2. Find your PCI device number :
# lspci | grep net
00:19.0 Ethernet controller: Intel Corporation 82579V Gigabit Network Connection (rev 05)
Here, the number is 00:19.0, note it, we will use it later.
3. Create your domU config file as usually but add this line :
pci = [ '00:19.0' ]
extra = "iommu=soft swiotlb=force console=hvc0 xencons=tty"
4. Create your launch script
#!/bin/bash
date > /var/log/pciback.log
while [ ! -f /var/run/xend.pid ] ; do
sleep 3
echo "Xen is not started" >> /var/log/pciback.log
done
# Wait for a while, because there is a delay between the xend.pid creation and the totally start of Xen
sleep 10
(echo -n 0000:00:19.0 > /sys/bus/pci/drivers/e1000e/unbind) >> /var/log/pciback.log
(echo -n 0000:00:19.0 > /sys/bus/pci/drivers/pciback/new_slot) >> /var/log/pciback.log
(echo -n 0000:00:19.0 > /sys/bus/pci/drivers/pciback/bind) >> /var/log/pciback.log
xm create /etc/xen/fw00-debian.cfg >> /var/log/pciback.log
It is very simple, just it wait that xen it started, unbind the e1000e driver, bind the pciback driver and launch the domU with pciback.
I suggest you to ping your server during this manipulation : ping during the boot and xen start, lost ping during the domU boot (very quick), and get the ping with the new domU.
You can now use Belier to connect directly on your dom0.
Have fun with Xen :-)
Camille