From 2b45297df4604b1e325257d681f7345e2c3e104d Mon Sep 17 00:00:00 2001 From: kiran Date: Fri, 14 Jun 2019 12:34:08 +0530 Subject: [PATCH 1/4] changes for openstack queens on ubuntu server 18.04 --- .gitignore | 4 ++++ configure.sh | 4 ++-- install.sh | 31 ++++++++++++++++----------- lib/admin_openrc.sh | 2 +- lib/config-parameters.sh | 10 ++++----- lib/configure-ceilometer.sh | 0 lib/configure-forwarding.sh | 0 lib/configure-glance.sh | 0 lib/configure-heat.sh | 0 lib/configure-horizon.sh | 3 ++- lib/configure-keystone.sh | 6 +++--- lib/configure-neutron.sh | 4 ++-- lib/configure-nova.sh | 2 +- lib/configure-ovs-bridge.sh | 0 lib/configure-packages.sh | 0 lib/configure-qemu.sh | 0 lib/install-config-odl-ovs.sh | 0 lib/install-config-ovs-vxlan.sh | 0 lib/local_settings.py | 0 lib/mysql-secure-installation.sh | 1 + lib/setup-cirros-image.sh | 0 post-config-actions.sh | 0 remove.sh | 0 util/backup-restore-config-files.sh | 0 util/debug-openstack-service.sh | 0 util/detect-nodetype.sh | 0 util/drop-databases.sh | 0 util/install-config-linux-bridge.sh | 0 util/manage-services.sh | 0 util/update-etc-hosts.sh | 4 ++-- util/update-etc-network-interfaces.sh | 0 util/update-ip.sh | 0 32 files changed, 42 insertions(+), 29 deletions(-) create mode 100644 .gitignore mode change 100644 => 100755 configure.sh mode change 100644 => 100755 install.sh mode change 100644 => 100755 lib/admin_openrc.sh mode change 100644 => 100755 lib/config-parameters.sh mode change 100644 => 100755 lib/configure-ceilometer.sh mode change 100644 => 100755 lib/configure-forwarding.sh mode change 100644 => 100755 lib/configure-glance.sh mode change 100644 => 100755 lib/configure-heat.sh mode change 100644 => 100755 lib/configure-horizon.sh mode change 100644 => 100755 lib/configure-keystone.sh mode change 100644 => 100755 lib/configure-neutron.sh mode change 100644 => 100755 lib/configure-nova.sh mode change 100644 => 100755 lib/configure-ovs-bridge.sh mode change 100644 => 100755 lib/configure-packages.sh mode change 100644 => 100755 lib/configure-qemu.sh mode change 100644 => 100755 lib/install-config-odl-ovs.sh mode change 100644 => 100755 lib/install-config-ovs-vxlan.sh mode change 100644 => 100755 lib/local_settings.py mode change 100644 => 100755 lib/mysql-secure-installation.sh mode change 100644 => 100755 lib/setup-cirros-image.sh mode change 100644 => 100755 post-config-actions.sh mode change 100644 => 100755 remove.sh mode change 100644 => 100755 util/backup-restore-config-files.sh mode change 100644 => 100755 util/debug-openstack-service.sh mode change 100644 => 100755 util/detect-nodetype.sh mode change 100644 => 100755 util/drop-databases.sh mode change 100644 => 100755 util/install-config-linux-bridge.sh mode change 100644 => 100755 util/manage-services.sh mode change 100644 => 100755 util/update-etc-hosts.sh mode change 100644 => 100755 util/update-etc-network-interfaces.sh mode change 100644 => 100755 util/update-ip.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0c87fbe --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +cirros* +config_file_backup +release + diff --git a/configure.sh b/configure.sh old mode 100644 new mode 100755 index 098374e..520136a --- a/configure.sh +++ b/configure.sh @@ -33,8 +33,8 @@ if [ "$node_type" == "allinone" ] echo "Configuring packages for All-in-one" sleep 5 bash $dir_path/lib/configure-packages.sh controller $1 - bash $dir_path/lib/configure-packages.sh networknode - bash $dir_path/lib/configure-packages.sh compute + #bash $dir_path/lib/configure-packages.sh networknode + #bash $dir_path/lib/configure-packages.sh compute elif [ "$node_type" == "compute" ] || [ "$node_type" == "networknode" ] then echo "Configuring packages for: "$node_type diff --git a/install.sh b/install.sh old mode 100644 new mode 100755 index ec10a20..2d7ff2c --- a/install.sh +++ b/install.sh @@ -40,17 +40,17 @@ function install-common-packages() { apt-get install chrony -y service chrony restart - echo "About to configure APT for Ocata" - sleep 3 - apt-get install software-properties-common -y - ubuntu_version=`lsb_release -sr` - if [ "$ubuntu_version" == "17.04" ] || [ "$ubuntu_version" == "16.04" ] - then - add-apt-repository cloud-archive:ocata - else - echo "Ocata release supported only on Zesty (17.04) and Xenial (16.04)" - exit 1; - fi + #echo "About to configure APT for Ocata" + #sleep 3 + #apt-get install software-properties-common -y + #ubuntu_version=`lsb_release -sr` + #if [ "$ubuntu_version" == "17.04" ] || [ "$ubuntu_version" == "16.04" ] + #then + # add-apt-repository cloud-archive:ocata + #else + # echo "Ocata release supported only on Zesty (17.04) and Xenial (16.04)" + # exit 1; + #fi echo "Doing full system update" sleep 3 @@ -63,6 +63,13 @@ function install-common-packages() { function install-controller-packages() { echo "Installing MariaDB and MongoDB..." apt-get install mariadb-server python-pymysql -y + ubuntu_version=`lsb_release -sr` + if [ "$ubuntu_version" == "18.04" ] + then + echo "/usr/sbin/mysqld { }" | sudo tee /etc/apparmor.d/usr.sbin.mysqld + apparmor_parser -v -R /etc/apparmor.d/usr.sbin.mysqld + service mariadb restart + fi echo "Installing RabbitMQ..." sleep 3 @@ -79,7 +86,7 @@ function install-controller-packages() { echo "Installing Nova for Controller" sleep 2 - apt-get install nova-api nova-cert nova-conductor nova-consoleauth nova-novncproxy \ + apt-get install nova-api nova-conductor nova-consoleauth nova-novncproxy \ nova-scheduler nova-placement-api python-novaclient -y install-neutron-packages-controller diff --git a/lib/admin_openrc.sh b/lib/admin_openrc.sh old mode 100644 new mode 100755 index 0776665..e696e74 --- a/lib/admin_openrc.sh +++ b/lib/admin_openrc.sh @@ -19,6 +19,6 @@ export OS_USER_DOMAIN_NAME=default export OS_PROJECT_NAME=admin export OS_USERNAME=admin export OS_PASSWORD=password -export OS_AUTH_URL=http://$final_controller_host_name:35357/v3 +export OS_AUTH_URL=http://$final_controller_host_name:5000/v3 export OS_IDENTITY_API_VERSION=3 export OS_IMAGE_API_VERSION=2 diff --git a/lib/config-parameters.sh b/lib/config-parameters.sh old mode 100644 new mode 100755 index 9f9b495..603cdb6 --- a/lib/config-parameters.sh +++ b/lib/config-parameters.sh @@ -1,8 +1,8 @@ controller_host_name="controller" ### Start - interface related settings -readonly mgmt_interface="enp0s3" -readonly data_interface="enp0s8" +readonly mgmt_interface="ens3" +readonly data_interface="ens3" ### End - interface related settings ### Start - Neutron related settings @@ -69,7 +69,7 @@ function configure-keystone-authentication() { echo "Called configure-keystone-authentication with paramters: $@" sleep 3 crudini --set $1 keystone_authtoken auth_uri http://$2:5000 - crudini --set $1 keystone_authtoken auth_url http://$2:35357 + crudini --set $1 keystone_authtoken auth_url http://$2:5000 crudini --set $1 keystone_authtoken memcached_servers $2:11211 crudini --set $1 keystone_authtoken auth_type password crudini --set $1 keystone_authtoken project_domain_name default @@ -112,14 +112,14 @@ function create-api-endpoints() { function get-ip-address() { ip_address_val='' ubuntu_version=`lsb_release -sr` - if [ "$ubuntu_version" == "17.04" ] + if [ "$ubuntu_version" == "18.04" ] || [ "$ubuntu_version" == "17.04" ] then ip_address_val=`ifconfig $1 | grep 'inet ' | cut -d' ' -f10 | awk '{ print $1}'` elif [ "$ubuntu_version" == "16.04" ] then ip_address_val=`ifconfig $1 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'` else - echo "This release is supported only on Zesty (17.04) or Xenial (16.04)" + echo "This release is supported only on Bionic (18.04), Zesty (17.04) or Xenial (16.04)" exit 1; fi echo $ip_address_val diff --git a/lib/configure-ceilometer.sh b/lib/configure-ceilometer.sh old mode 100644 new mode 100755 diff --git a/lib/configure-forwarding.sh b/lib/configure-forwarding.sh old mode 100644 new mode 100755 diff --git a/lib/configure-glance.sh b/lib/configure-glance.sh old mode 100644 new mode 100755 diff --git a/lib/configure-heat.sh b/lib/configure-heat.sh old mode 100644 new mode 100755 diff --git a/lib/configure-horizon.sh b/lib/configure-horizon.sh old mode 100644 new mode 100755 index e247ef1..2bda46e --- a/lib/configure-horizon.sh +++ b/lib/configure-horizon.sh @@ -14,7 +14,8 @@ sed -e "/^'LOCATION.*$/s/^.*$/'LOCATION': \'"$1:1121"\'/" -i /etc/openstack-dash grep "OPENSTACK_HOST" /etc/openstack-dashboard/local_settings.py grep "LOCATION" /etc/openstack-dashboard/local_settings.py echo_and_sleep "OCATA - fixing secret_key permission" 1 -chown www-data /var/lib/openstack-dashboard/secret_key +#chown www-data /var/lib/openstack-dashboard/secret_key +chown horizon:horizon /var/lib/openstack-dashboard/secret_key echo_and_sleep "Restarting apache2" 1 service apache2 reload echo_and_sleep "Restarted apache2" 1 diff --git a/lib/configure-keystone.sh b/lib/configure-keystone.sh old mode 100644 new mode 100755 index 42aee9a..cbc2127 --- a/lib/configure-keystone.sh +++ b/lib/configure-keystone.sh @@ -25,8 +25,8 @@ keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone keystone-manage credential_setup --keystone-user keystone --keystone-group keystone keystone-manage bootstrap --bootstrap-password $5 \ - --bootstrap-admin-url http://$4:35357/v3/ \ - --bootstrap-internal-url http://$4:35357/v3/ \ + --bootstrap-admin-url http://$4:5000/v3/ \ + --bootstrap-internal-url http://$4:5000/v3/ \ --bootstrap-public-url http://$4:5000/v3/ \ --bootstrap-region-id RegionOne echo_and_sleep "Executed Keystone Bootstrap" 2 @@ -45,7 +45,7 @@ export OS_PASSWORD=$5 export OS_PROJECT_NAME=admin export OS_USER_DOMAIN_NAME=Default export OS_PROJECT_DOMAIN_NAME=Default -export OS_AUTH_URL=http://$4:35357/v3 +export OS_AUTH_URL=http://$4:5000/v3 export OS_IDENTITY_API_VERSION=3 echo_and_sleep "Set environment variables" 1 diff --git a/lib/configure-neutron.sh b/lib/configure-neutron.sh old mode 100644 new mode 100755 index 476de5b..8262a4e --- a/lib/configure-neutron.sh +++ b/lib/configure-neutron.sh @@ -53,7 +53,7 @@ if [ "$1" == "networknode" -o "$1" == "controller" ] crudini --set /etc/neutron/neutron.conf DEFAULT notify_nova_on_port_data_changes True crudini --set /etc/neutron/neutron.conf DEFAULT nova_url http://$2:8774/v2 - crudini --set /etc/neutron/neutron.conf nova auth_url http://$2:35357/ + crudini --set /etc/neutron/neutron.conf nova auth_url http://$2:5000/ crudini --set /etc/neutron/neutron.conf nova auth_type password crudini --set /etc/neutron/neutron.conf nova project_domain_name default crudini --set /etc/neutron/neutron.conf nova user_domain_name default @@ -129,7 +129,7 @@ sleep 3 if [ "$1" == "compute" -o "$1" == "controller" ] then crudini --set /etc/nova/nova.conf neutron url http://$2:9696 - crudini --set /etc/nova/nova.conf neutron auth_url http://$2:35357 + crudini --set /etc/nova/nova.conf neutron auth_url http://$2:5000 crudini --set /etc/nova/nova.conf neutron auth_type password crudini --set /etc/nova/nova.conf neutron project_domain_name default crudini --set /etc/nova/nova.conf neutron user_domain_name default diff --git a/lib/configure-nova.sh b/lib/configure-nova.sh old mode 100644 new mode 100755 index 86e84f9..fd40826 --- a/lib/configure-nova.sh +++ b/lib/configure-nova.sh @@ -76,7 +76,7 @@ crudini --set /etc/nova/nova.conf placement project_domain_name Default crudini --set /etc/nova/nova.conf placement project_name service crudini --set /etc/nova/nova.conf placement auth_type password crudini --set /etc/nova/nova.conf placement user_domain_name Default -crudini --set /etc/nova/nova.conf placement auth_url http://$2:35357/v3 +crudini --set /etc/nova/nova.conf placement auth_url http://$2:5000/v3 crudini --set /etc/nova/nova.conf placement username placement crudini --set /etc/nova/nova.conf placement password placement diff --git a/lib/configure-ovs-bridge.sh b/lib/configure-ovs-bridge.sh old mode 100644 new mode 100755 diff --git a/lib/configure-packages.sh b/lib/configure-packages.sh old mode 100644 new mode 100755 diff --git a/lib/configure-qemu.sh b/lib/configure-qemu.sh old mode 100644 new mode 100755 diff --git a/lib/install-config-odl-ovs.sh b/lib/install-config-odl-ovs.sh old mode 100644 new mode 100755 diff --git a/lib/install-config-ovs-vxlan.sh b/lib/install-config-ovs-vxlan.sh old mode 100644 new mode 100755 diff --git a/lib/local_settings.py b/lib/local_settings.py old mode 100644 new mode 100755 diff --git a/lib/mysql-secure-installation.sh b/lib/mysql-secure-installation.sh old mode 100644 new mode 100755 index 4ebb58d..7747477 --- a/lib/mysql-secure-installation.sh +++ b/lib/mysql-secure-installation.sh @@ -6,6 +6,7 @@ if [ $# -lt 2 ] exit 1 fi echo_and_sleep "Changing MySQL password for $1" 2 +echo "username, password - " $1 "," $2 mysqladmin -u $1 password $2 echo_and_sleep "Updating other security settings for MySQL" #Credit for the block below goes to http://bertvv.github.io/notes-to-self/2015/11/16/automating-mysql_secure_installation/ diff --git a/lib/setup-cirros-image.sh b/lib/setup-cirros-image.sh old mode 100644 new mode 100755 diff --git a/post-config-actions.sh b/post-config-actions.sh old mode 100644 new mode 100755 diff --git a/remove.sh b/remove.sh old mode 100644 new mode 100755 diff --git a/util/backup-restore-config-files.sh b/util/backup-restore-config-files.sh old mode 100644 new mode 100755 diff --git a/util/debug-openstack-service.sh b/util/debug-openstack-service.sh old mode 100644 new mode 100755 diff --git a/util/detect-nodetype.sh b/util/detect-nodetype.sh old mode 100644 new mode 100755 diff --git a/util/drop-databases.sh b/util/drop-databases.sh old mode 100644 new mode 100755 diff --git a/util/install-config-linux-bridge.sh b/util/install-config-linux-bridge.sh old mode 100644 new mode 100755 diff --git a/util/manage-services.sh b/util/manage-services.sh old mode 100644 new mode 100755 diff --git a/util/update-etc-hosts.sh b/util/update-etc-hosts.sh old mode 100644 new mode 100755 index c799904..de71868 --- a/util/update-etc-hosts.sh +++ b/util/update-etc-hosts.sh @@ -23,14 +23,14 @@ function change-ip-in-etc-hosts() { function get-ip-address() { ip_address_val='' ubuntu_version=`lsb_release -sr` - if [ "$ubuntu_version" == "17.04" ] + if [ "$ubuntu_version" == "18.04" ] || [ "$ubuntu_version" == "17.04" ] then ip_address_val=`ifconfig $1 | grep 'inet ' | cut -d' ' -f10 | awk '{ print $1}'` elif [ "$ubuntu_version" == "16.04" ] then ip_address_val=`ifconfig $1 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'` else - echo "This release is supported only on Zesty (17.04) or Xenial (16.04)" + echo "This release is supported only on Bionic (18.04), Zesty (17.04) or Xenial (16.04)" exit 1; fi echo $ip_address_val diff --git a/util/update-etc-network-interfaces.sh b/util/update-etc-network-interfaces.sh old mode 100644 new mode 100755 diff --git a/util/update-ip.sh b/util/update-ip.sh old mode 100644 new mode 100755 From c57aaf5fc46fa30af6bfcebf7673a65da3aec3ee Mon Sep 17 00:00:00 2001 From: kiran Date: Fri, 14 Jun 2019 12:44:49 +0530 Subject: [PATCH 2/4] removed debug statements --- configure.sh | 4 ++-- lib/mysql-secure-installation.sh | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/configure.sh b/configure.sh index 520136a..098374e 100755 --- a/configure.sh +++ b/configure.sh @@ -33,8 +33,8 @@ if [ "$node_type" == "allinone" ] echo "Configuring packages for All-in-one" sleep 5 bash $dir_path/lib/configure-packages.sh controller $1 - #bash $dir_path/lib/configure-packages.sh networknode - #bash $dir_path/lib/configure-packages.sh compute + bash $dir_path/lib/configure-packages.sh networknode + bash $dir_path/lib/configure-packages.sh compute elif [ "$node_type" == "compute" ] || [ "$node_type" == "networknode" ] then echo "Configuring packages for: "$node_type diff --git a/lib/mysql-secure-installation.sh b/lib/mysql-secure-installation.sh index 7747477..4ebb58d 100755 --- a/lib/mysql-secure-installation.sh +++ b/lib/mysql-secure-installation.sh @@ -6,7 +6,6 @@ if [ $# -lt 2 ] exit 1 fi echo_and_sleep "Changing MySQL password for $1" 2 -echo "username, password - " $1 "," $2 mysqladmin -u $1 password $2 echo_and_sleep "Updating other security settings for MySQL" #Credit for the block below goes to http://bertvv.github.io/notes-to-self/2015/11/16/automating-mysql_secure_installation/ From 1a75f1387f79f7bb60fdfe9c525276eee9111f31 Mon Sep 17 00:00:00 2001 From: kiran Date: Fri, 14 Jun 2019 13:09:45 +0530 Subject: [PATCH 3/4] added comments --- install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install.sh b/install.sh index 2d7ff2c..8f982f8 100755 --- a/install.sh +++ b/install.sh @@ -66,6 +66,7 @@ function install-controller-packages() { ubuntu_version=`lsb_release -sr` if [ "$ubuntu_version" == "18.04" ] then + # Change apparmor security settings for mysql to start without errors on Ubuntu 18.04 echo "/usr/sbin/mysqld { }" | sudo tee /etc/apparmor.d/usr.sbin.mysqld apparmor_parser -v -R /etc/apparmor.d/usr.sbin.mysqld service mariadb restart @@ -86,6 +87,7 @@ function install-controller-packages() { echo "Installing Nova for Controller" sleep 2 + # Removed nova-cert package, it's deprecated & not available in Ubuntu 18.04 repository apt-get install nova-api nova-conductor nova-consoleauth nova-novncproxy \ nova-scheduler nova-placement-api python-novaclient -y From edebc7c6279a674476ff0f8f0f083eba84bc4480 Mon Sep 17 00:00:00 2001 From: kiran Date: Fri, 14 Jun 2019 13:18:08 +0530 Subject: [PATCH 4/4] using different mgmt & data interface --- lib/config-parameters.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/config-parameters.sh b/lib/config-parameters.sh index 603cdb6..22b1e42 100755 --- a/lib/config-parameters.sh +++ b/lib/config-parameters.sh @@ -1,6 +1,8 @@ controller_host_name="controller" ### Start - interface related settings +#readonly mgmt_interface="enp0s3" +#readonly data_interface="enp0s8" readonly mgmt_interface="ens3" readonly data_interface="ens3" ### End - interface related settings