| Dean Troyer | 0986a7b | 2014-10-29 22:08:13 -0500 | [diff] [blame] | 1 | ============== | 
|  | 2 | Multi-Node Lab | 
|  | 3 | ============== | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 4 |  | 
|  | 5 | Here is OpenStack in a realistic test configuration with multiple | 
|  | 6 | physical servers. | 
|  | 7 |  | 
|  | 8 | Prerequisites Linux & Network | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 9 | ============================= | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 10 |  | 
|  | 11 | Minimal Install | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 12 | --------------- | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 13 |  | 
|  | 14 | You need to have a system with a fresh install of Linux. You can | 
|  | 15 | download the `Minimal | 
|  | 16 | CD <https://help.ubuntu.com/community/Installation/MinimalCD>`__ for | 
|  | 17 | Ubuntu releases since DevStack will download & install all the | 
|  | 18 | additional dependencies. The netinstall ISO is available for | 
| Dean Troyer | ea3cdfa | 2014-11-08 08:29:16 -0600 | [diff] [blame] | 19 | `Fedora <http://mirrors.kernel.org/fedora/releases/>`__ | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 20 | and | 
| Dean Troyer | ea3cdfa | 2014-11-08 08:29:16 -0600 | [diff] [blame] | 21 | `CentOS/RHEL <http://mirrors.kernel.org/centos/>`__. | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 22 |  | 
|  | 23 | Install a couple of packages to bootstrap configuration: | 
|  | 24 |  | 
|  | 25 | :: | 
|  | 26 |  | 
|  | 27 | apt-get install -y git sudo || yum install -y git sudo | 
|  | 28 |  | 
|  | 29 | Network Configuration | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 30 | --------------------- | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 31 |  | 
|  | 32 | The first iteration of the lab uses OpenStack's FlatDHCP network | 
|  | 33 | controller so only a single network will be required. It should be on | 
|  | 34 | its own subnet without DHCP; the host IPs and floating IP pool(s) will | 
|  | 35 | come out of this block. This example uses the following: | 
|  | 36 |  | 
|  | 37 | -  Gateway: 192.168.42.1 | 
|  | 38 | -  Physical nodes: 192.168.42.11-192.168.42.99 | 
|  | 39 | -  Floating IPs: 192.168.42.128-192.168.42.254 | 
|  | 40 |  | 
|  | 41 | Configure each node with a static IP. For Ubuntu edit | 
|  | 42 | ``/etc/network/interfaces``: | 
|  | 43 |  | 
|  | 44 | :: | 
|  | 45 |  | 
|  | 46 | auto eth0 | 
|  | 47 | iface eth0 inet static | 
|  | 48 | address 192.168.42.11 | 
|  | 49 | netmask 255.255.255.0 | 
|  | 50 | gateway 192.168.42.1 | 
|  | 51 |  | 
|  | 52 | For Fedora and CentOS/RHEL edit | 
|  | 53 | ``/etc/sysconfig/network-scripts/ifcfg-eth0``: | 
|  | 54 |  | 
|  | 55 | :: | 
|  | 56 |  | 
|  | 57 | BOOTPROTO=static | 
|  | 58 | IPADDR=192.168.42.11 | 
|  | 59 | NETMASK=255.255.255.0 | 
|  | 60 | GATEWAY=192.168.42.1 | 
|  | 61 |  | 
|  | 62 | Installation shake and bake | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 63 | =========================== | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 64 |  | 
|  | 65 | Add the DevStack User | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 66 | --------------------- | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 67 |  | 
|  | 68 | OpenStack runs as a non-root user that has sudo access to root. There is | 
|  | 69 | nothing special about the name, we'll use ``stack`` here. Every node | 
|  | 70 | must use the same name and preferably uid. If you created a user during | 
|  | 71 | the OS install you can use it and give it sudo privileges below. | 
|  | 72 | Otherwise create the stack user: | 
|  | 73 |  | 
|  | 74 | :: | 
|  | 75 |  | 
| David Rabel | 530d90c | 2017-03-22 08:25:26 +0100 | [diff] [blame] | 76 | useradd -s /bin/bash -d /opt/stack -m stack | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 77 |  | 
|  | 78 | This user will be making many changes to your system during installation | 
|  | 79 | and operation so it needs to have sudo privileges to root without a | 
|  | 80 | password: | 
|  | 81 |  | 
|  | 82 | :: | 
|  | 83 |  | 
|  | 84 | echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers | 
|  | 85 |  | 
|  | 86 | From here on use the ``stack`` user. **Logout** and **login** as the | 
|  | 87 | ``stack`` user. | 
|  | 88 |  | 
|  | 89 | Set Up Ssh | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 90 | ---------- | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 91 |  | 
|  | 92 | Set up the stack user on each node with an ssh key for access: | 
|  | 93 |  | 
|  | 94 | :: | 
|  | 95 |  | 
|  | 96 | mkdir ~/.ssh; chmod 700 ~/.ssh | 
|  | 97 | echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCyYjfgyPazTvGpd8OaAvtU2utL8W6gWC4JdRS1J95GhNNfQd657yO6s1AH5KYQWktcE6FO/xNUC2reEXSGC7ezy+sGO1kj9Limv5vrvNHvF1+wts0Cmyx61D2nQw35/Qz8BvpdJANL7VwP/cFI/p3yhvx2lsnjFE3hN8xRB2LtLUopUSVdBwACOVUmH2G+2BWMJDjVINd2DPqRIA4Zhy09KJ3O1Joabr0XpQL0yt/I9x8BVHdAx6l9U0tMg9dj5+tAjZvMAFfye3PJcYwwsfJoFxC8w/SLtqlFX7Ehw++8RtvomvuipLdmWCy+T9hIkl+gHYE4cS3OIqXH7f49jdJf jesse@spacey.local" > ~/.ssh/authorized_keys | 
|  | 98 |  | 
|  | 99 | Download DevStack | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 100 | ----------------- | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 101 |  | 
|  | 102 | Grab the latest version of DevStack: | 
|  | 103 |  | 
|  | 104 | :: | 
|  | 105 |  | 
|  | 106 | git clone https://git.openstack.org/openstack-dev/devstack | 
|  | 107 | cd devstack | 
|  | 108 |  | 
|  | 109 | Up to this point all of the steps apply to each node in the cluster. | 
|  | 110 | From here on there are some differences between the cluster controller | 
|  | 111 | (aka 'head node') and the compute nodes. | 
|  | 112 |  | 
|  | 113 | Configure Cluster Controller | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 114 | ---------------------------- | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 115 |  | 
|  | 116 | The cluster controller runs all OpenStack services. Configure the | 
|  | 117 | cluster controller's DevStack in ``local.conf``: | 
|  | 118 |  | 
|  | 119 | :: | 
|  | 120 |  | 
|  | 121 | [[local|localrc]] | 
|  | 122 | HOST_IP=192.168.42.11 | 
|  | 123 | FLAT_INTERFACE=eth0 | 
|  | 124 | FIXED_RANGE=10.4.128.0/20 | 
|  | 125 | FIXED_NETWORK_SIZE=4096 | 
|  | 126 | FLOATING_RANGE=192.168.42.128/25 | 
|  | 127 | MULTI_HOST=1 | 
|  | 128 | LOGFILE=/opt/stack/logs/stack.sh.log | 
|  | 129 | ADMIN_PASSWORD=labstack | 
| Swapnil (coolsvap) Kulkarni | c988bf6 | 2015-10-08 13:10:43 +0530 | [diff] [blame] | 130 | DATABASE_PASSWORD=supersecret | 
| Balagopal | 7ed812c | 2016-03-01 04:43:31 +0000 | [diff] [blame] | 131 | RABBIT_PASSWORD=supersecret | 
|  | 132 | SERVICE_PASSWORD=supersecret | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 133 |  | 
|  | 134 | In the multi-node configuration the first 10 or so IPs in the private | 
|  | 135 | subnet are usually reserved. Add this to ``local.sh`` to have it run | 
|  | 136 | after every ``stack.sh`` run: | 
|  | 137 |  | 
|  | 138 | :: | 
|  | 139 |  | 
|  | 140 | for i in `seq 2 10`; do /opt/stack/nova/bin/nova-manage fixed reserve 10.4.128.$i; done | 
|  | 141 |  | 
|  | 142 | Fire up OpenStack: | 
|  | 143 |  | 
|  | 144 | :: | 
|  | 145 |  | 
|  | 146 | ./stack.sh | 
|  | 147 |  | 
|  | 148 | A stream of activity ensues. When complete you will see a summary of | 
|  | 149 | ``stack.sh``'s work, including the relevant URLs, accounts and passwords | 
|  | 150 | to poke at your shiny new OpenStack. The most recent log file is | 
|  | 151 | available in ``stack.sh.log``. | 
|  | 152 |  | 
|  | 153 | Configure Compute Nodes | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 154 | ----------------------- | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 155 |  | 
|  | 156 | The compute nodes only run the OpenStack worker services. For additional | 
|  | 157 | machines, create a ``local.conf`` with: | 
|  | 158 |  | 
|  | 159 | :: | 
|  | 160 |  | 
| Kashyap Kopparam | cd1c3c7 | 2014-10-31 17:32:57 +0530 | [diff] [blame] | 161 | [[local|localrc]] | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 162 | HOST_IP=192.168.42.12 # change this per compute node | 
|  | 163 | FLAT_INTERFACE=eth0 | 
|  | 164 | FIXED_RANGE=10.4.128.0/20 | 
|  | 165 | FIXED_NETWORK_SIZE=4096 | 
|  | 166 | FLOATING_RANGE=192.168.42.128/25 | 
|  | 167 | MULTI_HOST=1 | 
|  | 168 | LOGFILE=/opt/stack/logs/stack.sh.log | 
|  | 169 | ADMIN_PASSWORD=labstack | 
| Swapnil (coolsvap) Kulkarni | c988bf6 | 2015-10-08 13:10:43 +0530 | [diff] [blame] | 170 | DATABASE_PASSWORD=supersecret | 
| Balagopal | 7ed812c | 2016-03-01 04:43:31 +0000 | [diff] [blame] | 171 | RABBIT_PASSWORD=supersecret | 
|  | 172 | SERVICE_PASSWORD=supersecret | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 173 | DATABASE_TYPE=mysql | 
|  | 174 | SERVICE_HOST=192.168.42.11 | 
| Masaki Matsushita | 597c902 | 2015-08-15 11:35:20 +0900 | [diff] [blame] | 175 | MYSQL_HOST=$SERVICE_HOST | 
|  | 176 | RABBIT_HOST=$SERVICE_HOST | 
|  | 177 | GLANCE_HOSTPORT=$SERVICE_HOST:9292 | 
| Prabhuraj Kamaraj | 921da26 | 2017-04-18 05:11:52 +0000 | [diff] [blame] | 178 | ENABLED_SERVICES=n-cpu,q-agt,n-api-meta,c-vol,placement-client | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 179 | NOVA_VNC_ENABLED=True | 
| Masaki Matsushita | 597c902 | 2015-08-15 11:35:20 +0900 | [diff] [blame] | 180 | NOVNCPROXY_URL="http://$SERVICE_HOST:6080/vnc_auto.html" | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 181 | VNCSERVER_LISTEN=$HOST_IP | 
|  | 182 | VNCSERVER_PROXYCLIENT_ADDRESS=$VNCSERVER_LISTEN | 
|  | 183 |  | 
| Sean Dague | a6db5e3 | 2015-08-04 06:23:28 -0400 | [diff] [blame] | 184 | **Note:** the ``n-api-meta`` service is a version of the api server | 
|  | 185 | that only serves the metadata service. It's needed because the | 
|  | 186 | computes created won't have a routing path to the metadata service on | 
|  | 187 | the controller. | 
|  | 188 |  | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 189 | Fire up OpenStack: | 
|  | 190 |  | 
|  | 191 | :: | 
|  | 192 |  | 
|  | 193 | ./stack.sh | 
|  | 194 |  | 
|  | 195 | A stream of activity ensues. When complete you will see a summary of | 
|  | 196 | ``stack.sh``'s work, including the relevant URLs, accounts and passwords | 
|  | 197 | to poke at your shiny new OpenStack. The most recent log file is | 
|  | 198 | available in ``stack.sh.log``. | 
|  | 199 |  | 
| Matt Riedemann | c63ecad | 2017-07-25 17:08:50 -0400 | [diff] [blame] | 200 | Starting in the Ocata release, Nova requires a `Cells v2`_ deployment. Compute | 
|  | 201 | node services must be mapped to a cell before they can be used. | 
|  | 202 |  | 
|  | 203 | After each compute node is stacked, verify it shows up in the | 
|  | 204 | ``nova service-list --binary nova-compute`` output. The compute service is | 
|  | 205 | registered in the cell database asynchronously so this may require polling. | 
|  | 206 |  | 
|  | 207 | Once the compute node services shows up, run the ``./tools/discover_hosts.sh`` | 
|  | 208 | script from the control node to map compute hosts to the single cell. | 
|  | 209 |  | 
|  | 210 | The compute service running on the primary control node will be | 
|  | 211 | discovered automatically when the control node is stacked so this really | 
|  | 212 | only needs to be performed for subnodes. | 
|  | 213 |  | 
|  | 214 | .. _Cells v2: https://docs.openstack.org/nova/latest/user/cells.html | 
|  | 215 |  | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 216 | Cleaning Up After DevStack | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 217 | -------------------------- | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 218 |  | 
|  | 219 | Shutting down OpenStack is now as simple as running the included | 
|  | 220 | ``unstack.sh`` script: | 
|  | 221 |  | 
|  | 222 | :: | 
|  | 223 |  | 
|  | 224 | ./unstack.sh | 
|  | 225 |  | 
|  | 226 | A more aggressive cleanup can be performed using ``clean.sh``. It | 
|  | 227 | removes certain troublesome packages and attempts to leave the system in | 
|  | 228 | a state where changing the database or queue manager can be reliably | 
|  | 229 | performed. | 
|  | 230 |  | 
|  | 231 | :: | 
|  | 232 |  | 
|  | 233 | ./clean.sh | 
|  | 234 |  | 
|  | 235 | Sometimes running instances are not cleaned up. DevStack attempts to do | 
|  | 236 | this when it runs but there are times it needs to still be done by hand: | 
|  | 237 |  | 
|  | 238 | :: | 
|  | 239 |  | 
|  | 240 | sudo rm -rf /etc/libvirt/qemu/inst* | 
|  | 241 | sudo virsh list | grep inst | awk '{print $1}' | xargs -n1 virsh destroy | 
|  | 242 |  | 
|  | 243 | Options pimp your stack | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 244 | ======================= | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 245 |  | 
|  | 246 | Additional Users | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 247 | ---------------- | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 248 |  | 
|  | 249 | DevStack creates two OpenStack users (``admin`` and ``demo``) and two | 
| Peter Stachowski | 9a80892 | 2015-04-08 19:48:09 +0000 | [diff] [blame] | 250 | projects (also ``admin`` and ``demo``). ``admin`` is exactly what it | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 251 | sounds like, a privileged administrative account that is a member of | 
| Peter Stachowski | 9a80892 | 2015-04-08 19:48:09 +0000 | [diff] [blame] | 252 | both the ``admin`` and ``demo`` projects. ``demo`` is a normal user | 
|  | 253 | account that is only a member of the ``demo`` project. Creating | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 254 | additional OpenStack users can be done through the dashboard, sometimes | 
|  | 255 | it is easier to do them in bulk from a script, especially since they get | 
|  | 256 | blown away every time ``stack.sh`` runs. The following steps are ripe | 
|  | 257 | for scripting: | 
|  | 258 |  | 
|  | 259 | :: | 
|  | 260 |  | 
|  | 261 | # Get admin creds | 
|  | 262 | . openrc admin admin | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 263 |  | 
| Peter Stachowski | 9a80892 | 2015-04-08 19:48:09 +0000 | [diff] [blame] | 264 | # List existing projects | 
|  | 265 | openstack project list | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 266 |  | 
|  | 267 | # List existing users | 
| Peter Stachowski | 9a80892 | 2015-04-08 19:48:09 +0000 | [diff] [blame] | 268 | openstack user list | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 269 |  | 
| Peter Stachowski | 9a80892 | 2015-04-08 19:48:09 +0000 | [diff] [blame] | 270 | # Add a user and project | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 271 | NAME=bob | 
| Balagopal | 7ed812c | 2016-03-01 04:43:31 +0000 | [diff] [blame] | 272 | PASSWORD=BigSecret | 
| Peter Stachowski | 9a80892 | 2015-04-08 19:48:09 +0000 | [diff] [blame] | 273 | PROJECT=$NAME | 
|  | 274 | openstack project create $PROJECT | 
|  | 275 | openstack user create $NAME --password=$PASSWORD --project $PROJECT | 
|  | 276 | openstack role add Member --user $NAME --project $PROJECT | 
|  | 277 | # The Member role is created by stack.sh | 
| Mike Perez | c271b3e | 2016-10-03 16:00:33 -0700 | [diff] [blame] | 278 | # openstack role assignment list | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 279 |  | 
|  | 280 | Swift | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 281 | ----- | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 282 |  | 
| Shilla Saebi | 2ed09d8 | 2015-04-21 15:02:13 -0400 | [diff] [blame] | 283 | Swift, OpenStack Object Storage, requires a significant amount of resources | 
| Sean Dague | a6db5e3 | 2015-08-04 06:23:28 -0400 | [diff] [blame] | 284 | and is disabled by default in DevStack. The support in DevStack is geared | 
| Shilla Saebi | 2ed09d8 | 2015-04-21 15:02:13 -0400 | [diff] [blame] | 285 | toward a minimal installation but can be used for testing. To implement a | 
|  | 286 | true multi-node test of swift, additional steps will be required. Enabling it is as | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 287 | simple as enabling the ``swift`` service in ``local.conf``: | 
|  | 288 |  | 
|  | 289 | :: | 
|  | 290 |  | 
|  | 291 | enable_service s-proxy s-object s-container s-account | 
|  | 292 |  | 
| Shilla Saebi | 2ed09d8 | 2015-04-21 15:02:13 -0400 | [diff] [blame] | 293 | Swift, OpenStack Object Storage, will put its data files in ``SWIFT_DATA_DIR`` (default | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 294 | ``/opt/stack/data/swift``). The size of the data 'partition' created | 
|  | 295 | (really a loop-mounted file) is set by ``SWIFT_LOOPBACK_DISK_SIZE``. The | 
| JordanP | a6dfe81 | 2014-11-20 18:06:23 +0100 | [diff] [blame] | 296 | Swift config files are located in ``SWIFT_CONF_DIR`` (default | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 297 | ``/etc/swift``). All of these settings can be overridden in (wait for | 
|  | 298 | it...) ``local.conf``. | 
|  | 299 |  | 
|  | 300 | Volumes | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 301 | ------- | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 302 |  | 
|  | 303 | DevStack will automatically use an existing LVM volume group named | 
|  | 304 | ``stack-volumes`` to store cloud-created volumes. If ``stack-volumes`` | 
| Dean Troyer | ea3cdfa | 2014-11-08 08:29:16 -0600 | [diff] [blame] | 305 | doesn't exist, DevStack will set up a 10Gb loop-mounted file to contain | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 306 | it. This obviously limits the number and size of volumes that can be | 
|  | 307 | created inside OpenStack. The size can be overridden by setting | 
|  | 308 | ``VOLUME_BACKING_FILE_SIZE`` in ``local.conf``. | 
|  | 309 |  | 
|  | 310 | ``stack-volumes`` can be pre-created on any physical volume supported by | 
|  | 311 | Linux's LVM. The name of the volume group can be changed by setting | 
| Jordan Pittier | f5069f3 | 2016-11-08 12:10:12 +0100 | [diff] [blame] | 312 | ``VOLUME_GROUP_NAME`` in ``localrc``. ``stack.sh`` deletes all logical | 
|  | 313 | volumes in ``VOLUME_GROUP_NAME`` that begin with ``VOLUME_NAME_PREFIX`` as | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 314 | part of cleaning up from previous runs. It is recommended to not use the | 
| Jordan Pittier | f5069f3 | 2016-11-08 12:10:12 +0100 | [diff] [blame] | 315 | root volume group as ``VOLUME_GROUP_NAME``. | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 316 |  | 
|  | 317 | The details of creating the volume group depends on the server hardware | 
|  | 318 | involved but looks something like this: | 
|  | 319 |  | 
|  | 320 | :: | 
|  | 321 |  | 
|  | 322 | pvcreate /dev/sdc | 
|  | 323 | vgcreate stack-volumes /dev/sdc | 
|  | 324 |  | 
|  | 325 | Syslog | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 326 | ------ | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 327 |  | 
|  | 328 | DevStack is capable of using ``rsyslog`` to aggregate logging across the | 
|  | 329 | cluster. It is off by default; to turn it on set ``SYSLOG=True`` in | 
|  | 330 | ``local.conf``. ``SYSLOG_HOST`` defaults to ``HOST_IP``; on the compute | 
|  | 331 | nodes it must be set to the IP of the cluster controller to send syslog | 
|  | 332 | output there. In the example above, add this to the compute node | 
|  | 333 | ``local.conf``: | 
|  | 334 |  | 
|  | 335 | :: | 
|  | 336 |  | 
|  | 337 | SYSLOG_HOST=192.168.42.11 | 
|  | 338 |  | 
|  | 339 | Using Alternate Repositories/Branches | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 340 | ------------------------------------- | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 341 |  | 
|  | 342 | The git repositories for all of the OpenStack services are defined in | 
|  | 343 | ``stackrc``. Since this file is a part of the DevStack package changes | 
|  | 344 | to it will probably be overwritten as updates are applied. Every setting | 
|  | 345 | in ``stackrc`` can be redefined in ``local.conf``. | 
|  | 346 |  | 
|  | 347 | To change the repository or branch that a particular OpenStack service | 
|  | 348 | is created from, simply change the value of ``*_REPO`` or ``*_BRANCH`` | 
|  | 349 | corresponding to that service. | 
|  | 350 |  | 
|  | 351 | After making changes to the repository or branch, if ``RECLONE`` is not | 
|  | 352 | set in ``localrc`` it may be necessary to remove the corresponding | 
|  | 353 | directory from ``/opt/stack`` to force git to re-clone the repository. | 
|  | 354 |  | 
| Shilla Saebi | 2ed09d8 | 2015-04-21 15:02:13 -0400 | [diff] [blame] | 355 | For example, to pull nova, OpenStack Compute, from a proposed release candidate | 
|  | 356 | in the primary nova repository: | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 357 |  | 
|  | 358 | :: | 
|  | 359 |  | 
|  | 360 | NOVA_BRANCH=rc-proposed | 
|  | 361 |  | 
| Shilla Saebi | 2ed09d8 | 2015-04-21 15:02:13 -0400 | [diff] [blame] | 362 | To pull glance, OpenStack Image service, from an experimental fork: | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 363 |  | 
|  | 364 | :: | 
|  | 365 |  | 
|  | 366 | GLANCE_BRANCH=try-something-big | 
|  | 367 | GLANCE_REPO=https://github.com/mcuser/glance.git | 
|  | 368 |  | 
|  | 369 | Notes stuff you might need to know | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 370 | ================================== | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 371 |  | 
|  | 372 | Reset the Bridge | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 373 | ---------------- | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 374 |  | 
|  | 375 | How to reset the bridge configuration: | 
|  | 376 |  | 
|  | 377 | :: | 
|  | 378 |  | 
|  | 379 | sudo brctl delif br100 eth0.926 | 
|  | 380 | sudo ip link set dev br100 down | 
|  | 381 | sudo brctl delbr br100 | 
|  | 382 |  | 
|  | 383 | Set MySQL Password | 
| Sean Dague | 3293046 | 2014-11-18 06:51:16 -0500 | [diff] [blame] | 384 | ------------------ | 
| Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 385 |  | 
|  | 386 | If you forgot to set the root password you can do this: | 
|  | 387 |  | 
|  | 388 | :: | 
|  | 389 |  | 
|  | 390 | mysqladmin -u root -pnova password 'supersecret' | 
| Zhenzan Zhou | e1f8796 | 2015-09-08 16:49:52 +0800 | [diff] [blame] | 391 |  | 
|  | 392 | Live Migration | 
|  | 393 | -------------- | 
|  | 394 |  | 
|  | 395 | In order for live migration to work with the default live migration URI:: | 
|  | 396 |  | 
|  | 397 | [libvirt] | 
|  | 398 | live_migration_uri = qemu+ssh://stack@%s/system | 
|  | 399 |  | 
|  | 400 | SSH keys need to be exchanged between each compute node: | 
|  | 401 |  | 
|  | 402 | 1. The SOURCE root user's public RSA key (likely in /root/.ssh/id_rsa.pub) | 
|  | 403 | needs to be in the DESTINATION stack user's authorized_keys file | 
|  | 404 | (~stack/.ssh/authorized_keys).  This can be accomplished by manually | 
|  | 405 | copying the contents from the file on the SOURCE to the DESTINATION.  If | 
|  | 406 | you have a password configured for the stack user, then you can use the | 
|  | 407 | following command to accomplish the same thing:: | 
|  | 408 |  | 
|  | 409 | ssh-copy-id -i /root/.ssh/id_rsa.pub stack@DESTINATION | 
|  | 410 |  | 
|  | 411 | 2. The DESTINATION host's public ECDSA key (/etc/ssh/ssh_host_ecdsa_key.pub) | 
|  | 412 | needs to be in the SOURCE root user's known_hosts file | 
|  | 413 | (/root/.ssh/known_hosts).  This can be accomplished by running the | 
|  | 414 | following on the SOURCE machine (hostname must be used):: | 
|  | 415 |  | 
|  | 416 | ssh-keyscan -H DEST_HOSTNAME | sudo tee -a /root/.ssh/known_hosts | 
|  | 417 |  | 
| Hidekazu Nakamura | 541617b | 2016-11-09 15:27:19 +0900 | [diff] [blame] | 418 | 3. Verify that login via ssh works without a password:: | 
|  | 419 |  | 
|  | 420 | ssh -i /root/.ssh/id_rsa.pub stack@DESTINATION | 
|  | 421 |  | 
| Zhenzan Zhou | e1f8796 | 2015-09-08 16:49:52 +0800 | [diff] [blame] | 422 | In essence, this means that every compute node's root user's public RSA key | 
|  | 423 | must exist in every other compute node's stack user's authorized_keys file and | 
|  | 424 | every compute node's public ECDSA key needs to be in every other compute | 
|  | 425 | node's root user's known_hosts file.  Please note that if the root or stack | 
|  | 426 | user does not have a SSH key, one can be generated using:: | 
|  | 427 |  | 
|  | 428 | ssh-keygen -t rsa | 
|  | 429 |  | 
|  | 430 | The above steps are necessary because libvirtd runs as root when the | 
|  | 431 | live_migration_uri uses the "qemu:///system" family of URIs.  For more | 
|  | 432 | information, see the `libvirt documentation`_. | 
|  | 433 |  | 
|  | 434 | .. _libvirt documentation: https://libvirt.org/drvqemu.html#securitydriver |