diff options
| author | Mark Asselstine <mark.asselstine@windriver.com> | 2018-04-04 16:02:56 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2018-04-09 10:48:37 -0400 |
| commit | e7b4a0b965bb40861a487c13199755044919472a (patch) | |
| tree | 740373e9594abbadd846279582c596cc9e2607dd /meta-openstack/recipes-devtools/python/python-nova/nova-init | |
| parent | c87a3d517bd49b1e915ba9bb3f20bfc86d239dbc (diff) | |
| download | meta-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-init | 75 |
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() | ||
| 10 | DB_USER=%DB_USER% | ||
| 11 | NOVA_USER=%NOVA_USER% | ||
| 12 | NOVA_GROUP=%NOVA_GROUP% | ||
| 13 | CONTROLLER_IP=%CONTROLLER_IP% | ||
| 14 | ADMIN_USER=%ADMIN_USER% | ||
| 15 | ADMIN_PASSWORD=%ADMIN_PASSWORD% | ||
| 16 | ADMIN_ROLE=%ADMIN_ROLE% | ||
| 17 | SYSCONFDIR=%SYSCONFDIR% | ||
| 18 | PLACEMENT_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 | ||
| 25 | sudo -u postgres psql -c "CREATE DATABASE \"nova-api\"" 2> /dev/null | ||
| 26 | sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE \"nova-api\" TO ${DB_USER}" 2> /dev/null | ||
| 27 | |||
| 28 | sudo -u postgres psql -c "CREATE DATABASE nova" 2> /dev/null | ||
| 29 | sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE nova TO ${DB_USER}" 2> /dev/null | ||
| 30 | |||
| 31 | sudo -u postgres psql -c "CREATE DATABASE \"nova-cell0\"" 2> /dev/null | ||
| 32 | sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE \"nova-cell0\" TO ${DB_USER}" 2> /dev/null | ||
| 33 | |||
| 34 | source ${SYSCONFDIR}/keystone/admin-openrc | ||
| 35 | |||
| 36 | openstack user create --domain default --password ${ADMIN_PASSWORD} ${NOVA_USER} | ||
| 37 | |||
| 38 | # Ensure the 'service' project exists | ||
| 39 | openstack project show service > /dev/null 2>&1 | ||
| 40 | if [ $? -ne 0 ]; then | ||
| 41 | openstack project create service --domain default | ||
| 42 | fi | ||
| 43 | openstack role add --project service --user ${NOVA_USER} ${ADMIN_ROLE} | ||
| 44 | |||
| 45 | # Create nova service and service endpoints | ||
| 46 | openstack service create --name nova --description "OpenStack Compute" compute | ||
| 47 | openstack endpoint create --region RegionOne compute public http://${CONTROLLER_IP}:8774 | ||
| 48 | openstack endpoint create --region RegionOne compute internal http://${CONTROLLER_IP}:8774 | ||
| 49 | openstack endpoint create --region RegionOne compute admin http://${CONTROLLER_IP}:8774 | ||
| 50 | |||
| 51 | # Create placement service, role, and endpoints. | ||
| 52 | openstack user create --domain default --password ${ADMIN_PASSWORD} ${PLACEMENT_USER} | ||
| 53 | openstack role add --project service --user ${PLACEMENT_USER} ${ADMIN_ROLE} | ||
| 54 | openstack service create --name placement --description "Placement API" placement | ||
| 55 | openstack endpoint create --region RegionOne placement public http://${CONTROLLER_IP}:8778 | ||
| 56 | openstack endpoint create --region RegionOne placement internal http://${CONTROLLER_IP}:8778 | ||
| 57 | openstack endpoint create --region RegionOne placement admin http://${CONTROLLER_IP}:8778 | ||
| 58 | |||
| 59 | sudo -u ${NOVA_USER} nova-manage api_db sync | ||
| 60 | sudo -u ${NOVA_USER} nova-manage cell_v2 map_cell0 | ||
| 61 | sudo -u ${NOVA_USER} nova-manage cell_v2 create_cell --name=cell1 --verbose | ||
| 62 | sudo -u ${NOVA_USER} nova-manage db sync | ||
| 63 | |||
| 64 | # Enable and start the nova services | ||
| 65 | systemctl enable nova-api | ||
| 66 | systemctl enable nova-consoleauth | ||
| 67 | systemctl enable nova-scheduler | ||
| 68 | systemctl enable nova-conductor | ||
| 69 | systemctl enable nova-novncproxy | ||
| 70 | |||
| 71 | systemctl start nova-api | ||
| 72 | systemctl start nova-consoleauth | ||
| 73 | systemctl start nova-scheduler | ||
| 74 | systemctl start nova-conductor | ||
| 75 | systemctl start nova-novncproxy | ||
