Jump to: navigation, search

Difference between revisions of "XenServer/Development"

(talk)
 
(making it sit under the new set of XenServer docs)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 +
<!-- ## page was renamed from [[XenServerDevelopment]] -->
 
= [[XenServer]] Development =
 
= [[XenServer]] Development =
 +
 +
 +
<pre><nowiki>#!wiki red/solid
 +
Note: you can now use DevStack to get started with XenServer.
 +
For more details see: [[XenXCPAndXenServer]]
 +
</nowiki></pre>
 +
  
 
<<[[TableOfContents]]()>>
 
<<[[TableOfContents]]()>>
 +
 +
== Getting Started Notes ==
 +
 +
[[XenServer]] requires a nova-compute domU to run on the hypervisor in order to inject images into the VHDs.  Nova-compute is the worker for the Hypervisor.  It pulls jobs and applies them to the hypervisor it resides on.  It's required to run on the hypervisor because it utilizes /sys/hypervisor.
  
 
== Prepare Nova ==
 
== Prepare Nova ==
Line 10: Line 22:
  
 
<pre><nowiki>
 
<pre><nowiki>
sudo apt-get install bzr mysql-server build-essential rabbitmq-server euca2ools unzip
+
sudo apt-get install python-software-properties
sudo apt-get install python-twisted python-gflags python-carrot python-eventlet python-ipy python-sqlalchemy python-mysqldb python-webob python-redis python-mox python-routes python-daemon python-boto
+
sudo add-apt-repository ppa:nova-core/trunk
 +
sudo apt-get update
 +
 
 +
sudo apt-get install git-core mysql-server build-essential rabbitmq-server unzip swig screen parted curl euca2ools python-pip python-dev python-mysqldb libxml2 libxslt-dev
 +
 
 +
sudo pip install xenapi
 
</nowiki></pre>
 
</nowiki></pre>
 
  
 
=== Setup development branch ===
 
=== Setup development branch ===
Line 21: Line 37:
 
mkdir ~/openstack && cd ~/openstack
 
mkdir ~/openstack && cd ~/openstack
  
bzr whoami "Your Name <first.last@doman.tld>"
+
git clone https://github.com/openstack/nova.git
bzr lp-login <LP ID>
+
sudo pip install -r nova/tools/pip-requires
bzr init-repo .
+
</nowiki></pre>
 +
 
 +
 
 +
You may run into issues when when running the <code><nowiki>sudo pip install -r nova/tools/pip-requires</nowiki></code> command with an error similar to this on Ubuntu 10.04.2 LTS:
 +
 
 +
 
 +
<pre><nowiki>
 +
<backtrace>
 +
VersionConflict: (M2Crypto 0.20.1 (/usr/lib/pymodules/python2.6), Requirement.parse('M2Crypto==0.20.2'))
 +
 
 +
Storing complete log in ./pip-log.txt
 +
</nowiki></pre>
 +
 
 +
 
 +
This is because euca2ools and cloud-utils install an older version of [[M2Crypto]]. You can solve this by installing the required version:
  
bzr branch lp:nova
+
 
 +
<pre><nowiki>
 +
wget http://repo.vexxhost.com/openstack/m2crypto/python-m2crypto_0.20.2-1_amd64.deb
 +
sudo dpkg -i python-m2crypto_0.20.2-1_amd64.deb
 
</nowiki></pre>
 
</nowiki></pre>
  
  
=== Setup MySQL ===
+
You can rerun the <code><nowiki>sudo pip install -r nova/tools/pip-requires</nowiki></code> command and it will install with no problems afterwards
 +
 
 +
=== Install Glance ===
 +
'''Note''': The glance-scrubber.conf file may be missing from some packages, refer to https://bugs.launchpad.net/ubuntu/+source/glance/+bug/816972.
  
  
 
<pre><nowiki>
 
<pre><nowiki>
mysql -u root -p
+
https://github.com/openstack/glance.git
create database nova;
+
cd glance
exit
+
sudo cp etc/glance-*.conf ~
 +
# set filesystem_store_datadir to somewhere writable (/home/name/openstack/images/glance perhaps) in glance-api.conf
 +
# set sql_connection to MySQL (mysql://root:password@127.0.0.1/glance) in glance-registry.conf and glance-scrubber.conf
 +
sudo python setup.py install
 
</nowiki></pre>
 
</nowiki></pre>
  
 +
 +
=== Setup MySQL ===
 +
 +
<pre><nowiki>
 +
mysql -u root -p -e "create database nova; create database glance;"
 +
</nowiki></pre>
  
 
=== Configure Nova flags ===
 
=== Configure Nova flags ===
 
  
 
<pre><nowiki>
 
<pre><nowiki>
 
cd nova
 
cd nova
 +
 +
# xenapi_inject_image == false if using an ovf type glance file.  otherwise set to true to inject the bits into the image
  
 
cat > ../nova.conf << EOF
 
cat > ../nova.conf << EOF
Line 50: Line 96:
 
--sql_connection=mysql://root:<password>@127.0.0.1/nova
 
--sql_connection=mysql://root:<password>@127.0.0.1/nova
 
--network_manager=nova.network.manager.FlatManager
 
--network_manager=nova.network.manager.FlatManager
 +
--image_service=nova.image.glance.GlanceImageService
 
--flat_network_bridge=xenbr0
 
--flat_network_bridge=xenbr0
--s3_host=<nova-objectstore IP>
 
 
--connection_type=xenapi
 
--connection_type=xenapi
 
--xenapi_connection_url=https://<XenServer IP>
 
--xenapi_connection_url=https://<XenServer IP>
 
--xenapi_connection_username=root
 
--xenapi_connection_username=root
 
--xenapi_connection_password=password
 
--xenapi_connection_password=password
 +
--reboot_timeout=600
 +
--rescue_timeout=86400
 +
--resize_confirm_window=86400
 +
--allow_admin_api
 +
--enabled_apis=osapi_compute
 +
--allow_resize_to_same_host
 +
--xenapi_generate_swap
 +
--firewall_driver=nova.virt.xenapi.firewall.Dom0IptablesFirewallDriver
 
EOF
 
EOF
</nowiki></pre>
 
 
 
=== Install XenAPI ===
 
  
 +
# Add the following to your flagfile if you're using Ubuntu Maverick
 +
cat >> ../nova.conf << EOF
 +
--xenapi_remap_vbd_dev
 +
EOF
  
<pre><nowiki>
+
sudo mkdir /etc/nova
wget -O XenAPI.py "http://community.citrix.com/download/attachments/38633496/XenAPI.py?version=1"
+
sudo ln -s ~/openstack/nova.conf /etc/nova/
sudo mv ./XenAPI.py /usr/lib/python-2.6/<site-packages|dist-packages>
 
 
</nowiki></pre>
 
</nowiki></pre>
  
  
 
=== Ensure tests pass ===
 
=== Ensure tests pass ===
 
  
 
<pre><nowiki>
 
<pre><nowiki>
python run_tests.py
+
./run_tests.sh -x -N
 
</nowiki></pre>
 
</nowiki></pre>
 
  
 
=== Test XenAPI ===
 
=== Test XenAPI ===
 
  
 
<pre><nowiki>
 
<pre><nowiki>
python
+
./bin/nova-manage shell python
 
import XenAPI
 
import XenAPI
 
import nova.virt.xenapi_conn
 
import nova.virt.xenapi_conn
Line 87: Line 137:
 
x = nova.virt.xenapi_conn.XenAPIConnection("https://<XenServer IP>", "root", "password")
 
x = nova.virt.xenapi_conn.XenAPIConnection("https://<XenServer IP>", "root", "password")
 
x.list_instances()
 
x.list_instances()
 
# After XenTools are installed on the instance
 
x.get_diagnostics("instance-<id>")
 
 
</nowiki></pre>
 
</nowiki></pre>
 
  
 
=== Setup Nova ===
 
=== Setup Nova ===
  
 +
<pre><nowiki>
 +
cd nova/nova/CA && ./genrootca.sh && cd ../..
  
<pre><nowiki>
+
NAME=<name>
cd ./CA && ./genrootca.sh && cd ..
 
  
./bin/nova-manage --flagfile=../nova.conf user admin <name>
+
./bin/nova-manage db sync
./bin/nova-manage --flagfile=../nova.conf project create <project> <name>
+
./bin/nova-manage user admin $NAME
./bin/nova-manage --flagfile=../nova.conf network create 10.0.0.0/8 3 16
+
./bin/nova-manage project create openstack $NAME
./bin/nova-manage --flagfile=../nova.conf project zip <project> <name>
+
./bin/nova-manage network create private 10.0.0.0/8 1 64 [0 0 <IPv6 Prefix>::/<Mask> <IPv6 Gateway>]
 +
./bin/nova-manage project zip openstack $NAME
  
 
unzip nova.zip
 
unzip nova.zip
Line 108: Line 156:
 
</nowiki></pre>
 
</nowiki></pre>
  
 +
=== Enable Legacy Auth ===
 +
 +
<pre><nowiki>
 +
vim etc/nova/api-paste.ini
 +
# set [pipeline:openstack_compute_api_v2]
 +
# pipeline = faultwrap noauth ratelimit osapi_compute_app_v2
 +
# to
 +
# [pipeline:openstack_compute_api_v2]
 +
# pipeline = faultwrap auth ratelimit osapi_compute_app_v2
 +
</nowiki></pre>
  
 
=== Run Nova ===
 
=== Run Nova ===
 
  
 
<pre><nowiki>
 
<pre><nowiki>
 
screen  # each process gets its own window
 
screen  # each process gets its own window
  
./bin/nova-api --flagfile=../nova.conf
+
./bin/nova-api
./bin/nova-objectstore --flagfile=../nova.conf
+
./bin/nova-compute
./bin/nova-compute --flagfile=../nova.conf
+
./bin/nova-network
./bin/nova-network --flagfile=../nova.conf
+
./bin/nova-scheduler
./bin/nova-scheduler --flagfile=../nova.conf
 
 
</nowiki></pre>
 
</nowiki></pre>
  
 +
=== Setup Glance ===
  
== Prepare [[XenServer]] ==
+
<pre><nowiki>
 +
sudo mkdir /var/log/glance
 +
sudo glance-manage db_sync
 +
</nowiki></pre>
 +
 
 +
=== Run Glance ===
  
=== Install Nova plugin ===
+
<pre><nowiki>
 +
sudo glance-control all start
 +
</nowiki></pre>
  
 +
== Prepare [[XenServer]] ==
 +
=== Install Nova plugins ===
  
 
<pre><nowiki>
 
<pre><nowiki>
cd ~/openstack/nova/plugins/xenapi
+
cd ~/openstack/nova/plugins/xenserver/xenapi  
 
scp -r etc/ root@<XenServer IP>:/
 
scp -r etc/ root@<XenServer IP>:/
  
ssh root@<XenServer IP> chmod u+x /etc/xapi.d/plugins/objectstore
+
ssh root@<XenServer IP>
ssh root@<XenServer IP> sed -i -e "s/enabled=0/enabled=1/" /etc/yum.repos.d/CentOS-Base.repo
+
 
ssh root@<XenServer IP> yum install parted
+
chmod a+x /etc/xapi.d/plugins/*
 +
sed -i -e "s/enabled=0/enabled=1/" /etc/yum.repos.d/CentOS-Base.repo
 +
yum install parted
 +
mkdir /boot/guest
 +
sed -i -e "s/enabled=1/enabled=0/" /etc/yum.repos.d/CentOS-Base.repo
 +
</nowiki></pre>
 +
 
 +
 
 +
=== Configure SR storage ===
 +
 
 +
<pre><nowiki>
 +
ssh root@<XenServer IP> xe sr-list  # look for the 'Local storage' SR
 +
ssh root@<XenServer IP> xe sr-param-set uuid=<SR uuid> other-config:i18n-key=local-storage
 
</nowiki></pre>
 
</nowiki></pre>
  
 +
<Provisional message: placeholder update when Nova E4 releases> From Nova Essex 4, a new flag called 'sr_matching_filter' has been introduced (which defaults to 'other-config:i18n-key=local-storage'). This filter is used for finding the SR on which to install guest instances. The default value is the Local Storage in default [[XenServer]]/XCP installations as detailed above. However, if you want to select an SR with different matching criteria, this flag can be set to 'other-config:my_favorite_sr=true'. This means that XenAPI will look for an SR whose other-config contains the key-value pair (my_favorite_sr, true). On the other hand, to fall back on the Default SR, as displayed by [[XenCenter]] and as returned by xenapi.pool.get_default_SR, this flag can be set to to 'default-sr:true'.
  
 
== Instance Management ==
 
== Instance Management ==
 +
=== Prepare Images ===
 +
 +
 +
<pre><nowiki>
 +
mkdir -p ~/openstack/images && cd ~/openstack/images
 +
mkdir glance
 +
</nowiki></pre>
  
=== Prepare Images ===
+
 
 +
==== AMI Images ====
  
  
 
<pre><nowiki>
 
<pre><nowiki>
mkdir ~/openstack/images && cd ~/openstack/images
+
mkdir lucid_ami && cd lucid_ami
  
 
wget -q -O - http://173.203.107.207/ubuntu-lucid.tar | tar xSv
 
wget -q -O - http://173.203.107.207/ubuntu-lucid.tar | tar xSv
  
euca-bundle-image -i vmlinuz-2.6.32-23-server --kernel true
+
glance add name=ramdisk disk_format=ari container_format=ari is_public=True < initrd.img-2.6.32-23-server
euca-bundle-image -i initrd.img-2.6.32-23-server --ramdisk true
+
glance add name=kernel disk_format=aki container_format=aki is_public=True < vmlinuz-2.6.32-23-server
euca-bundle-image -i ubuntu-maverick.img
+
glance add name=lucid_ami disk_format=ami container_format=ami is_public=True ramdisk_id=<ramdisk ID> kernel_id=<kernel ID> < ubuntu-lucid.img
 +
</nowiki></pre>
 +
 
 +
 
 +
==== OVF Images ====
 +
 
 +
===== Linux =====
  
BUCKET=<name>
 
  
euca-upload-bundle -b ${BUCKET} -m /tmp/vmlinuz-2.6.32-23-server.manifest.xml
+
<pre><nowiki>
euca-upload-bundle -b ${BUCKET} -m /tmp/initrd.img-2.6.32-23-server.manifest.xml
+
mkdir linux_ovf && cd linux_ovf
euca-upload-bundle -b ${BUCKET} -m /tmp/ubuntu-maverick.img.manifest.xml
 
  
euca-register ${BUCKET}/vmlinuz-2.6.32-23-server.manifest.xml
+
glance add name=lucid_ovf disk_format=vhd container_format=ovf is_public=True < lucid.ova
euca-register ${BUCKET}/initrd.img-2.6.32-23-server.manifest.xml
 
euca-register ${BUCKET}/ubuntu-maverick.img.manifest.xml
 
 
</nowiki></pre>
 
</nowiki></pre>
  
  
=== Run Instance ===
+
===== Windows =====
  
  
 
<pre><nowiki>
 
<pre><nowiki>
euca-describe-images
+
mkdir windows && cd windows
euca-run-instances <machine ID> --kernel <kernel ID> --ramdisk <ramdisk ID>
 
euca-describe-instances
 
  
ssh root@<XenServer IP> xe vm-list
+
glance add name=windows disk_format=vhd container_format=ovf type=raw os_type=windows is_public=True < windows.ova
ssh root@<XenServer IP> xe vm-param-set uuid=<instance UUID> PV-args="console=hvc0 xencons=tty clocksource=jiffies root=/dev/xvda1"
+
</nowiki></pre>
 +
 
 +
 
 +
=== Run Instance ===
 +
 
 +
<pre><nowiki>
 +
ssh-keygen -f nova_key && chmod 600 nova_key
 +
euca-add-keypair nova_key > nova_key.priv
  
euca-reboot-instances <instance ID>
+
nova flavor-list
euca-describe-instances
+
nova image-list
 +
nova boot test --flavor <flavor ID> --image <image ID>
 +
nova list
 
</nowiki></pre>
 
</nowiki></pre>
 
  
 
=== Connect to instance console ===
 
=== Connect to instance console ===
 +
==== VNC ====
  
  
Line 189: Line 285:
 
</nowiki></pre>
 
</nowiki></pre>
  
 +
 +
==== [[XenConsole]] ====
 +
 +
 +
<pre><nowiki>
 +
ssh root@<XenServer IP>
 +
list_domains
 +
ps ax | grep vnc | grep <domain ID>
 +
kill -9 <VNC PIDs>
 +
/usr/lib/xen/bin/xenconsole <domain ID>
 +
</nowiki></pre>
  
 
=== Install [[XenTools]] ===
 
=== Install [[XenTools]] ===
 
 
Make ''xs-tools.iso'' available to the instance in [[XenCenter]], [[OpenXenManager]] or the CLI (not documented here) before proceeding.
 
Make ''xs-tools.iso'' available to the instance in [[XenCenter]], [[OpenXenManager]] or the CLI (not documented here) before proceeding.
  
Line 208: Line 314:
 
=== Install [[OpenXenManager]] on OS X ===
 
=== Install [[OpenXenManager]] on OS X ===
  
# Download: http://sourceforge.net/projects/openxenmanager/
+
 
 +
<pre><nowiki>#!wiki note
 +
The rev48 "packaged" tarball [[http://sourceforge.net/projects/openxenmanager/forums/forum/1159068/topic/4529278|may be broken]] -- SVN trunk worked for me, with the Homebrew dependency installation method I've documented below. ''--ChesMartin''
 +
</nowiki></pre>
 +
 
 +
 
 +
# Download: http://xensemaking.com/openxenmanager/
 
# Compile pygtk:
 
# Compile pygtk:
 +
  
 
<pre><nowiki>
 
<pre><nowiki>
Line 215: Line 328:
 
</nowiki></pre>
 
</nowiki></pre>
  
# Open a X11 shell and go to the openxenmanager directory
+
 
 +
If you're a Homebrew user, you're unfortunately in for a more work due in part to [https://github.com/mxcl/homebrew/pull/4353 some dependencies not being available as formula yet]. You can try this [https://gist.github.com/1094799 procedure for building PyGTK and dependencies].
 +
 
 +
1.#3 Open a X11 shell and go to the openxenmanager directory
 
# Run [[OpenXenManager]]:
 
# Run [[OpenXenManager]]:
 +
  
 
<pre><nowiki>
 
<pre><nowiki>
 
python window.py
 
python window.py
 
</nowiki></pre>
 
</nowiki></pre>
 +
 +
 +
The project <code><nowiki>README</nowiki></code> also mentions <code><nowiki>python-gtk-vnc</nowiki></code> and <code><nowiki>rrdtool</nowiki></code> for graphs -- neither path here takes those into account so you'll need to look into them if you wish to have those features working.

Revision as of 15:02, 12 March 2012

XenServer Development

#!wiki red/solid
Note: you can now use DevStack to get started with XenServer.
For more details see: [[XenXCPAndXenServer]]


<<TableOfContents()>>

Getting Started Notes

XenServer requires a nova-compute domU to run on the hypervisor in order to inject images into the VHDs. Nova-compute is the worker for the Hypervisor. It pulls jobs and applies them to the hypervisor it resides on. It's required to run on the hypervisor because it utilizes /sys/hypervisor.

Prepare Nova

Install dependencies

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:nova-core/trunk
sudo apt-get update

sudo apt-get install git-core mysql-server build-essential rabbitmq-server unzip swig screen parted curl euca2ools python-pip python-dev python-mysqldb libxml2 libxslt-dev

sudo pip install xenapi

Setup development branch

mkdir ~/openstack && cd ~/openstack

git clone https://github.com/openstack/nova.git
sudo pip install -r nova/tools/pip-requires


You may run into issues when when running the sudo pip install -r nova/tools/pip-requires command with an error similar to this on Ubuntu 10.04.2 LTS:


<backtrace>
VersionConflict: (M2Crypto 0.20.1 (/usr/lib/pymodules/python2.6), Requirement.parse('M2Crypto==0.20.2'))

Storing complete log in ./pip-log.txt


This is because euca2ools and cloud-utils install an older version of M2Crypto. You can solve this by installing the required version:


wget http://repo.vexxhost.com/openstack/m2crypto/python-m2crypto_0.20.2-1_amd64.deb
sudo dpkg -i python-m2crypto_0.20.2-1_amd64.deb


You can rerun the sudo pip install -r nova/tools/pip-requires command and it will install with no problems afterwards

Install Glance

Note: The glance-scrubber.conf file may be missing from some packages, refer to https://bugs.launchpad.net/ubuntu/+source/glance/+bug/816972.


https://github.com/openstack/glance.git
cd glance
sudo cp etc/glance-*.conf ~
# set filesystem_store_datadir to somewhere writable (/home/name/openstack/images/glance perhaps) in glance-api.conf
# set sql_connection to MySQL (mysql://root:password@127.0.0.1/glance) in glance-registry.conf and glance-scrubber.conf
sudo python setup.py install


Setup MySQL

mysql -u root -p -e "create database nova; create database glance;"

Configure Nova flags

cd nova

# xenapi_inject_image == false if using an ovf type glance file.  otherwise set to true to inject the bits into the image

cat > ../nova.conf << EOF
--verbose
--nodaemon
--sql_connection=mysql://root:<password>@127.0.0.1/nova
--network_manager=nova.network.manager.FlatManager
--image_service=nova.image.glance.GlanceImageService
--flat_network_bridge=xenbr0
--connection_type=xenapi
--xenapi_connection_url=https://<XenServer IP>
--xenapi_connection_username=root
--xenapi_connection_password=password
--reboot_timeout=600
--rescue_timeout=86400
--resize_confirm_window=86400
--allow_admin_api
--enabled_apis=osapi_compute
--allow_resize_to_same_host
--xenapi_generate_swap
--firewall_driver=nova.virt.xenapi.firewall.Dom0IptablesFirewallDriver
EOF

# Add the following to your flagfile if you're using Ubuntu Maverick
cat >> ../nova.conf << EOF
--xenapi_remap_vbd_dev
EOF

sudo mkdir /etc/nova
sudo ln -s ~/openstack/nova.conf /etc/nova/


Ensure tests pass

./run_tests.sh -x -N

Test XenAPI

./bin/nova-manage shell python
import XenAPI
import nova.virt.xenapi_conn
nova.virt.xenapi_conn.XenAPI = XenAPI
x = nova.virt.xenapi_conn.XenAPIConnection("https://<XenServer IP>", "root", "password")
x.list_instances()

Setup Nova

cd nova/nova/CA && ./genrootca.sh && cd ../..

NAME=<name>

./bin/nova-manage db sync
./bin/nova-manage user admin $NAME
./bin/nova-manage project create openstack $NAME
./bin/nova-manage network create private 10.0.0.0/8 1 64 [0 0 <IPv6 Prefix>::/<Mask> <IPv6 Gateway>]
./bin/nova-manage project zip openstack $NAME

unzip nova.zip
. novarc

Enable Legacy Auth

vim etc/nova/api-paste.ini
# set [pipeline:openstack_compute_api_v2]
# pipeline = faultwrap noauth ratelimit osapi_compute_app_v2
# to
# [pipeline:openstack_compute_api_v2]
# pipeline = faultwrap auth ratelimit osapi_compute_app_v2

Run Nova

screen  # each process gets its own window

./bin/nova-api
./bin/nova-compute
./bin/nova-network
./bin/nova-scheduler

Setup Glance

sudo mkdir /var/log/glance
sudo glance-manage db_sync

Run Glance

sudo glance-control all start

Prepare XenServer

Install Nova plugins

cd ~/openstack/nova/plugins/xenserver/xenapi 
scp -r etc/ root@<XenServer IP>:/

ssh root@<XenServer IP>

chmod a+x /etc/xapi.d/plugins/*
sed -i -e "s/enabled=0/enabled=1/" /etc/yum.repos.d/CentOS-Base.repo
yum install parted
mkdir /boot/guest
sed -i -e "s/enabled=1/enabled=0/" /etc/yum.repos.d/CentOS-Base.repo


Configure SR storage

ssh root@<XenServer IP> xe sr-list  # look for the 'Local storage' SR
ssh root@<XenServer IP> xe sr-param-set uuid=<SR uuid> other-config:i18n-key=local-storage

<Provisional message: placeholder update when Nova E4 releases> From Nova Essex 4, a new flag called 'sr_matching_filter' has been introduced (which defaults to 'other-config:i18n-key=local-storage'). This filter is used for finding the SR on which to install guest instances. The default value is the Local Storage in default XenServer/XCP installations as detailed above. However, if you want to select an SR with different matching criteria, this flag can be set to 'other-config:my_favorite_sr=true'. This means that XenAPI will look for an SR whose other-config contains the key-value pair (my_favorite_sr, true). On the other hand, to fall back on the Default SR, as displayed by XenCenter and as returned by xenapi.pool.get_default_SR, this flag can be set to to 'default-sr:true'.

Instance Management

Prepare Images

mkdir -p ~/openstack/images && cd ~/openstack/images
mkdir glance


AMI Images

mkdir lucid_ami && cd lucid_ami

wget -q -O - http://173.203.107.207/ubuntu-lucid.tar | tar xSv

glance add name=ramdisk disk_format=ari container_format=ari is_public=True < initrd.img-2.6.32-23-server
glance add name=kernel disk_format=aki container_format=aki is_public=True < vmlinuz-2.6.32-23-server
glance add name=lucid_ami disk_format=ami container_format=ami is_public=True ramdisk_id=<ramdisk ID> kernel_id=<kernel ID> < ubuntu-lucid.img


OVF Images

Linux
mkdir linux_ovf && cd linux_ovf

glance add name=lucid_ovf disk_format=vhd container_format=ovf is_public=True < lucid.ova


Windows
mkdir windows && cd windows

glance add name=windows disk_format=vhd container_format=ovf type=raw os_type=windows is_public=True < windows.ova


Run Instance

ssh-keygen -f nova_key && chmod 600 nova_key
euca-add-keypair nova_key > nova_key.priv

nova flavor-list
nova image-list
nova boot test --flavor <flavor ID> --image <image ID>
nova list

Connect to instance console

VNC

ssh root@<XenServer IP> netstat -tuanp | grep vncterm
ssh -L 590N:localhost:590N root@<XenServer IP>
vnc://localhost:590N


XenConsole

ssh root@<XenServer IP>
list_domains
ps ax | grep vnc | grep <domain ID>
kill -9 <VNC PIDs>
/usr/lib/xen/bin/xenconsole <domain ID>

Install XenTools

Make xs-tools.iso available to the instance in XenCenter, OpenXenManager or the CLI (not documented here) before proceeding.


ssh root@<instance IP>
mount /dev/xvdb /mnt
cd /mnt/Linux
dpkg -i ./xe-guest-utilities_5.5.0-464_amd64.deb
update-rc.d -f xe-linux-distribution remove
update-rc.d xe-linux-distribution defaults
reboot


Install OpenXenManager on OS X

#!wiki note
The rev48 "packaged" tarball [[http://sourceforge.net/projects/openxenmanager/forums/forum/1159068/topic/4529278|may be broken]] -- SVN trunk worked for me, with the Homebrew dependency installation method I've documented below. ''--ChesMartin''


  1. Download: http://xensemaking.com/openxenmanager/
  2. Compile pygtk:


sudo port install py26-gtk


If you're a Homebrew user, you're unfortunately in for a more work due in part to some dependencies not being available as formula yet. You can try this procedure for building PyGTK and dependencies.

1.#3 Open a X11 shell and go to the openxenmanager directory
  1. Run OpenXenManager:


python window.py


The project README also mentions python-gtk-vnc and rrdtool for graphs -- neither path here takes those into account so you'll need to look into them if you wish to have those features working.