Openstack Liberty Lab Part 5: Configuring Nova Computing Services

This is Part 5 of our Openstack Lab guide series. So far we have introduced:

Openstack Liberty Lab Part 1: Setting Up the Network and All Prerequisites

Openstack Liberty Lab Part 2: Install Openstack Packages

Openstack Liberty Lab Part 3: Configuring Keystone Identity Services

Openstack Liberty Lab Part 4: Configuring Glance Image Service

For nova configuration, you should already have the KVM, qemu-kvm and bridge utils packages used to configure the network. If you skipped the installation of KVM, do the following here:

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

For the KVM guest Controller VM, follow the tutorial below to enable nested virtualization:

Full installation of KVM, QEMU and Virt Manager on Arch Linux and Manjaro

Follow these steps to continue configuring Nova Compute services:

  1. Check if the kvm kernel module is loaded:
[[email protected] ~]# lsmod | grep kvm 
kvm_intel 162153 0 
kvm 525259 1 kvm_intel
[[email protected] ~]#

If not, use the modprobe command to load them.
Check the status of the 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) Activity: since 2016 Active (running) state since Monday, March 28 12:03:21 eats; 7 hours ago

File: man: libvirtd (8)
http://libvirt.org

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

└─1018 / usr / sbin / libvirtd

March 28 12:03:14 controller systemd[1]: Starting the virtualization daemon … Mar 28 12:03:21 Controller libvirtd[1018]: Libvirt version: 1.2.17, software package: 13.el7_2.3 (Cent … rg) March 28 12:03:21 controller libvirtd[1018]: Module /usr/lib64/libvirt/connection-driver/libvir…bleMar 28 12:03:21 controller systemd[1]: The virtualization daemon is started. Hint: Some lines have been omitted, please use -l for full display.

To start libvirtd, simply issue the following command in a terminal:

[[email protected] ~]# systemctl start libvirtd.service 
[[email protected] ~]# systemctl enable libvirtd.service
  1. Configure the 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 administrator 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 administrator
[[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; the modified file is /etc/nova/nova.conf
  • MariaDB server connection part:
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf database connection mysql://nova:[email protected]192.168.1.60/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 correction configuration section
[[email protected] ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_uri http://192.168.1.60:5000
[[email protected] ~]# 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] ~]#
  • Overview 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 calculation database:
[[email protected] ~]# su -s /bin/sh -c "nova-manage db sync" nova
  1. Start the Compute service and configure it to start at system startup:
  • Set to start at system startup:
[[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 the service:
[[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 if all staging 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 is loaded: Loaded (/usr/lib/systemd/system/openstack-nova-api.service; enabled; vendor preset: disabled) Activity: Since Monday (2016- 03-28) since the active (running) state 20:27:36 eat; 1min 55s before the 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 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 / New API

March 28 20:27:32 controller systemd[1]: Starting the OpenStack Nova API server … March 28 20:27:36 Controller sudo[30240]: Nova: TTY = unknown; PWD = /; USER = root; COMMAND = / bin / nova-rootwrap /etc/nova/rootwrap.conf ipt… -save -c March 28 20:27:36 controller sudo[30243]: Nova: TTY = unknown; PWD = /; USER = root; COMMAND = / bin / nova-rootwrap /etc/nova/rootwrap.conf ipt… store -c March 28 20:27:36 controller systemd[1]: The OpenStack Nova API server has been started. ● openstack-nova-cert.service – OpenStack Nova certificate server is loaded: loaded (/usr/lib/systemd/system/openstack-nova-cert.service; enabled; vendor preset: disabled) Monday 2016-03-28 20:27:35 Active (running) 1min 57s ago Main PID: 30156 (nova-cert) CGroup: /system.slice/openstack-nova-cert.service

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

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

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

March 28 20:27:32 controller systemd[1]: Starting the OpenStack Nova VNC console authentication server … Mar 28 20:27:34 controller systemd[1]: The OpenStack Nova VNC console authentication server is started. Activity: since Monday 2016-03-28 20:27:34 EAT Activity (running); 1min 57s ago Main PID: 30158 (nova-scheduler) CGroup: /system.slice/openstack-nova-scheduler.service

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

March 28 20:27:32 controller systemd[1]: Starting the OpenStack Nova Scheduler Server … Mar 28 20:27:34 controller systemd[1]: The OpenStack Nova Scheduler Server is started. March 28 20:27:35 controller nova-scheduler[30158]: /Usr/lib64/python2.7/site-packages/sqlalchemy/sql/default_comparator.py:153: SAWarning: IN-pr … Mar 28 20:27:35 controller nova-scheduler[30158]: “Strategy for improving performance.”% Expr) ● openstack-nova-conductor.service-Loaded OpenStack Nova Conductor Server: Loaded (/usr/lib/systemd/system/openstack-nova-conductor.service; enabled; Vendor preset: Activity: Active (running) from Monday 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

March 28 20:27:32 controller systemd[1]: Starting OpenStack Nova Conductor Server … Mar 28 20:27:34 controller systemd[1]: The OpenStack Nova Conductor server has been started. : Since Monday 2016-03-28 20:27:32 diet has been active (running); 2min 0s before the main PID: 30160 (nova-novncproxy) CGroup: /system.slice/openstack-nova-novncproxy.service

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

March 28 20:27:32 controller systemd[1]: OpenStack Nova NoVNC proxy server is started. March 28 20:27:32 controller systemd[1]: Starting the OpenStack Nova NoVNC proxy server … Hint: Some lines have been omitted, please use -l for full display.

Openstack-nova-compute.service – OpenStack Nova compute server
Loaded: Loaded (/usr/lib/systemd/system/openstack-nova-compute.service; enabled; vendor preset: disabled)
Activity: Activity (running) to eat since Tuesday 2016-03-29 00:20:00; 5 minutes ago
Primary PID: 3362 (Rising Star Calculation)
CGroup: /system.slice/openstack-nova-compute.service
336─3362 / usr / bin / python2 / usr / bin / nova-compute

March 29 00:19:58 controller systemd[1]: Starting the OpenStack Nova Compute Server …
March 29 00:20:00 controller systemd[1]: OpenStack Nova Compute Server is started.
March 29 00:23:33 controller systemd[1]: OpenStack Nova Compute Server is started.
Tip: Some lines are oval, use -l to display them completely.

In this part. We configured the Nova computing service to start the virtual machine. The easiest way to start a virtual machine on Nova is to use the Openstack Dashboard (Horizon). We will install it later and start the virtual machine later. Previous article:

Openstack Liberty Lab Part 4: Configuring Glance Image Service

Next article:

Openstack Liberty Lab Part 6: Configuring Neutron Network Services

Sidebar