(Last Updated On: January 10, 2018)

This is part Five of our Openstack Lab guide series.So far we’ve covered:

Openstack Liberty Lab PART ONE: Setup Networking and all Prerequisites

Openstack Liberty Lab PART TWO: Install Openstack Packages

Openstack Liberty Lab PART THREE: Configuring Keystone identity service

Openstack Liberty Lab PART FOUR: Configuring Glance Image Service

For nova configuration, you should have installed KVM ,qemu-kvm and bridge utils package used to configure networking. If you had skipped installation of KVM do it here:

[[email protected] ~]# yum -y install libvirt qemu-kvm bridge-utils virt-install

For KVM guest Controller VM, enable nested virtualization by following tutorial below:

Complete Installation of KVM,QEMU and Virt Manager on Arch Linux and Manjaro

Proceed to configure Nova Compute service following below steps:

  1. Check to see if kvm kernel modules are loaded:
[[email protected] ~]# lsmod | grep kvm 
kvm_intel 162153 0 
kvm 525259 1 kvm_intel
[[email protected] ~]#

If not loaded, load them using modprobe command.
Check status of systemctl libvirtd daemon service. It must be running:

[[email protected] ~]# systemctl status libvirtd.service
libvirtd.service – Virtualization daemon
Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2016-03-28 12:03:21 EAT; 7h ago

Docs: man:libvirtd(8)

Main PID: 1018 (libvirtd)
CGroup: /system.slice/libvirtd.service

└─1018 /usr/sbin/libvirtd

Mar 28 12:03:14 controller systemd[1]: Starting Virtualization daemon…
Mar 28 12:03:21 controller libvirtd[1018]: libvirt version: 1.2.17, package: 13.el7_2.3 (Cent…rg)
Mar 28 12:03:21 controller libvirtd[1018]: Module /usr/lib64/libvirt/connection-driver/libvir…ble
Mar 28 12:03:21 controller systemd[1]: Started Virtualization daemon.
Hint: Some lines were ellipsized, use -l to show in full.

To start libvirtd, just issue below command in terminal:

[[email protected] ~]# systemctl start libvirtd.service 
[[email protected] ~]# systemctl enable libvirtd.service
  1. Configure database for Nova:
[[email protected] ~]# mysql -u root -p 
Enter password: 
Welcome to the MariaDB monitor. Commands end with ; or g.
Your MariaDB connection id is 21
Server version: 5.5.44-MariaDB MariaDB Server Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others. 
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement. 
MariaDB [(none)]> create database nova;
Query OK, 1 row affected (0.00 sec) 
MariaDB [(none)]> grant all privileges on nova.* to [email protected]'localhost' identified by 'moonstack';
Query OK, 0 rows affected (0.00 sec) 
MariaDB [(none)]> grant all privileges on nova.* to [email protected]'%' identified by 'moonstack';
Query OK, 0 rows affected (0.00 sec) 
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec) 
MariaDB [(none)]> exit
Bye
[[email protected] ~]#
  1. Add nova user and assign admin role:
[[email protected] ~]# openstack user create --domain default --project service --password moonstack nova 
+--------------------+----------------------------------+
| Field | Value |
+--------------------+----------------------------------+
| default_project_id | 9c3ec09f5e08442eb211612f99cd22ad |
| domain_id | default |
| enabled | True |
| id | a26ae1410a804eb08735395ddbb96806 |
| name | nova |
+--------------------+----------------------------------+
[[email protected] ~]# openstack role add --project service --user nova admin
  1. Add service entry for nova
[[email protected] ~]# openstack service create --name nova --description "OpenStack Compute service" compute 
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Compute service |
| enabled | True |
| id | dc44e10058174846806e0a1ea23d22b6 |
| name | nova |
| type | compute |
+-------------+----------------------------------+
  1. Add Compute service API endpoints; internal, public and admin
[[email protected] ~]# export controller=192.168.1.60 
[[email protected] ~]# openstack endpoint create --region RegionOne compute public http://$controller:8774/v2/%(tenant_id)s 
+--------------+-------------------------------------------+
| Field | Value |
+--------------+-------------------------------------------+
| enabled | True |
| id | 831f2786d19e4483897d532ee3241258 |
| interface | public |
| region | RegionOne | 
| region_id | RegionOne |
| service_id | dc44e10058174846806e0a1ea23d22b6 |
| service_name | nova |
| service_type | compute |
| url | http://192.168.1.60:8774/v2/%(tenant_id)s |
+--------------+-------------------------------------------+
[[email protected] ~]# openstack endpoint create --region RegionOne compute internal http://$controller:8774/v2/%(tenant_id)s 
+--------------+-------------------------------------------+
| Field | Value |
+--------------+-------------------------------------------+
| enabled | True |
| id | f475c02b71054965b8ffbed63ef37a1d |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | dc44e10058174846806e0a1ea23d22 |
| service_name | nova |
| service_type | compute |
| url | http://192.168.1.60:8774/v2/%(tenant_id)s |
+--------------+-------------------------------------------+
[[email protected] ~]# openstack endpoint create --region RegionOne compute admin http://$controller:8774/v2/%(tenant_id)s 
+--------------+-------------------------------------------+
| Field | Value |
+--------------+-------------------------------------------+
| enabled | True |
| id | fdfe82742ca243328f12abf00b5db743 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | dc44e10058174846806e0a1ea23d22 |
| service_name | nova |
| service_type | compute |
| url | http://192.168.1.60:8774/v2/%(tenant_id)s |
+--------------+-------------------------------------------+
[[email protected] ~]#
  1. Configure Nova; File modified is /etc/nova/nova.conf
  • MariaDB server connection section:
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf database connection mysql://nova:[email protected]/nova

RabbitMQ configuration section

[[email protected] ~]# openstack-config --set /etc/nova/nova.conf DEFAULT rpc_backend rabbit
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_host 192.168.1.60
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_port 5672
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_userid guest
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf oslo_messaging_rabbit rabbit_password moonstack
[[email protected] ~]#
  • Keystone configuration section
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_uri http://192.168.1.60:5000
[[email protected]roller ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_url http://192.168.1.60:35357
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_plugin password
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken project_domain_id default
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken user_domain_id default
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken project_name service
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken username nova
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken password moonstack
[[email protected] ~]#
  • DEFAULT configuration section
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf DEFAULT state_path /var/lib/nova
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf DEFAULT log_dir /var/log/nova
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf DEFAULT osapi_compute_listen 0.0.0.0
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf DEFAULT osapi_compute_listen_port 8774
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf DEFAULT rootwrap_config /etc/nova/rootwrap.conf
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf DEFAULT enabled_apis osapi_compute,metadata
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 192.168.1.60
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf DEFAULT compute_driver libvirt.LibvirtDriver
[[email protected] ~]#
  • Memcached server configuration section
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf DEFAULT memcached_servers 192.168.1.60:11211
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf DEFAULT scheduler_driver nova.scheduler.filter_scheduler.FilterScheduler
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf DEFAULT notification_driver nova.openstack.common.notifier.rpc_notifier
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf DEFAULT api_paste_config api-paste.ini
[[email protected] ~]#
  • Neutron-Nova configuration section
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf DEFAULT network_api_class nova.network.neutronv2.api.API
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf DEFAULT security_group_api neutron
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf DEFAULT linuxnet_interface_driver nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf DEFAULT metadata_listen 0.0.0.0
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf DEFAULT metadata_host 192.168.1.60
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf DEFAULT vif_plugging_is_fatal True
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf DEFAULT vif_plugging_timeout 300
[[email protected] ~]#
  • VNC configuration section
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf vnc vncserver_proxyclient_address 192.168.1.60
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf vnc enabled True
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf vnc vncserver_listen 0.0.0.0
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf vnc novncproxy_base_url http://192.168.1.60:6080/vnc_auto.html
[[email protected] ~]#
  • Glance server configuration section
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf glance host 192.168.1.60
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf glance port 9292
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf glance protocol http
  • Oslo_concurrency configuration section
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmp
  • KVM / libvirt configuration section
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf libvirt virt_type kvm
[[email protected] ~]#
  1. Populate the Compute database:
[[email protected] ~]# su -s /bin/sh -c "nova-manage db sync" nova
  1. Start the Compute services and configure them to start when the system boots:
  • Set to start when system boots:
[[email protected] ~]# 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 openstack-nova-compute.service
  • Start services:
[[email protected] ~]# 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 openstack-nova-compute.service
  1. Check to see if all strated services are running.
[[email protected] ~]# systemctl status openstack-nova-api.service openstack-nova-cert.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service openstack-nova-compute.service

Output:

[[email protected] ~]# systemctl status openstack-nova-api.service openstack-nova-cert.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
openstack-nova-api.service – OpenStack Nova API Server
Loaded: loaded (/usr/lib/systemd/system/openstack-nova-api.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2016-03-28 20:27:36 EAT; 1min 55s ago
Main PID: 30155 (nova-api)
CGroup: /system.slice/openstack-nova-api.service

├─30155 /usr/bin/python2 /usr/bin/nova-api
├─30236 /usr/bin/python2 /usr/bin/nova-api
├─30237 /usr/bin/python2 /usr/bin/nova-api
├─30238 /usr/bin/python2 /usr/bin/nova-api
├─30239 /usr/bin/python2 /usr/bin/nova-api
├─30254 /usr/bin/python2 /usr/bin/nova-api
├─30255 /usr/bin/python2 /usr/bin/nova-api
├─30256 /usr/bin/python2 /usr/bin/nova-api
└─30257 /usr/bin/python2 /usr/bin/nova-api

Mar 28 20:27:32 controller systemd[1]: Starting OpenStack Nova API Server…
Mar 28 20:27:36 controller sudo[30240]: nova : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/nova-rootwrap /etc/nova/rootwrap.conf ipt…-save -c
Mar 28 20:27:36 controller sudo[30243]: nova : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/nova-rootwrap /etc/nova/rootwrap.conf ipt…store -c
Mar 28 20:27:36 controller systemd[1]: Started OpenStack Nova API Server.
openstack-nova-cert.service – OpenStack Nova Cert Server
Loaded: loaded (/usr/lib/systemd/system/openstack-nova-cert.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2016-03-28 20:27:35 EAT; 1min 57s ago
Main PID: 30156 (nova-cert)
CGroup: /system.slice/openstack-nova-cert.service

└─30156 /usr/bin/python2 /usr/bin/nova-cert

Mar 28 20:27:32 controller systemd[1]: Starting OpenStack Nova Cert Server…
Mar 28 20:27:35 controller systemd[1]: Started OpenStack Nova Cert Server.
openstack-nova-consoleauth.service – OpenStack Nova VNC console auth Server
Loaded: loaded (/usr/lib/systemd/system/openstack-nova-consoleauth.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2016-03-28 20:27:34 EAT; 1min 57s ago
Main PID: 30157 (nova-consoleaut)
CGroup: /system.slice/openstack-nova-consoleauth.service

└─30157 /usr/bin/python2 /usr/bin/nova-consoleauth

Mar 28 20:27:32 controller systemd[1]: Starting OpenStack Nova VNC console auth Server…
Mar 28 20:27:34 controller systemd[1]: Started OpenStack Nova VNC console auth Server.
openstack-nova-scheduler.service – OpenStack Nova Scheduler Server
Loaded: loaded (/usr/lib/systemd/system/openstack-nova-scheduler.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2016-03-28 20:27:34 EAT; 1min 57s ago
Main PID: 30158 (nova-scheduler)
CGroup: /system.slice/openstack-nova-scheduler.service

└─30158 /usr/bin/python2 /usr/bin/nova-scheduler

Mar 28 20:27:32 controller systemd[1]: Starting OpenStack Nova Scheduler Server…
Mar 28 20:27:34 controller systemd[1]: Started OpenStack Nova Scheduler Server.
Mar 28 20:27:35 controller nova-scheduler[30158]: /usr/lib64/python2.7/site-packages/sqlalchemy/sql/default_comparator.py:153: SAWarning: The IN-pr…
Mar 28 20:27:35 controller nova-scheduler[30158]: ‘strategies for improved performance.’ % expr)
openstack-nova-conductor.service – OpenStack Nova Conductor Server
Loaded: loaded (/usr/lib/systemd/system/openstack-nova-conductor.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2016-03-28 20:27:34 EAT; 1min 57s ago
Main PID: 30159 (nova-conductor)
CGroup: /system.slice/openstack-nova-conductor.service

├─30159 /usr/bin/python2 /usr/bin/nova-conductor
├─30211 /usr/bin/python2 /usr/bin/nova-conductor
├─30212 /usr/bin/python2 /usr/bin/nova-conductor
├─30213 /usr/bin/python2 /usr/bin/nova-conductor
└─30214 /usr/bin/python2 /usr/bin/nova-conductor

Mar 28 20:27:32 controller systemd[1]: Starting OpenStack Nova Conductor Server…
Mar 28 20:27:34 controller systemd[1]: Started OpenStack Nova Conductor Server.
openstack-nova-novncproxy.service – OpenStack Nova NoVNC Proxy Server
Loaded: loaded (/usr/lib/systemd/system/openstack-nova-novncproxy.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2016-03-28 20:27:32 EAT; 2min 0s ago
Main PID: 30160 (nova-novncproxy)
CGroup: /system.slice/openstack-nova-novncproxy.service

└─30160 /usr/bin/python2 /usr/bin/nova-novncproxy –web /usr/share/novnc/

Mar 28 20:27:32 controller systemd[1]: Started OpenStack Nova NoVNC Proxy Server.
Mar 28 20:27:32 controller systemd[1]: Starting OpenStack Nova NoVNC Proxy Server…
Hint: Some lines were ellipsized, use -l to show in full.

openstack-nova-compute.service – OpenStack Nova Compute Server
Loaded: loaded (/usr/lib/systemd/system/openstack-nova-compute.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2016-03-29 00:20:00 EAT; 5min ago
Main PID: 3362 (nova-compute)
CGroup: /system.slice/openstack-nova-compute.service
└─3362 /usr/bin/python2 /usr/bin/nova-compute

Mar 29 00:19:58 controller systemd[1]: Starting OpenStack Nova Compute Server…
Mar 29 00:20:00 controller systemd[1]: Started OpenStack Nova Compute Server.
Mar 29 00:23:33 controller systemd[1]: Started OpenStack Nova Compute Server.
Hint: Some lines were ellipsized, use -l to show in full.

In this Part. we configured Nova compute service to be used for Launching Virtual Machines. The easiest way to launch a virtual Machine on Nova is with the use of Openstack Dashboard (  Horizon).We’ll install it later and launch a virtual Machine with it.
PREVIOUS ARTICLE:

Openstack Liberty Lab Part Four: Configuring Glance Image Service

NEXT ARTICLE:

Openstack Liberty Lab Part Six: Configure Neutron Network Service