Browse code

Merge "xenapi: README.md and embedded localrc updates"

Jenkins authored on 2013/09/05 03:07:59
Showing 1 changed files
... ...
@@ -1,48 +1,54 @@
1
-# Getting Started With XenServer 5.6 and Devstack
2
-The purpose of the code in this directory it to help developers bootstrap
3
-a XenServer 5.6 (or greater) + Openstack development environment.  This file gives
4
-some pointers on how to get started.
1
+# Getting Started With XenServer and Devstack
5 2
 
6
-Xenserver is a Type 1 hypervisor, so it needs to be installed on bare metal.
7
-The Openstack services are configured to run within a "privileged" virtual
8
-machine on the Xenserver host (called OS domU). The VM uses the XAPI toolstack
9
-to communicate with the host.
3
+The purpose of the code in this directory it to help developers bootstrap a
4
+XenServer 6.2 (older versions may also work) + Openstack development
5
+environment. This file gives some pointers on how to get started.
6
+
7
+Xenserver is a Type 1 hypervisor, so it is best installed on bare metal.  The
8
+Openstack services are configured to run within a virtual machine (called OS
9
+domU) on the XenServer host. The VM uses the XAPI toolstack to communicate with
10
+the host over a network connection (see `MGT_BRIDGE_OR_NET_NAME`).
10 11
 
11 12
 The provided localrc helps to build a basic environment.
12
-The requirements are:
13
+
14
+## Introduction
15
+
16
+### Requirements
17
+
13 18
  - An internet-enabled network with a DHCP server on it
14 19
  - XenServer box plugged in to the same network
15 20
 This network will be used as the OpenStack management network. The VM Network
16 21
 and the Public Network will not be connected to any physical interfaces, only
17 22
 new virtual networks will be created by the `install_os_domU.sh` script.
18 23
 
19
-Steps to follow:
24
+### Steps to follow
25
+
20 26
  - Install XenServer
21 27
  - Download Devstack to XenServer
22 28
  - Customise `localrc`
23 29
  - Start `install_os_domU.sh` script
24 30
 
31
+### Brief explanation
32
+
25 33
 The `install_os_domU.sh` script will:
26 34
  - Setup XenAPI plugins
27 35
  - Create the named networks, if they don't exist
28
- - Preseed-Netinstall an Ubuntu Virtual Machine, with 1 network interface:
29
-   - eth0 - Connected to `UBUNTU_INST_BRIDGE_OR_NET_NAME`, defaults to
30
-   `MGT_BRIDGE_OR_NET_NAME`
36
+ - Preseed-Netinstall an Ubuntu Virtual Machine (NOTE: you can save and reuse
37
+   it, see [Reuse the Ubuntu VM](#reuse-the-ubuntu-vm)), with 1 network
38
+   interface:
39
+   - `eth0` - Connected to `UBUNTU_INST_BRIDGE_OR_NET_NAME`, defaults to
40
+     `MGT_BRIDGE_OR_NET_NAME`
31 41
  - After the Ubuntu install process finished, the network configuration is
32 42
  modified to:
33
-   - eth0 - Management interface, connected to `MGT_BRIDGE_OR_NET_NAME`
34
-   - eth1 - VM interface, connected to `VM_BRIDGE_OR_NET_NAME`
35
-   - eth2 - Public interface, connected to `PUB_BRIDGE_OR_NET_NAME`
36
-   - (eth3) - Optional network interface if neutron is used, to enforce xapi to
37
-   create the underlying bridge.
43
+   - `eth0` - Management interface, connected to `MGT_BRIDGE_OR_NET_NAME`. Xapi
44
+     must be accessible through this network.
45
+   - `eth1` - VM interface, connected to `VM_BRIDGE_OR_NET_NAME`
46
+   - `eth2` - Public interface, connected to `PUB_BRIDGE_OR_NET_NAME`
38 47
  - Start devstack inside the created OpenStack VM
39 48
 
40 49
 ## Step 1: Install Xenserver
41
-Install XenServer 5.6+ on a clean box. You can get XenServer by signing
42
-up for an account on citrix.com, and then visiting:
43
-https://www.citrix.com/English/ss/downloads/details.asp?downloadId=2311504&productId=683148
44
-
45
-For details on installation, see: http://wiki.openstack.org/XenServer/Install
50
+Install XenServer on a clean box. You can download the latest XenServer for
51
+free from: http://www.xenserver.org/
46 52
 
47 53
 The XenServer IP configuration depends on your local network setup. If you are
48 54
 using dhcp, make a reservation for XenServer, so its IP address won't change
... ...
@@ -85,17 +91,20 @@ Of course, use real passwords if this machine is exposed.
85 85
     XENAPI_CONNECTION_URL="http://address_of_your_xenserver"
86 86
     VNCSERVER_PROXYCLIENT_ADDRESS=address_of_your_xenserver
87 87
 
88
-    # Do not download the usual images
89
-    IMAGE_URLS=""
90
-    # Explicitly set virt driver here
88
+    # Download a vhd and a uec image
89
+    IMAGE_URLS="\
90
+    https://github.com/downloads/citrix-openstack/warehouse/cirros-0.3.0-x86_64-disk.vhd.tgz,\
91
+    http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz"
92
+
93
+    # Explicitly set virt driver
91 94
     VIRT_DRIVER=xenserver
92
-    # Explicitly enable multi-host
95
+
96
+    # Explicitly enable multi-host for nova-network HA
93 97
     MULTI_HOST=1
98
+
94 99
     # Give extra time for boot
95 100
     ACTIVE_TIMEOUT=45
96 101
 
97
-    # NOTE: the value of FLAT_NETWORK_BRIDGE will automatically be determined
98
-    # by install_os_domU.sh script.
99 102
     EOF
100 103
 
101 104
 ## Step 4: Run `./install_os_domU.sh` from the `tools/xen` directory
... ...
@@ -107,12 +116,60 @@ Once this script finishes executing, log into the VM (openstack domU) that it
107 107
 installed and tail the run.sh.log file. You will need to wait until it run.sh
108 108
 has finished executing.
109 109
 
110
-## Step 5: Do cloudy stuff!
111
-* Play with horizon
112
-* Play with the CLI
113
-* Log bugs to devstack and core projects, and submit fixes!
110
+# Appendix
111
+
112
+This section contains useful information for running devstack in CI
113
+environments / using ubuntu network mirrors.
114
+
115
+## Use a specific Ubuntu mirror for installation
116
+
117
+To speed up the Ubuntu installation, you can use a specific mirror. To specify
118
+a mirror explicitly, include the following settings in your `localrc` file:
119
+
120
+    UBUNTU_INST_HTTP_HOSTNAME="archive.ubuntu.com"
121
+    UBUNTU_INST_HTTP_DIRECTORY="/ubuntu"
122
+
123
+These variables set the `mirror/http/hostname` and `mirror/http/directory`
124
+settings in the ubuntu preseed file. The minimal ubuntu VM will use the
125
+specified parameters.
126
+
127
+## Use an http proxy to speed up Ubuntu installation
128
+
129
+To further speed up the Ubuntu VM and package installation, an internal http
130
+proxy could be used. `squid-deb-proxy` has prooven to be stable. To use an http
131
+proxy, specify:
132
+
133
+    UBUNTU_INST_HTTP_PROXY="http://ubuntu-proxy.somedomain.com:8000"
134
+
135
+in your `localrc` file.
136
+
137
+## Reuse the Ubuntu VM
138
+
139
+Performing a minimal ubuntu installation could take a lot of time, depending on
140
+your mirror/network speed. If you run `install_os_domU.sh` script on a clean
141
+hypervisor, you can speed up the installation, by re-using the ubuntu vm from
142
+a previous installation.
143
+
144
+### Export the Ubuntu VM to an XVA
145
+
146
+Given you have an nfs export `TEMPLATE_NFS_DIR`:
147
+
148
+    TEMPLATE_FILENAME=devstack-jeos.xva
149
+    TEMPLATE_NAME=jeos_template_for_devstack
150
+    mountdir=$(mktemp -d)
151
+    mount -t nfs "$TEMPLATE_NFS_DIR" "$mountdir"
152
+    VM="$(xe template-list name-label="$TEMPLATE_NAME" --minimal)"
153
+    xe template-export template-uuid=$VM filename="$mountdir/$TEMPLATE_FILENAME"
154
+    umount "$mountdir"
155
+    rm -rf "$mountdir"
156
+
157
+### Import the Ubuntu VM
158
+
159
+Given you have an nfs export `TEMPLATE_NFS_DIR` where you exported the Ubuntu
160
+VM as `TEMPLATE_FILENAME`:
114 161
 
115
-## Step 6: Run from snapshot
116
-If you want to quicky re-run devstack from a clean state,
117
-using the same settings you used in your previous run,
118
-you can revert the DomU to the snapshot called `before_first_boot`
162
+    mountdir=$(mktemp -d)
163
+    mount -t nfs "$TEMPLATE_NFS_DIR" "$mountdir"
164
+    xe vm-import filename="$mountdir/$TEMPLATE_FILENAME"
165
+    umount "$mountdir"
166
+    rm -rf "$mountdir"