File: README.rst

package info (click to toggle)
python-os-xenapi 0.3.4-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 1,012 kB
  • sloc: python: 8,137; sh: 2,154; makefile: 45
file content (233 lines) | stat: -rw-r--r-- 8,891 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Install Devstack on XenServer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Getting Started With XenServer and Devstack
___________________________________________

The purpose of the code in the install directory is to help developers bootstrap a
XenServer(7.1 or above LTSR) + OpenStack development environment.
This guide gives some pointers on how to get started.

Xenserver is a Type 1 hypervisor, so it is best installed on bare metal.  The
OpenStack services are configured to run within a virtual machine on the XenServer host.
The VM uses the XAPI toolstack to communicate with the host over a network connection
(see `MGT_BRIDGE_OR_NET_NAME`).

The provided local.conf helps to build a basic devstack environment.

Introduction
............

Requirements
************

 - A management network with access to the internet
 - A DHCP server to provide addresses on this management network
 - XenServer 7.0 or above installed with a local EXT SR (labelled "Optimised for XenDesktop" in the
   installer) or a remote NFS SR

This network will be used as the OpenStack management network. The VM (Tenant) Network and the
Public Network will not be connected to any physical interfaces, only new virtual networks which
will be created by the `install_on_xen_host.sh` script.

Steps to follow
***************

You should install the XenServer host first, then launch the devstack installation in one of two ways,
 - From a remote linux client (Recommended)
  - Download install-devstack-xen.sh to the linux client
  - Configure the local.conf contents in install-devstack-xen.sh.
  - Generate passwordless ssh key using "ssh-keygen -t rsa -N "" -f devstack_key.priv"
  - Launch script using "install-devstack-xen.sh XENSERVER mypassword devstack_key.priv" with some
    optional arguments

 - On the XenServer host
   - Download os-xenapi to XenServer
   - Create and customise a `local.conf`
   - Start `install_on_xen_host.sh` script

Brief explanation
*****************

The `install-devstack-xen.sh` script will:
 - Verify some pre-requisites to installation
 - Download os-xenapi folder to XenServer host
 - Generate a standard local.conf file
 - Call install_on_xen_host.sh to do devstack installation
 - Run tempest test if required

The 'install_on_xen_host.sh' script will:
 - Verify the host configuration
 - Create template for devstack DomU VM if needed. Including:
  - Creating the named networks, if they don't exist
  - Preseed-Netinstall an Ubuntu Virtual Machine , with 1 network interface:
   - `eth0` - Connected to `UBUNTU_INST_BRIDGE_OR_NET_NAME` (which defaults to
     `MGT_BRIDGE_OR_NET_NAME`)

  - After the Ubuntu install process has finished, the network configuration is modified to:
   - `eth0` - Management interface, connected to `MGT_BRIDGE_OR_NET_NAME`.  Note that XAPI must be
     accessible through this network.
   - `eth1` - VM interface, connected to `VM_BRIDGE_OR_NET_NAME`
   - `eth2` - Public interface, connected to `PUB_BRIDGE_OR_NET_NAME`

 - Create a template of the VM and destroy the current VM
 - Create DomU VM according to the template and ssh to the VM
 - Create a linux service to enable devstack service after VM reboot. The service will:
  - Download devstack source code if needed
  - Call unstack.sh and stack.sh to install devstack

 - Reboot DomU VM

Step 1: Install Xenserver
.........................
Install XenServer on a clean box. You can download the latest XenServer for
free from: http://www.xenserver.org/

The XenServer IP configuration depends on your local network setup. If you are
using dhcp, make a reservation for XenServer, so its IP address won't change
over time. Make a note of the XenServer's IP address, as it has to be specified
in `local.conf`. The other option is to manually specify the IP setup for the
XenServer box. Please make sure, that a gateway and a nameserver is configured,
as `install-devstack-xen.sh` will connect to github.com to get source-code snapshots.

OpenStack currently only supports file-based (thin provisioned) SR types EXT and NFS.  As such the
default SR should either be a local EXT SR or a remote NFS SR.  To create a local EXT SR use the
"Optimised for XenDesktop" option in the XenServer host installer.

Step 2: Download install-devstack-xen.sh
........................................
On your remote linux client, get the install script from https://raw.githubusercontent.com/openstack/os-xenapi/master/tools/install-devstack-xen.sh

Step 3: local.conf overview
...........................
Devstack uses a local.conf for user-specific configuration.  install-devstack-xen provides a
configuration file which is suitable for many simple use cases.  In more advanced use cases, you may
need to configure the local.conf file after installation - or use the second approach outlined above
to bypass the install-devstack-xen script.

local.conf sample::

    [[local|localrc]]

    enable_plugin os-xenapi https://github.com/openstack/os-xenapi.git

    # Passwords
    MYSQL_PASSWORD=citrix
    SERVICE_TOKEN=citrix
    ADMIN_PASSWORD=citrix
    SERVICE_PASSWORD=citrix
    RABBIT_PASSWORD=citrix
    GUEST_PASSWORD=citrix
    XENAPI_PASSWORD="$XENSERVER_PASS"
    SWIFT_HASH="66a3d6b56c1f479c8b4e70ab5c2000f5"

    # Do not use secure delete
    CINDER_SECURE_DELETE=False

    # Compute settings
    VIRT_DRIVER=xenserver

    # Tempest settings
    TERMINATE_TIMEOUT=90
    BUILD_TIMEOUT=600

    # DevStack settings

    LOGDIR=${LOGDIR}
    LOGFILE=${LOGDIR}/stack.log

    # Turn on verbosity (password input does not work otherwise)
    VERBOSE=True

    # XenAPI specific
    XENAPI_CONNECTION_URL="http://$XENSERVER_IP"
    VNCSERVER_PROXYCLIENT_ADDRESS="$XENSERVER_IP"

    # Neutron specific part
    ENABLED_SERVICES+=neutron,q-domua
    Q_ML2_PLUGIN_MECHANISM_DRIVERS=openvswitch

    Q_ML2_PLUGIN_TYPE_DRIVERS=vxlan,flat
    Q_ML2_TENANT_NETWORK_TYPE=vxlan

    VLAN_INTERFACE=eth1
    PUBLIC_INTERFACE=eth2


Step 4: Run `./install-devstack-xen.sh` on your remote linux client
...................................................................
An example::
  # Create a passwordless ssh key
  ssh-keygen -t rsa -N "" -f devstack_key.priv
  # Install devstack
  ./install-devstack-xen.sh XENSERVER mypassword devstack_key.priv

If you don't select wait till launch (using "-w 0" option), once this script finishes executing,
login the VM (DevstackOSDomU) that it installed and tail the /opt/stack/devstack_logs/stack.log
file. You will need to wait until it stack.log has finished executing.

Appendix
________

This section contains useful information for using specific ubuntu network mirrors, which may
be required for specific environments to resolve specific access or performance issues.  As these
are advanced options, the "install-devstack-xen" approach does not support them.  If you wish to use
these options, please follow the approach outlined above which involves manually downloading
os-xenapi and configuring local.conf (or xenrc in the below cases)

Using a specific Ubuntu mirror for installation
...............................................
To speed up the Ubuntu installation, you can use a specific mirror. To specify
a mirror explicitly, include the following settings in your `xenrc` file:

sample code::

    UBUNTU_INST_HTTP_HOSTNAME="archive.ubuntu.com"
    UBUNTU_INST_HTTP_DIRECTORY="/ubuntu"

These variables set the `mirror/http/hostname` and `mirror/http/directory`
settings in the ubuntu preseed file. The minimal ubuntu VM will use the
specified parameters.

Use an http proxy to speed up Ubuntu installation
.................................................

To further speed up the Ubuntu VM and package installation, an internal http
proxy could be used. `squid-deb-proxy` has proven to be stable. To use an http
proxy, specify the following in your `xenrc` file:

sample code::

    UBUNTU_INST_HTTP_PROXY="http://ubuntu-proxy.somedomain.com:8000"

Exporting the Ubuntu VM to an XVA
*********************************

Assuming you have an nfs export, `TEMPLATE_NFS_DIR`, the following sample code will export the jeos
(just enough OS) template to an XVA that can be re-imported at a later date.

sample code::

    TEMPLATE_FILENAME=devstack-jeos.xva
    TEMPLATE_NAME=jeos_template_for_ubuntu
    mountdir=$(mktemp -d)
    mount -t nfs "$TEMPLATE_NFS_DIR" "$mountdir"
    VM="$(xe template-list name-label="$TEMPLATE_NAME" --minimal)"
    xe template-export template-uuid=$VM filename="$mountdir/$TEMPLATE_FILENAME"
    umount "$mountdir"
    rm -rf "$mountdir"

Import the Ubuntu VM
********************

Given you have an nfs export `TEMPLATE_NFS_DIR` where you exported the Ubuntu
VM as `TEMPLATE_FILENAME`:

sample code::

    mountdir=$(mktemp -d)
    mount -t nfs "$TEMPLATE_NFS_DIR" "$mountdir"
    xe vm-import filename="$mountdir/$TEMPLATE_FILENAME"
    umount "$mountdir"
    rm -rf "$mountdir"