summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-nova/nova-init
diff options
context:
space:
mode:
authorMark Asselstine <mark.asselstine@windriver.com>2018-04-04 16:02:56 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2018-04-09 10:48:37 -0400
commite7b4a0b965bb40861a487c13199755044919472a (patch)
tree740373e9594abbadd846279582c596cc9e2607dd /meta-openstack/recipes-devtools/python/python-nova/nova-init
parentc87a3d517bd49b1e915ba9bb3f20bfc86d239dbc (diff)
downloadmeta-cloud-services-e7b4a0b965bb40861a487c13199755044919472a.tar.gz
python-nova: uprev to latest openstack sable/pike release
This requires several new recipes and package uprevs (python-tooz, python-os-brick, python-pypowervm, python-networkx, python-microversion-parse, python-os-win, python-os-vif, and python-os-traits). Along with updates to make things work with systemd. We also take steps to make setup/init use the directions from https://docs.openstack.org/nova/pike/install/controller-install-ubuntu.html After these changes we can validate that nova is operating nominally using the command: +-------+--------------------------------------+ | Name | UUID | +-------+--------------------------------------+ | cell0 | 00000000-0000-0000-0000-000000000000 | | cell1 | f547fa04-7c82-4498-95ee-210fc40abdb6 | +-------+--------------------------------------+ Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-nova/nova-init')
-rw-r--r--meta-openstack/recipes-devtools/python/python-nova/nova-init75
1 files changed, 75 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-nova/nova-init b/meta-openstack/recipes-devtools/python/python-nova/nova-init
new file mode 100644
index 0000000..5faa7d6
--- /dev/null
+++ b/meta-openstack/recipes-devtools/python/python-nova/nova-init
@@ -0,0 +1,75 @@
1#!/bin/bash
2#
3# Basic nova setup based on:
4# https://docs.openstack.org/nova/pike/install/controller-install-ubuntu.html
5#
6# Prerequisites: keystone must be available and bootstrapped
7#
8
9# Substitutions setup at do_intall()
10DB_USER=%DB_USER%
11NOVA_USER=%NOVA_USER%
12NOVA_GROUP=%NOVA_GROUP%
13CONTROLLER_IP=%CONTROLLER_IP%
14ADMIN_USER=%ADMIN_USER%
15ADMIN_PASSWORD=%ADMIN_PASSWORD%
16ADMIN_ROLE=%ADMIN_ROLE%
17SYSCONFDIR=%SYSCONFDIR%
18PLACEMENT_USER=%PLACEMENT_USER%
19
20# sudo -u postgres createdb nova
21# sleep 2
22# nova-manage db sync
23
24# Create the neutron DB and grant the necessary permissions
25sudo -u postgres psql -c "CREATE DATABASE \"nova-api\"" 2> /dev/null
26sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE \"nova-api\" TO ${DB_USER}" 2> /dev/null
27
28sudo -u postgres psql -c "CREATE DATABASE nova" 2> /dev/null
29sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE nova TO ${DB_USER}" 2> /dev/null
30
31sudo -u postgres psql -c "CREATE DATABASE \"nova-cell0\"" 2> /dev/null
32sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE \"nova-cell0\" TO ${DB_USER}" 2> /dev/null
33
34source ${SYSCONFDIR}/keystone/admin-openrc
35
36openstack user create --domain default --password ${ADMIN_PASSWORD} ${NOVA_USER}
37
38# Ensure the 'service' project exists
39openstack project show service > /dev/null 2>&1
40if [ $? -ne 0 ]; then
41 openstack project create service --domain default
42fi
43openstack role add --project service --user ${NOVA_USER} ${ADMIN_ROLE}
44
45# Create nova service and service endpoints
46openstack service create --name nova --description "OpenStack Compute" compute
47openstack endpoint create --region RegionOne compute public http://${CONTROLLER_IP}:8774
48openstack endpoint create --region RegionOne compute internal http://${CONTROLLER_IP}:8774
49openstack endpoint create --region RegionOne compute admin http://${CONTROLLER_IP}:8774
50
51# Create placement service, role, and endpoints.
52openstack user create --domain default --password ${ADMIN_PASSWORD} ${PLACEMENT_USER}
53openstack role add --project service --user ${PLACEMENT_USER} ${ADMIN_ROLE}
54openstack service create --name placement --description "Placement API" placement
55openstack endpoint create --region RegionOne placement public http://${CONTROLLER_IP}:8778
56openstack endpoint create --region RegionOne placement internal http://${CONTROLLER_IP}:8778
57openstack endpoint create --region RegionOne placement admin http://${CONTROLLER_IP}:8778
58
59sudo -u ${NOVA_USER} nova-manage api_db sync
60sudo -u ${NOVA_USER} nova-manage cell_v2 map_cell0
61sudo -u ${NOVA_USER} nova-manage cell_v2 create_cell --name=cell1 --verbose
62sudo -u ${NOVA_USER} nova-manage db sync
63
64# Enable and start the nova services
65systemctl enable nova-api
66systemctl enable nova-consoleauth
67systemctl enable nova-scheduler
68systemctl enable nova-conductor
69systemctl enable nova-novncproxy
70
71systemctl start nova-api
72systemctl start nova-consoleauth
73systemctl start nova-scheduler
74systemctl start nova-conductor
75systemctl start nova-novncproxy