Archive/XCP DevStack

From Xen
Revision as of 13:07, 29 February 2012 by Angrygreenfrogs (talk | contribs) (Created page with "=Introduction= These instructions are based on the README file here: * This README is required reading, …")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


These instructions are based on the README file here:

  • This README is required reading, the instructions below are a helpful variation I used in testing


  1. Pre-installed XCP (1.0 or 1.1) somewhere
  2. Highly recommended (but not required) to use a clean install
    1. The below instructions will not wipe out any existing VMs on XCP, but this is for development testing and there's absolutely NO GUARANTEES
  3. The instructions use a good amount of disk space on XCP to prepare the images, so you can either do that step on a separate machine as the README above suggests, or I found it easier to attach a spare USB disk to XCP and mount that to have the extra space there to work with

These instructions will do the following

  1. Download and run the Xen DevStack scripts on the new XCP installation
    1. This will install the plug-ins and configuration needed inside the XCP dom0
  2. Create a new VM on XCP called ALLINONE which contains the full set of OpenStack node components (nova compute/volume, glance image, keystone identity, etc)
  3. Allow you to then login to the OpenStack dashboard web page and play around with OpenStack

The OpenStack VM (called "ALLINONE" by default) installed in XCP will automatically be configured to use 1024MB of RAM and 2.5GB of storage.


  1. Install XCP
  2. SSH to your XCP dom0
  3. Now install DevStack per the below

Download the bootstrap script

cd /root
wget --no-check-certificate
chmod 755

Fix XCP yum to allow it to install packages (we'll undo this at the end to be safe)

sed -i -e "s/enabled=0/enabled=1/" /etc/yum.repos.d/CentOS-Base.repo
sed -i -e "s/enabled=1/enabled=0/" /etc/yum.repos.d/Citrix.repo

If you decide to do what I did and use an external USB drive (mounted on /nasbackup on my XCP) you can do this. The scripts assume /root/devstack is the root path in some places, so I just setup a symlink to make my life easier.

# link in the storage directory since some of the scripts rely on /root/devstack
mkdir /nasbackup/devstack
ln -s /nasbackup/devstack /root

Setup all the pre-requisites

# install curl/expat for git
yum install curl-devel
yum install expat-devel

# install the pre-reqs using the script

The XENAPI_PASSWORD is only used inside the created VM. The part where the scripts install the VM into your XCP is done using "xe" on the command-line and so will install directly to the XCP machine the scripts are running from.

cd /root/devstack/tools/xen
cat > /root/devstack/localrc <<EOF
# IMPORTANT: The following must be set to your dom0 root password!
# This is the password for your guest (for both stack and root users)
# IMPORTANT: The following must be set to your dom0 root password!
# Do not download the usual images yet!
# Explicitly set virt driver here
# Explicitly set multi-host
# Give extra time for boot

If you didn't do the external USB drive step, you'll have to copy the devstack folder to another Linux machine with more available disk space to run this step. Please see the aforementioned official README for more information.

OPTIONAL: My VM had name resolution failures while watching the "/opt/stack/" setup log, which turned out to be because of the default gateway not working, so I fixed it by hand by editing templates/, adding my gateway to eth3, and re-installing.. just a note in case anyone else hits that problem, but otherwise recommended to leave this alone unless you have an issue.

# total hack to fix gateway
vi templates/ 
# added this as part of the eth3 section
# set to your LAN's gateway, this is mine!

This creates a 2.5GB file "/xvas/ALLINONE.xva" which is the base VM image that will be customized and then installed on your XCP


The VM is assigned a default network:

  • Public IP:
  • Management IP:

Customize and install the new VM onto your local XCP


If you watch the VM console it may get stuck on "mounted filesystem with ordered data mode", but really in the background it's working away.

You can ssh to the machine with "root" and GUEST_PASSWORD above and then monitor the install status on the machine:

tail -f /opt/stack/

After it's all over you should be able to login to the web UI and have a play around.

Revert back the yum setup on XCP

sed -i -e "s/enabled=1/enabled=0/" /etc/yum.repos.d/CentOS-Base.repo
sed -i -e "s/enabled=0/enabled=1/" /etc/yum.repos.d/Citrix.repo

Mult-node setup

These scripts also contain a multi-node setup for separate HEAD and COMPUTE VMs, both still intended to run on the same XCP dom0.

The HEAD vm contains everything except compute, and the COMPUTE vm contains just compute.

Run this script to creates two XVA files:

  • xvas/HEADNODE.xva
  • xvas/COMPUTENODE.xva

These are assigned a default network:

  • HEAD
    • Public IP:
    • Management IP:
    • Public IP:
    • Management IP:
  • Floating IP range:

Run this script to setup and install both of those VMs onto the current running XCP. The scripts do not currently by default have any support for installing them on separate XCPs, so you'd have to hack that together yourself if desired.