Broken: Xen Cloud Platform (XCP) on Ubuntu Server 14.04 LTS (Trusty Tahr)
Update 28th May 2014:
I was today in the process of installing a new XCP visualisation server and found that the xcp-xapi package is missing from the repo.
A brief look at xcp-xapi 1.3.2-15ubuntu2 (amd64 binary) in ubuntu trusty and “xen-api” 1.3.2-15ubuntu2 source package in The Trusty Tahr shows: and
1.3.2-15ubuntu2 DELETED: Trusty pocket Release in component universe and section admin. Removal requested on 2013-12-24. Deleted on 2013-12-24 by Matthias Klose. ocaml transition: doesn’t build
I'm guessing that this is because XCP on Debian/Ubuntu and all platforms other than CentOS is no longer supported by Citrix, XCP has deprecated and major dependencies are now broken, but I must say that this is a terrible situation. As far as I'm aware, OpenStack and some others use XCP on Ubuntu for their infrastructure and this would appear to be a cynical method of getting them to switch to XenServer/CentOS. Personally I'd like to stick with Ubuntu and also don't like the Idea of switching to an inferior Xen Toolstack. Perhaps I aught to start from scratch and learn to use KVM?
If anyone knows anything about this situation and if it is likely to be remedied please let me know, I'd really appreciate it!
I will endeavour to get xcp-xapi installed by other means and report back as soon as I am able. Don't hold your breath though...
This update is taken from this comment, below.
The original post...
Installing and configuring Ubuntu 13.10 (Saucy Salamander) with Xen Cloud Platform (dom0) and an Ubuntu 13.10 (Saucy Salamander) guest (domU).
Install Ubuntu Server:
Copy ubuntu-13.10-server-amd64.iso to a CD or Flashdrive and boot from your server hardware.
Note: You may need to use a PS2 keyboard, as opposed to a USB one if you have keyboard troubles during the installation process. A USB keyboard should be fine once you have booted into the installed system.
https://help.ubuntu.com/community/Se...OpenXenManager
Install a minimal system (Press F4 during the CD install)
FYI: For my partitioning scheme, I chose to do this manually and created:
Partition 1: 1024MB, ext2, bootable, /boot.
Partition 2: Rest of drive, physical volume for LVM.
Configured LVM as: Volume Group "ServerVG", used all remaining space on HDD.
Created Logical volumes in this group: "Swap", 17GB, swap; "Root", 20GB, ext4, /; "ServerSR", 100GB, ext3, /media/richard/ServerSR.
Select only an OpenSSH Server when asked in Tasksel.
Complete the installation process and reboot the server.
Install XCP-XAPI with bridge networking:
Install Packages and update your system.
Code:
sudo apt-get update && sudo apt-get -y dist-upgrade && sudo apt-get -y install vim && sudo apt-get -y install mc && sudo apt-get -y install htop && sudo apt-get -y install xen-hypervisor
Configure GRUB for Xen Booting:
Please note that from Xen version 4.4 Xen automatically configures GRUB to boot into Xen by default, so configuring GRUB_DEFAULT should not be necessary.
Code:
sudo update-grub
Including Xen overrides from /etc/default/grub.d/xen.cfg
WARNING: GRUB_DEFAULT changed to boot into Xen by default!
Edit /etc/default/grub.d/xen.cfg to avoid this warning.
Generating grub configuration file ...
However: Configuring VCPU and memory as well as disabling apparmour at boot is still necessarry, I believe.
The official grub manual describes this correctly: http://www.gnu.org/software/grub/man...-configuration
Put the following in /etc/default/grub:
Code:
sudo vim /etc/default/grub
Code:
#Tell GRUB to remember last selection:
GRUB_DEFAULT="saved"
GRUB_SAVEDEFAULT="true"
[...]
#Disable apparmor at boot:
GRUB_CMDLINE_LINUX="apparmor=0"
#Restrict "dom0" to 1GB of memory and 1 VCPU:
GRUB_CMDLINE_XEN="dom0_mem=1G,max:1G dom0_max_vcpus=1"
Note 1: The first part;
Code:
#Tell GRUB to remember last selection:
GRUB_DEFAULT="saved"
GRUB_SAVEDEFAULT="true"
does not always work (I don't know why).
Instead you may want to try;
or
Code:
GRUB_DEFAULT="Xen 4.4-amd64"
Note 2: Why should I dedicate fixed amount of memory for Xen "dom0"?
First of all (dom0) Linux kernel calculates various network related parameters based on the boot time amount of memory.
The second reason is Linux needs memory to store the memory metadata (per page info structures), and this allocation is also based on the boot time amount of memory.
http://wiki.xen.org/wiki/Xen_Best_Practices
Code:
sudo update-grub
sudo reboot
Select "Ubuntu / Gnu Linux with Xen hypervisor" from GRUB boot menu.
Login and then check to see if Xen is running:
Code:
cat /proc/xen/capabilities
"control_d"
Not necessary at this stage:
Add XCP-PPA via:
Code:
sudo apt-get install python-software-properties
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ubuntu-xen-org/xcp-unstable
Install XCP-XAPI:
Code:
sudo apt-get install -y xcp-xapi && sudo apt-get install qemu-common
-> Choose "bridge" when prompted for network backend.
To reconfigure later:
Code:
sudo dpkg-reconfigure xcp-networkd
Tell Xen what it's toolstack should be:
Code:
sudo vim /etc/default/xen
Not Neccessary:
Code:
sudo mkdir /usr/share/qemu; sudo ln -s /usr/share/qemu-linaro/keymaps /usr/share/qemu/keymaps
http://wiki.xen.org/wiki/XAPI_toolst...nterfaces_file
Set up network bridging (DHCP):
Code:
sudo vim /etc/network/interfaces
Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# Xen network interface for "dom0"
auto xenbr0
iface xenbr0 inet dhcp
bridge_ports eth0
# The primary network interface
#auto eth0
#iface eth0 inet dhcp
At this stage, it might be worthwhile setting up the ability to connect to the server via XenCenter or OpenXenManager, if you have this utility installed on another PC.
After the next reboot, if this software is able to 'talk' to your server, you should get a prompt to authorise it's SSL certificate. This is a good indication that some form of communication is happening between the management software and the server.
Even if there are subsequent errors, this should be a good sign.
To enable remote access by XenCenter:
You will get the error "XenCenter has encountered a problem connecting to this server... Incorrect username and/or password.", or similar (depending on the software); so carrying out the following actions on the server will be neccessary:
Code:
sudo usermod -a -G xapi richard
http://ubuntuforums.org/showthread.php?t=2158441
Uncomment "auth sufficient pam_succeed_if.so user ingroup xapi"
Code:
sudo vim /etc/pam.d/xapi
Code:
#%PAM-1.0
#@include common-auth
# Uncomment this line to allow users of group xapi to authenticate
auth sufficient pam_succeed_if.so user ingroup xapi
# Only allow group root to authenticate, unless above line uncommented
auth required pam_succeed_if.so user ingroup root
If this doesn't work, try replacing all with:
Code:
auth include common-auth
account include common-auth
password include common-auth
If the server is installed with an encrypted 'Home' directory, you may get the message:
Unable to connect to server 'Server'.
The connection was refused.
Check that XenServer is configured correctly on 'Server' and try again.
The only way that I found around this is to reinstall with an unencrypted Home directory. Sorry!
http://www.citrix.com/downloads/xens...server-62.html
If you use the openvswitch mode (and not bridging), then you will need to tell XCP about your network configuration. In fact, it doesn't seem to hurt if you're using bridging:
(NOTE: I haven't been able to get openvswitch working and I also found that performing the following commands did cause some network connectivity problems on startup.)
Code:
sudo su
PIF_UUID=`xe pif-list device=eth0 --minimal`
xe pif-reconfigure-ip uuid=$PIF_UUID mode=dhcp
All set! Ready to reboot and let xcp-xapi toolstack take over:
Login now and check that xcp/xapi is up and running:
Code:
service xcp-xapi status
sudo xe host-list
sudo xe vm-list
sudo xe network-list
sudo xe sr-list
sudo xe pif-list
cat /etc/xcp/inventory
Configure Storage Repository for Use With XAPI:
http://www.howtoforge.com/linux_lvm_p2
https://help.ubuntu.com/community/Se...OpenXenManager
To show your volume group (VG):
Code:
sudo pvs
sudo vgscan
sudo vgdisplay
To show your logical volumes (LV):
Code:
sudo lvdisplay
sudo lvscan
Create a LV with X GBs:
"sudo lvcreate -L <X>GB -n <StorageRepositoryName> /dev/<VG>"
Code:
sudo lvcreate -L 10GB -n ServerSR ServerVG
To show your logical volumes (LV):
Code:
sudo lvdisplay
sudo lvscan
Note: If you created a LV for your storage repository during the installation of the server, please comment out it's entry in /etc/fstab in order to give Xen uncontested access to it:
Code:
sudo vim /etc/fstab
Code:
#/dev/mapper/ServerVG-ServerSR /media/richard/ServerSR ext3 defaults 0 2
Register the logical volume for use with XAPI:
"sudo xe sr-create type=ext shared=true name-label=<StorageRepositoryName> device-config:device=/dev/<VG>/<StorageRepositoryName>"
Code:
sudo su
SR=`xe sr-create type=ext shared=true name-label=ServerSR device-config:device=/dev/ServerVG/ServerSR`
then set the SR as the pool default SR:
Code:
POOL=`xe pool-list --minimal`
xe pool-param-set uuid=$POOL default-SR=$SR
This should display the Storage Repository:
"sudo xe sr-list name-label=<StorageRepositoryName>"
Code:
sudo xe sr-list name-label=ServerSR
sudo xe sr-list
sudo xe pool-list
Configure a ISO Repository for Use With XAPI:
An ISO Repository contains ISOs (disk images) with operational systems to perform the installations.
"sudo xe sr-create name-label=<LocalISORepositoryName> type=iso shared=true device-config:location=<FolderPath> device-config:legacy_mode=true content-type=iso"
The following example makes a storage repository called "LocalISORepository" in your /home directory:
Code:
mkdir /home/richard/LocalISORepository/
sudo xe sr-create name-label=LocalISORepository type=iso shared=true device-config:location=/home/richard/LocalISORepository/ device-config:legacy_mode=true content-type=iso
This should display the ISO Repository
"sudo xe sr-list name-label=<LocalISORepositoryName>"
Code:
sudo xe sr-list name-label=LocalISORepository
sudo xe sr-list
To delete a local storage repository:
http://forums.citrix.com/thread.jspa...332&tstart=135
Code:
sudo lvremove /dev/ServerVG/StorageRepository
If you lost your guest templates, the list will be empty in XenCenter and if you do "xe template-list" nothing will appear.. do this:
http://blog.jamesrhall.com/2012/06/xcp-on-ubuntu.html
Code:
cd /usr/lib/xcp/lib
Code:
sudo ./create_templates
Installing Ubuntu 13.10 Saucy Salamender domU guest:
http://wiki.xen.org/wiki/Installing_Linux_on_Kronos
http://pravinchavan.wordpress.com/20...-04-raring-vm/
(see section 4d)
EDIT: Skip to the next post for a more sophisticated install script.
Code:
sudo xe template-list
Use the script below and alter the variables "release", "label", "host" and "domain" as necessary:
Code:
#!/bin/bash
set -e
set -x
release='saucy'
label='SaucyTest'
host='SaucyTest'
domain='mydomain.is.best'
template=`xe template-list name-label="Ubuntu Lucid Lynx 10.04 (64-bit)" --minimal`
vm=`xe vm-install template=$template new-name-label=$label`
network=`xe network-list bridge=xenbr0 --minimal`
vif=`xe vif-create vm-uuid=$vm network-uuid=$network device=0`
xe vm-param-set uuid=$vm other-config:debian-release=$release
xe vm-param-set uuid=$vm other-config:install-repository=http://archive.ubuntu.com/ubuntu
xe vm-param-set uuid=$vm PV-args="auto-install/enable=true interface=auto netcfg/dhcp_timeout=600 hostname=$host"
set +x
echo ''
echo 'Press any key to start VM'
echo ''
read -n 1
xe vm-start uuid=$vm
xe vm-list uuid=$vm
xe console-list uuid=$vm
echo ''
echo 'Press any key for Console'
echo ''
read -n 1
xe console uuid=$vm
Code:
sudo chmod a+x Saucy.sh
sudo ./Saucy.sh
You may need to press a key again to bring the console up properly, but once it's up and running, just follow the usual procedure for installing Ubuntu Server.
For a WebUI VM install, download the latset XenOrchestra image from:
https://xen-orchestra.com/install-an...e-xo-from-git/
Follow the instructions therein.
That's it for now!
Bookmarks