VScaler: CIX Controller Node OpenStack Installation - Nova
Jump to navigation
Jump to search
Nova Compute Services
5_vscaler-controller-nova.sh
#!/bin/bash
# System prep notes
# - selinux disabled
# - firewalld running and allowing internal forwarding of traffic (compute nodes can access repos)
# - headnode /etc/hosts added entry for headnode, make sure the name 'controller' resolves the headnode also[root@head ~]# vi /etc/hosts
# [root@head ~]# ping -c 1 controller
# PING head.ohpc.keele.net (10.10.10.1) 56(84) bytes of data.
# 64 bytes from head.ohpc.keele.net (10.10.10.1): icmp_seq=1 ttl=64 time=0.082 ms
# - enable ntpd on compute nodes; systemctl enable ntpd ; systemctl start ntpd
# - disable the epel and ohpc repo
# yum-config-manager --disable epel epel-testing OpenHPC_1.0
# [root@node02 yum.repos.d]# grep enable epel* OpenHPC\:1.0.repo
# epel-testing.repo:enabled=0
# epel-testing.repo:enabled=0
# epel-testing.repo:enabled=0
# epel.repo:enabled=0
# epel.repo:enabled=0
# epel.repo:enabled=0
# OpenHPC:1.0.repo:enabled=0
# source the vscaler installation vars
. vscaler-env.sh
#-------------------------------------
# setup the nova service on controller
#-------------------------------------
echo "---------------------"
echo " Creating the DB "
echo "---------------------"
mysql -u root --password=$VS_PASS <<MYSQL_SCRIPT
CREATE DATABASE nova;
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY '$NOVA_DBPASS';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY '$NOVA_DBPASS';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'$HOSTNAME' IDENTIFIED BY '$NOVA_DBPASS';
MYSQL_SCRIPT
source ~/admin-openrc.sh
echo "----------------------------------"
echo " Creating service credentials "
echo "----------------------------------"
#Create the service credentials, complete these steps
openstack user create --domain default --password $NOVA_PASS nova
openstack role add --project service --user nova admin
openstack service create --name nova --description "OpenStack Compute" compute
openstack endpoint create --region RegionOne compute public http://controller:8774/v2/%\(tenant_id\)s
openstack endpoint create --region RegionOne compute internal http://controller:8774/v2/%\(tenant_id\)s
openstack endpoint create --region RegionOne compute admin http://controller:8774/v2/%\(tenant_id\)s
echo "---------------------------"
echo " Install Nova Packages "
echo "---------------------------"
# install the packages for nova service
yum -y install openstack-nova-api openstack-nova-cert \
openstack-nova-conductor openstack-nova-console \
openstack-nova-novncproxy openstack-nova-scheduler \
python-novaclient
echo "----------------------------------"
echo " Edit the configuration files "
echo "----------------------------------"
# edit the nova.conf files
crudini --set /etc/nova/nova.conf database connection mysql://nova:$NOVA_DBPASS@controller/nova
crudini --set /etc/nova/nova.conf DEFAULT rpc_backend rabbit
crudini --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_host controller
crudini --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_userid openstack
crudini --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_password $RABBIT_PASS
crudini --set /etc/nova/nova.conf DEFAULT auth_strategy keystone
crudini --del /etc/nova/nova.conf keystone_authtoken
crudini --set /etc/nova/nova.conf keystone_authtoken auth_uri http://controller:5000
crudini --set /etc/nova/nova.conf keystone_authtoken auth_url http://controller:35357
crudini --set /etc/nova/nova.conf keystone_authtoken auth_plugin password
crudini --set /etc/nova/nova.conf keystone_authtoken project_domain_id default
crudini --set /etc/nova/nova.conf keystone_authtoken user_domain_id default
crudini --set /etc/nova/nova.conf keystone_authtoken project_name service
crudini --set /etc/nova/nova.conf keystone_authtoken username nova
crudini --set /etc/nova/nova.conf keystone_authtoken password $NOVA_PASS
crudini --set /etc/nova/nova.conf DEFAULT my_ip $MY_INT_IP
crudini --set /etc/nova/nova.conf DEFAULT network_api_class nova.network.neutronv2.api.API
crudini --set /etc/nova/nova.conf DEFAULT security_group_api neutron
crudini --set /etc/nova/nova.conf DEFAULT linuxnet_interface_driver nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver
crudini --set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver
crudini --set /etc/nova/nova.conf vnc vncserver_listen $MY_INT_IP
crudini --set /etc/nova/nova.conf vnc vncserver_proxyclient_address $MY_INT_IP
crudini --set /etc/nova/nova.conf glance host controller
crudini --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmp
crudini --set /etc/nova/nova.conf DEFAULT enabled_apis osapi_compute,metadata
crudini --set /etc/nova/nova.conf DEFAULT verbose True
echo "----------------------------"
echo " Initialise the Nova DB "
echo "----------------------------"
# initialise the nova db
su -s /bin/sh -c "nova-manage db sync" nova
echo "---------------------------------"
echo " Enable Restart the services "
echo "---------------------------------"
# enable and start the compute services
systemctl enable openstack-nova-api.service \
openstack-nova-cert.service openstack-nova-consoleauth.service \
openstack-nova-scheduler.service openstack-nova-conductor.service \
openstack-nova-novncproxy.service
systemctl start openstack-nova-api.service \
openstack-nova-cert.service openstack-nova-consoleauth.service \
openstack-nova-scheduler.service openstack-nova-conductor.service \
openstack-nova-novncproxy.service
echo "----------------------------"
echo " Verify the Nova service "
echo "----------------------------"
sleep 1;
# verify nova
source ~/admin-openrc.sh
nova service-list
nova image-listProblems
Unable to start openstack-nova-api.service
- The service failed to start after running this script
- We were unable to figure out why but it was calling an
iptables-restorewhich refused to workiptablesbitched about not being able to process the nat table- This was because the
iptable_natandnf_nat_ipv4modules wouldn't load
- Rebooting the whole node resolved the situation