OpenStack Liberty on Ubuntu 14.04 LTS – Configure Nova

0
OpenStack Liberty on Ubuntu 14.04 LTS – Configure Nova
OpenStack Liberty on Ubuntu 14.04 LTS – Configure Nova

This guide helps you to configure Nova (Compute) service on OpenStak environment, in OpenStack, compute service (node) hosts cloud computing systems. OpenStack compute is a major part in IaaS, it interacts with KeyStone for authentication, image service for disk and images, and dashboard for the user and administrative interface.

OpenStack Compute can scale horizontally on standard hardware, and download images to launch computing instance.

Install and configure controller node:

We will configure the Compute service on the Controller node, login into the MySQL server as the root user.

# mysql -u root -p

Create the nova database.

CREATE DATABASE nova;

Grant a proper permission to the nova database.

GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'password';

GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'password';

Replace “password” with a suitable password. Exit from MySQL.

Load your admin credential from the environment script.

# source admin-openrc.sh

Create the nova user for creating service credentials.

# openstack user create --domain default --password-prompt nova                                                                                        
User Password:
Repeat User Password:
+-----------+----------------------------------+
| Field     | Value                            |
+-----------+----------------------------------+
| domain_id | default                          |
| enabled   | True                             |
| id        | a25d5cdc7efa4375b0907dd615eebde0 |
| name      | nova                             |
+-----------+----------------------------------+

Add the admin role to the nova user.

# openstack role add --project service --user nova admin

Create the nova service entity.

# openstack service create --name nova --description "Nova" compute
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Nova                             |
| enabled     | True                             |
| id          | ad302b8a4e884decb8ed0f4fdf319ba1 |
| name        | nova                             |
| type        | compute                          |
+-------------+----------------------------------+

Create the nova service API endpoint.

# openstack endpoint create --region RegionOne compute public http://controller:8774/v2/%\(tenant_id\)s
+--------------+-----------------------------------------+
| Field        | Value                                   |
+--------------+-----------------------------------------+
| enabled      | True                                    |
| id           | 3d7bba2b7c3446e7975f8b74c0cab712        |
| interface    | public                                  |
| region       | RegionOne                               |
| region_id    | RegionOne                               |
| service_id   | ad302b8a4e884decb8ed0f4fdf319ba1        |
| service_name | nova                                    |
| service_type | compute                                 |
| url          | http://controller:8774/v2/%(tenant_id)s |
+--------------+-----------------------------------------+

# openstack endpoint create --region RegionOne compute internal http://controller:8774/v2/%\(tenant_id\)s
+--------------+-----------------------------------------+
| Field        | Value                                   |
+--------------+-----------------------------------------+
| enabled      | True                                    |
| id           | 240d4430f1c442439c3835c12abf7533        |
| interface    | internal                                |
| region       | RegionOne                               |
| region_id    | RegionOne                               |
| service_id   | ad302b8a4e884decb8ed0f4fdf319ba1        |
| service_name | nova                                    |
| service_type | compute                                 |
| url          | http://controller:8774/v2/%(tenant_id)s |
+--------------+-----------------------------------------+

# openstack endpoint create --region RegionOne compute admin http://controller:8774/v2/%\(tenant_id\)s
+--------------+-----------------------------------------+
| Field        | Value                                   |
+--------------+-----------------------------------------+
| enabled      | True                                    |
| id           | 758d41f12fff4617bc7e4c12bd4502fc        |
| interface    | admin                                   |
| region       | RegionOne                               |
| region_id    | RegionOne                               |
| service_id   | ad302b8a4e884decb8ed0f4fdf319ba1        |
| service_name | nova                                    |
| service_type | compute                                 |
| url          | http://controller:8774/v2/%(tenant_id)s |
+--------------+-----------------------------------------+

Install and configure Compute controller components:

Install the below packages on the controller node.

# apt-get install nova-api nova-cert nova-conductor nova-consoleauth nova-novncproxy nova-scheduler python-novaclient

Edit the /etc/nova/nova.conf.

# nano /etc/nova/nova.conf

Modify the below settings and make sure to place a entries in the proper sections. If you do not find an existing section for below entries, you might need to add those particular sections on the file.

[DEFAULT]
...
verbose = True
rpc_backend = rabbit
auth_strategy = keystone
## Management IP of Controller Node
my_ip = 192.168.12.21 
network_api_class = nova.network.neutronv2.api.API
security_group_api = neutron
linuxnet_interface_driver = nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver
enabled_apis=osapi_compute,metadata

[vnc]
## Management IP of Controller Node
vncserver_listen = $my_ip
vncserver_proxyclient_address = $my_ip

[database]
connection = mysql+pymysql://nova:password@controller/nova

## Replace "password" with the password you chose for nova database

[oslo_messaging_rabbit]
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = password

## Replace "password" with the password you chose for the openstack account in RabbitMQ.

[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = password

## Replace "password" with the password you chose for nova user in the identity service

[glance]
host = controller

[oslo_concurrency]
lock_path = /var/lib/nova/tmp

Populate the Compute database.

#  su -s /bin/sh -c "nova-manage db sync" nova

Restart the compute services.

# service nova-api restart
# service nova-cert restart
# service nova-consoleauth restart
# service nova-scheduler restart
# service nova-conductor restart
# service nova-novncproxy restart

Remove SQLite database file.

# rm -f /var/lib/nova/nova.sqlite

Install and configure Nova ( on compute node):

Now, we will install and configure Compute service on a compute node, this service supports multiple hypervisors to deploy instance (VM’s). Our compute node uses the QEMU hypervisor with KVM extension to support hardware accelerated virtualization.

Verify whether your compute supports hardware virtualization.

# egrep -c '(vmx|svm)' /proc/cpuinfo
1

If the command returns with value 1 or more, your compute node supports virtualization.

Make sure you have enabled OpenStack Kilo repository on Compute Node, or follow below steps to enable it.

Install the Ubuntu Cloud archive keyring and repository.

# apt-get install software-properties-common

# add-apt-repository cloud-archive:liberty

Upgrade your system.

# apt-get update && apt-get dist-upgrade

Install the following packages on your each Compute node.

# apt-get install nova-compute sysfsutils

Edit /etc/nova/nova-compute.conf to enable QEMU.

# vi /etc/nova/nova-compute.conf

Change virt_type=kvm to qemu in libvirt section.

[libvirt]
...
virt_type = qemu

Edit the /etc/nova/nova.conf.

# vi /etc/nova/nova.conf

Modify the below settings and make sure to place a entries in the proper sections.

[DEFAULT]
...
verbose = True
rpc_backend = rabbit
auth_strategy = keystone
## Management IP of Compute Node
my_ip = 192.168.12.22
network_api_class = nova.network.neutronv2.api.API
security_group_api = neutron
linuxnet_interface_driver = nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[vnc]
enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://controller:6080/vnc_auto.html
[oslo_messaging_rabbit]
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = password
## Replace "password" with the password you chose for the openstack account in RabbitMQ.

[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = password

## Replace "password" with the password you chose for nova user in the identity service

[glance]
host = controller

## Replace controller with your controller hostname

[oslo_concurrency]
lock_path = /var/lib/nova/tmp

Restart the compute service.

# service nova-compute restart

Remove SQLite database file.

# rm -f /var/lib/nova/nova.sqlite

Verify operation:

Load admin credentials on Controller Node.

# source admin-openrc.sh

List the compute service components to verify, run the following command on the Controller Node.

# nova service-list
+----+------------------+--------------------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary           | Host                     | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+----+------------------+--------------------------+----------+---------+-------+----------------------------+-----------------+
| 1  | nova-consoleauth | controller.itzgeek.local | internal | enabled | up    | 2015-11-25T14:11:25.000000 | -               |
| 2  | nova-cert        | controller.itzgeek.local | internal | enabled | up    | 2015-11-25T14:11:24.000000 | -               |
| 3  | nova-conductor   | controller.itzgeek.local | internal | enabled | up    | 2015-11-25T14:11:28.000000 | -               |
| 4  | nova-scheduler   | controller.itzgeek.local | internal | enabled | up    | 2015-11-25T14:11:24.000000 | -               |
| 5  | nova-compute     | compute.itzgeek.local    | nova     | enabled | up    | 2015-11-25T14:11:30.000000 | -               |
+----+------------------+--------------------------+----------+---------+-------+----------------------------+-----------------+

You should get an output with four service components enabled on the controller node and one service component on the compute node.

List images in the Image service catalog to verify connectivity betwwen compute and image service.

# nova image-list
+--------------------------------------+---------------------+--------+--------+
| ID                                   | Name                | Status | Server |
+--------------------------------------+---------------------+--------+--------+
| b19c4522-df31-4331-a2e1-5992abcd4ded | Ubuntu_14.04-x86_64 | ACTIVE |        |
+--------------------------------------+---------------------+--------+--------+

That’s All!!!, you have successfully configure Nova service. Next is to configure OpenStack Networking (Neutron).

You might also like