https://wiki.xenproject.org/api.php?action=feedcontributions&user=Jusko&feedformat=atomXen - User contributions [en]2024-03-28T19:08:26ZUser contributionsMediaWiki 1.31.3https://wiki.xenproject.org/index.php?title=XAPI_on_Debian&diff=1345XAPI on Debian2011-12-02T13:07:06Z<p>Jusko: /* Installing xapi on Debian Unstable */</p>
<hr />
<div><!-- MoinMoin name: XAPI_on_debian --><br />
<!-- Comment: --><br />
<!-- WikiMedia name: XAPI on debian --><br />
<!-- Page revision: 00000031 --><br />
<!-- Original date: Thu Oct 20 15:33:20 2011 (1319124800000000) --><br />
<br />
__NOTOC__<br />
= Installing xapi on Debian Unstable =<br />
<br />
This is Project Kronos. Follow theses instructions to get xapi, the XenAPI server daemon, installed on a Debian unstable box, using the upstream Linux kernel. This will effectively allow you to turn an existing Debian machine into an XCP host. Note that this is *very much* a work-in-progress. Some features will be broken, and there will be a bit of manual configuration required. We appreciate any testing you do for this project, but please don't consider this production ready yet! Please visit the [[Kronos Supported Features]] page for a list of XCP features that are known to work on Kronos.<br />
<br />
1. Install Debian Squeeze<br />
<br />
1.5 Install firmware (only if necessary - http://wiki.debian.org/Firmware)<br />
* (Install any firmware required - may not be necessary)<br />
So, for example:<br />
<br />
<br />
<pre><br />
echo "deb http://ftp.uk.debian.org/debian/ squeeze non-free" >> /etc/apt/sources.list<br />
</pre><br />
<br />
<br />
<br />
<pre><br />
apt-get update<br />
</pre><br />
<br />
<br />
<br />
<pre><br />
apt-get install firmware-bnx2<br />
</pre><br />
<br />
<br />
2. Convert to Unstable:<br />
* Edit /etc/apt/sources.list and replace 'squeeze' with 'unstable'<br />
<br />
<pre><br />
perl -pi -e 's/squeeze/unstable/g' /etc/apt/sources.list<br />
</pre><br />
<br />
<br />
<br />
<pre><br />
apt-get update<br />
</pre><br />
<br />
<br />
<br />
<pre><br />
apt-get dist-upgrade<br />
</pre><br />
<br />
<br />
3. Edit /etc/apt/sources.list and add a line for experimental<br />
<br />
<pre><br />
echo "deb http://ftp.uk.debian.org/debian/ experimental main" >> /etc/apt/sources.list<br />
</pre><br />
<br />
<br />
<br />
<pre><br />
apt-get update<br />
</pre><br />
<br />
<br />
4. Install Xen hypervisor and dom0 kernel<br />
<br />
<pre><br />
apt-get install xen-hypervisor-4.1-amd64 linux-image-3.0.0-2-686-pae<br />
</pre><br />
<br />
<br />
5. Set up a Debian apt sources repo. This will update your system with the latest Kronos packages from our build server.<br />
<br />
<pre><br />
apt-get install curl<br />
echo "deb http://downloads.xen.org/XCP/debian/repo/debian unstable main" > /etc/apt/sources.list.d/kronos.list<br />
echo "deb-src http://downloads.xen.org/XCP/debian/repo/debian unstable main" >> /etc/apt/sources.list.d/kronos.list<br />
wget --quiet -O - http://downloads.xen.org/XCP/debian/xcp.gpg.key | apt-key add -<br />
apt-get update<br />
apt-get install xcp-xapi xcp-eliloader<br />
</pre><br />
<br />
<br />
Once you've installed these packages, you can just do an `apt-get update && apt-get upgrade` to keep up with the latest builds.<br />
<br />
6. Post-install setups<br />
<br />
Optional: Make xen the default grub entry:<br />
<br />
<br />
<pre><br />
mv /etc/grub.d/20_linux_xen /etc/grub.d/09_linux_xen<br />
update-grub<br />
</pre><br />
<br />
<br />
Setup the network/interfaces file:<br />
<br />
<br />
<pre><br />
cat > /etc/network/interfaces <<EOF <br />
# This file describes the network interfaces available on your system<br />
# and how to activate them. For more information, see interfaces(5).<br />
<br />
# The loopback network interface<br />
auto lo xenbr0<br />
iface lo inet loopback<br />
<br />
# The primary network interface<br />
iface eth0 inet manual<br />
<br />
iface xenbr0 inet dhcp<br />
bridge_ports eth0<br />
<br />
EOF<br />
</pre><br />
<br />
<br />
Setup the xensource-inventory file:<br />
<br />
<pre><br />
control_domain=`uuidgen`<br />
installation=`uuidgen`<br />
<br />
cat > /etc/xensource-inventory << EOF<br />
CURRENT_INTERFACES='xenbr0'<br />
BUILD_NUMBER='0'<br />
CONTROL_DOMAIN_UUID='${control_domain}'<br />
INSTALLATION_UUID='${installation}'<br />
MANAGEMENT_INTERFACE='xenbr0'<br />
PRIMARY_DISK='/dev/sda1'<br />
EOF<br />
</pre><br />
<br />
<br />
6. Reboot.<br />
<br />
= Using XCP =<br />
<br />
Set up your path:<br />
<br />
<pre><br />
export PATH=$PATH:/usr/lib/xen-common/xapi/bin<br />
</pre><br />
<br />
<br />
Edit the /etc/xensource-inventory file to add your main interface as the management interface, and to tell the storage plugins where your main filesystem is located. It should have lines in approximating the following:<br />
<br />
<pre><br />
MANAGEMENT_INTERFACE='eth0'<br />
PRIMARY_DISK='/dev/sda1'<br />
</pre><br />
<br />
<br />
Set up a storage repository. For now, I recommend NFS, or EXT if you have an unused block device. For example:<br />
<br />
<pre><br />
SR=`xe sr-create type=nfs name-label=nfs device-config:server=<nfs server> device-config:serverpath=<path on server>`<br />
</pre><br />
<br />
or<br />
<br />
<pre><br />
SR=`xe sr-create type=ext device-config:device=/dev/sda3 name-label=ext`<br />
</pre><br />
<br />
<br />
Set this as pool default SR:<br />
<br />
<pre><br />
POOL=`xe pool-list --minimal`<br />
xe pool-param-set uuid=$POOL default-SR=$SR<br />
</pre><br />
<br />
<br />
To install windows, you'll need an iso. These can be served by an NFS server. Try this:<br />
<br />
<pre><br />
xe-mount-iso-sr nfs-server:/path/to/isos<br />
</pre><br />
<br />
<br />
Then create a windows VM:<br />
<br />
<pre><br />
xe vm-install template=Windows\ 7\ \(32-bit\) new-name-label=windows<br />
xe vm-cd-add vm=windows cd-name=win7.iso device=3<br />
xe vm-start vm=windows<br />
</pre><br />
<br />
<br />
To get networking working, you'll need to manually set up the bridge:<br />
<br />
<pre><br />
brctl addbr xenbr0<br />
brctl addif xenbr0 eth0<br />
</pre><br />
<br />
<br />
You may need to move the IP address to the bridge rather than the physical interface. Having done this, try a pif-scan:<br />
<br />
<br />
<pre><br />
xe pif-scan<br />
</pre><br />
<br />
<br />
This might create the network for your interface.<br />
<br />
== PV drivers for Windows ==<br />
<br />
<br />
<pre><br />
wget http://downloads.xen.org/XCP/debian/xs-tools-5.9.960.iso<br />
mv xs-tools-5.9.960.iso /usr/lib/xen-common/xapi/packages/iso<br />
</pre><br />
<br />
<br />
After doing this, rescan the SR to pick up the new ISO.<br />
<br />
= Compiling from source =<br />
<br />
The easiest way to compile the XCP toolstack from source is to use the [https://github.com/jonludlam/xapi-autobuilder xapi-autobuilder].<br />
<br />
<pre><br />
git clone https://github.com/jonludlam/xapi-autobuilder.git<br />
cd xapi-autobuilder<br />
make clean ; make<br />
</pre><br />
<br />
Requirements for xapi-autobuilder:<br />
<br />
pbuilder debhelper dh-ocaml dh-autoreconf cdebootstrap python-debian mercurial git<br />
<br />
Note that you will also need to install blktap-dkms_0.1_all.deb from http://downloads.xen.org/XCP/debian/latest<br />
<br />
<br />
<pre><br />
wget http://downloads.xen.org/XCP/debian/blktap-dkms_0.1_all.deb<br />
</pre><br />
<br />
<br />
This will build all of the required packages for Xapi on Debian (except for vncterm, which is only available as a binary until we sort out licensing issues). Take a look at xapi-autobuilder/build.sh to see what's going on inside, and modify that script to point to your own repositories if you plan on compiling your own code.<br />
<br />
You can manually download all of the latest packages and source packages using:<br />
<br />
<pre><br />
wget -r -l1 --no-parent -nd http://downloads.xen.org/XCP/debian/latest/<br />
rm index.html*<br />
</pre><br />
<br />
[[Category:XCP]]<br />
[[Category:HowTo]]<br />
[[Category:Design Document]]<br />
[[Category:Developers]]<br />
[[Category:Users]]</div>Jusko