From e7b4a0b965bb40861a487c13199755044919472a Mon Sep 17 00:00:00 2001 From: Mark Asselstine Date: Wed, 4 Apr 2018 16:02:56 -0400 Subject: 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 Signed-off-by: Bruce Ashfield --- .../recipes-devtools/python/python-nova/nova-init | 75 ++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 meta-openstack/recipes-devtools/python/python-nova/nova-init (limited to 'meta-openstack/recipes-devtools/python/python-nova/nova-init') 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 @@ +#!/bin/bash +# +# Basic nova setup based on: +# https://docs.openstack.org/nova/pike/install/controller-install-ubuntu.html +# +# Prerequisites: keystone must be available and bootstrapped +# + +# Substitutions setup at do_intall() +DB_USER=%DB_USER% +NOVA_USER=%NOVA_USER% +NOVA_GROUP=%NOVA_GROUP% +CONTROLLER_IP=%CONTROLLER_IP% +ADMIN_USER=%ADMIN_USER% +ADMIN_PASSWORD=%ADMIN_PASSWORD% +ADMIN_ROLE=%ADMIN_ROLE% +SYSCONFDIR=%SYSCONFDIR% +PLACEMENT_USER=%PLACEMENT_USER% + +# sudo -u postgres createdb nova +# sleep 2 +# nova-manage db sync + +# Create the neutron DB and grant the necessary permissions +sudo -u postgres psql -c "CREATE DATABASE \"nova-api\"" 2> /dev/null +sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE \"nova-api\" TO ${DB_USER}" 2> /dev/null + +sudo -u postgres psql -c "CREATE DATABASE nova" 2> /dev/null +sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE nova TO ${DB_USER}" 2> /dev/null + +sudo -u postgres psql -c "CREATE DATABASE \"nova-cell0\"" 2> /dev/null +sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE \"nova-cell0\" TO ${DB_USER}" 2> /dev/null + +source ${SYSCONFDIR}/keystone/admin-openrc + +openstack user create --domain default --password ${ADMIN_PASSWORD} ${NOVA_USER} + +# Ensure the 'service' project exists +openstack project show service > /dev/null 2>&1 +if [ $? -ne 0 ]; then + openstack project create service --domain default +fi +openstack role add --project service --user ${NOVA_USER} ${ADMIN_ROLE} + +# Create nova service and service endpoints +openstack service create --name nova --description "OpenStack Compute" compute +openstack endpoint create --region RegionOne compute public http://${CONTROLLER_IP}:8774 +openstack endpoint create --region RegionOne compute internal http://${CONTROLLER_IP}:8774 +openstack endpoint create --region RegionOne compute admin http://${CONTROLLER_IP}:8774 + +# Create placement service, role, and endpoints. +openstack user create --domain default --password ${ADMIN_PASSWORD} ${PLACEMENT_USER} +openstack role add --project service --user ${PLACEMENT_USER} ${ADMIN_ROLE} +openstack service create --name placement --description "Placement API" placement +openstack endpoint create --region RegionOne placement public http://${CONTROLLER_IP}:8778 +openstack endpoint create --region RegionOne placement internal http://${CONTROLLER_IP}:8778 +openstack endpoint create --region RegionOne placement admin http://${CONTROLLER_IP}:8778 + +sudo -u ${NOVA_USER} nova-manage api_db sync +sudo -u ${NOVA_USER} nova-manage cell_v2 map_cell0 +sudo -u ${NOVA_USER} nova-manage cell_v2 create_cell --name=cell1 --verbose +sudo -u ${NOVA_USER} nova-manage db sync + +# Enable and start the nova services +systemctl enable nova-api +systemctl enable nova-consoleauth +systemctl enable nova-scheduler +systemctl enable nova-conductor +systemctl enable nova-novncproxy + +systemctl start nova-api +systemctl start nova-consoleauth +systemctl start nova-scheduler +systemctl start nova-conductor +systemctl start nova-novncproxy -- cgit v1.2.3-54-g00ecf