summaryrefslogtreecommitdiffstats
path: root/docs/configguide/featureconfig.rst
blob: 1b3dd5aee7e7ccced5667020af1a59c500207d0f (plain)
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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
Copper configuration
====================
This release focused on use of the OpenStack Congress service for managing
configuration policy. The Congress install procedure described here is largely
manual. This procedure, as well as the longer-term goal of automated installer
support, is a work in progress. The procedure is further specific to one OPNFV
installer (JOID, i.e. MAAS/JuJu) based environment. Support for other OPNFV
installer deployed environments is also a work in progress.

Pre-configuration activities
----------------------------
This procedure assumes OPNFV has been installed via the JOID installer.

Hardware configuration
----------------------
There is no specific hardware configuration required for the Copper project.

Feature configuration
---------------------
Following are instructions for installing Congress on an Ubuntu 14.04 LXC
container in the OPNFV Controller node, as installed by the JOID installer.
This guide uses instructions from the `Congress intro guide on readthedocs <http://congress.readthedocs.org/en/latest/readme.html#installing-congress|Congress>`_.
Specific values below will need to be modified if you intend to repeat this
procedure in your JOID-based install environment.

Install base VM for congress on controller node
...............................................

.. code::

  sudo juju ssh ubuntu@192.168.10.21

Clone the container
...................

.. code::

  sudo lxc-clone -o juju-trusty-lxc-template -n juju-trusty-congress

Start the container
...................

.. code::

  sudo lxc-start -n juju-trusty-congress -d

Get the container IP address
............................

.. code::

  sudo lxc-info -n juju-trusty-congress

If you need to start over
.........................

.. code::

  sudo lxc-destroy --name juju-trusty-congress

Exit from controller (back to jumphost) and login to congress container
.......................................................................

.. code::

  sudo juju ssh ubuntu@192.168.10.117

Update package repos
....................

.. code::

  sudo apt-get update

Setup environment variables
...........................

.. code::

  export CONGRESS_HOST=192.168.10.106
  export KEYSTONE_HOST=192.168.10.119
  export CEILOMETER_HOST=192.168.10.116
  export CINDER_HOST=192.168.10.117
  export GLANCE_HOST=192.168.10.118
  export NEUTRON_HOST=192.168.10.125
  export NOVA_HOST=192.168.10.121

Install pip
...........

.. code::

  sudo apt-get install python-pip -y

Install java
............

.. code::

  sudo apt-get install default-jre -y

Install other dependencies
..........................

.. code::

  # when prompted, set and remember mysql root user password
  sudo apt-get install git gcc python-dev libxml2 libxslt1-dev libzip-dev \
  mysql-server python-mysqldb -y
  sudo pip install virtualenv

Clone congress
..............

.. code::

  git clone https://github.com/openstack/congress.git
  cd congress
  git checkout stable/liberty

Create virtualenv
.................

.. code::

  virtualenv ~/congress
  source bin/activate

Setup Congress
..............

.. code::

  sudo mkdir -p /etc/congress
  sudo mkdir -p /etc/congress/snapshot
  sudo mkdir /var/log/congress
  sudo chown ubuntu /var/log/congress
  sudo cp etc/api-paste.ini /etc/congress
  sudo cp etc/policy.json /etc/congress

Install requirements.txt and tox dependencies
.............................................

The need for this stepo was detected by errors during "tox -egenconfig".

.. code::

  sudo apt-get install libffi-dev -y
  sudo apt-get install openssl -y
  sudo apt-get install libssl-dev -y

Install dependencies in virtualenv
..................................

.. code::

  pip install -r requirements.txt
  python setup.py install

Install tox
...........

.. code::

  pip install tox

Generate congress.conf.sample
.............................

.. code::

  tox -egenconfig

Edit congress.conf.sample as needed
...................................

.. code::

  sed -i -- 's/#verbose = true/verbose = true/g' etc/congress.conf.sample
  sed -i -- 's/#log_file = <None>/log_file = congress.log/g' \
  etc/congress.conf.sample
  sed -i -- 's/#log_dir = <None>/log_dir = \/var\/log\/congress/g' \
  etc/congress.conf.sample
  sed -i -- 's/#bind_host = 0.0.0.0/bind_host = 192.168.10.117/g' \
  etc/congress.conf.sample
  sed -i -- 's/#policy_path = <None>/policy_path = \
  \/etc\/congress\/snapshot/g' etc/congress.conf.sample
  sed -i -- 's/#auth_strategy = keystone/auth_strategy = noauth/g' \
  etc/congress.conf.sample
  sed -i -- 's/#drivers =/drivers =\
  congress.datasources.neutronv2_driver.NeutronV2Driver,\
  congress.datasources.glancev2_driver.GlanceV2Driver,\
  congress.datasources.nova_driver.NovaDriver,\
  congress.datasources.keystone_driver.KeystoneDriver,\
  congress.datasources.ceilometer_driver.CeilometerDriver,\
  congress.datasources.cinder_driver.CinderDriver/g' etc/congress.conf.sample
  sed -i -- 's/#auth_host = 127.0.0.1/auth_host = 192.168.10.108/g' \
  etc/congress.conf.sample
  sed -i -- 's/#auth_port = 35357/auth_port = 35357/g' etc/congress.conf.sample
  sed -i -- 's/#auth_protocol = https/auth_protocol = http/g' \
  etc/congress.conf.sample
  sed -i -- 's/#admin_tenant_name = admin/admin_tenant_name = admin/g' \
  etc/congress.conf.sample
  sed -i -- 's/#admin_user = <None>/admin_user = congress/g' \
  etc/congress.conf.sample
  sed -i -- 's/#admin_password = <None>/admin_password = congress/g' \
  etc/congress.conf.sample
  sed -i -- 's/#connection = <None>/connection = mysql:\/\/ubuntu:\
  <mysql password>@localhost:3306\/congress/g' etc/congress.conf.sample

Copy congress.conf.sample to /etc/congress
..........................................

.. code::

  sudo cp etc/congress.conf.sample /etc/congress/congress.conf

Create congress database
........................

.. code::

  sudo mysql -u root -p
  CREATE DATABASE congress;
  GRANT ALL PRIVILEGES ON congress.* TO 'ubuntu'@'localhost' \
  IDENTIFIED BY '<mysql password>';
  GRANT ALL PRIVILEGES ON congress.* TO 'ubuntu'@'%' IDENTIFIED \
  BY '<mysql password>';
  exit

Install congress-db-manage dependencies
.......................................

The need for this step was detected by errors in subsequent steps.

.. code::

  sudo apt-get build-dep python-mysqldb -y
  pip install MySQL-python

Create database schema
......................

.. code::

  congress-db-manage --config-file /etc/congress/congress.conf upgrade head

Install dependencies of OpenStack, Congress, Keystone client operations
.......................................................................

.. code::

  pip install python-openstackclient
  pip install python-congressclient
  pip install python-keystoneclient

Execute admin-openrc.sh as downloaded from Horizon
..................................................

.. code::

  source ~/admin-openrc.sh

Setup Congress user
...................

TODO: needs update in `Congress intro in readthedocs < http://congress.readthedocs.org/en/latest/readme.html#installing-congress>`_.

.. code::

  pip install cliff --upgrade
  export ADMIN_ROLE=$(openstack role list | \
  awk "/ Admin / { print \$2 }")
  export SERVICE_TENANT=$(openstack project list | \
  awk "/ admin / { print \$2 }")
  openstack user create --password congress --project admin \
  --email "congress@example.com" congress
  export CONGRESS_USER=$(openstack user list | \
  awk "/ congress / { print \$2 }")
  openstack role add $ADMIN_ROLE --user $CONGRESS_USER \
  --project $SERVICE_TENANT

Create Congress service
.......................

.. code::

  openstack service create congress --type "policy" \
  --description "Congress Service"
  export CONGRESS_SERVICE=$(openstack service list | \
  awk "/ congress / { print \$2 }")

Create Congress endpoint
........................

.. code::

  openstack endpoint create $CONGRESS_SERVICE \
  --region $OS_REGION_NAME \
  --publicurl http://$CONGRESS_HOST:1789/ \
  --adminurl http://$CONGRESS_HOST:1789/ \
  --internalurl http://$CONGRESS_HOST:1789/

Start the Congress service in the background
............................................

.. code::

  bin/congress-server &
  # disown the process (so it keeps running if you get disconnected)
  disown -h %1

Create data sources
...................

To remove datasources: openstack congress datasource delete <name>

It's probably good to do these commands in a new terminal tab, as the
congress server log from the last command will be flooding your original
terminal screen.

.. code::

  openstack congress datasource create nova "nova" \
  --config username=$OS_USERNAME \
  --config tenant_name=$OS_TENANT_NAME \
  --config password=$OS_PASSWORD \
  --config auth_url=http://$KEYSTONE_HOST:5000/v2.0
  openstack congress datasource create neutronv2 "neutronv2" \
  --config username=$OS_USERNAME \
  --config tenant_name=$OS_TENANT_NAME \
  --config password=$OS_PASSWORD \
  --config auth_url=http://$KEYSTONE_HOST:5000/v2.0
  openstack congress datasource create ceilometer "ceilometer" \
  --config username=$OS_USERNAME \
  --config tenant_name=$OS_TENANT_NAME \
  --config password=$OS_PASSWORD \
  --config auth_url=http://$KEYSTONE_HOST:5000/v2.0
  openstack congress datasource create cinder "cinder" \
  --config username=$OS_USERNAME \
  --config tenant_name=$OS_TENANT_NAME \
  --config password=$OS_PASSWORD \
  --config auth_url=http://$KEYSTONE_HOST:5000/v2.0
  openstack congress datasource create glancev2 "glancev2" \
  --config username=$OS_USERNAME \
  --config tenant_name=$OS_TENANT_NAME \
  --config password=$OS_PASSWORD \
  --config auth_url=http://$KEYSTONE_HOST:5000/v2.0
  openstack congress datasource create keystone "keystone" \
  --config username=$OS_USERNAME \
  --config tenant_name=$OS_TENANT_NAME \
  --config password=$OS_PASSWORD \
  --config auth_url=http://$KEYSTONE_HOST:5000/v2.0

Run Congress Tempest Tests
..........................

.. code::

  tox -epy27

Restarting after server power loss etc
......................................

Currently this install procedure is manual. Automated install and restoral
after host recovery is TBD. For now, this procedure will get the Congress
service running again.

.. code::

  # On jumphost, SSH to Congress server
  sudo juju ssh ubuntu@192.168.10.117
  # If that fails
    # On jumphost, SSH to controller node
    sudo juju ssh ubuntu@192.168.10.119
    # Start the Congress container
    sudo lxc-start -n juju-trusty-congress -d
    # Verify the Congress container status
    sudo lxc-ls -f juju-trusty-congress
    NAME                  STATE    IPV4            IPV6  GROUPS  AUTOSTART
    ----------------------------------------------------------------------
    juju-trusty-congress  RUNNING  192.168.10.117  -     -       NO
    # exit back to the Jumphost, wait a minute, and go back to the \
    "SSH to Congress server" step above
  # On the Congress server that you have logged into
  source ~/admin-openrc.sh
  cd congress
  source bin/activate
  bin/congress-server &
  disown -h  %1