Home / Openstack / Openstack – Configuring the Compute Node – Part 5

Openstack – Configuring the Compute Node – Part 5

Openstack Compute service is the heart of IaaS (Infrastructure as Service) . Compute nodes are use to create the virtual instance and manage cloud computing systems.  Openstack compute node (nova) interacts with keystone service for identity , communicates with glance for server OS images ,  works with Horizon to provide the dashboard for user access and administration. OpenStack Compute can scale horizontally on standard hardware (x86) by installing hyper-visors(Ex: KVM, Xen , VMware ESXi, Hyper-V ).  Unlike other openstack services , Compute services has many modules, API’s and services. Here is the consolidated list of those.

 

 

Compute Services
Compute Services
Compute Services
Compute Services

 

The Compute service relies on a hypervisor to run virtual machine instances. OpenStack can use various hypervisors, but this guide uses KVM.

 

Configure the controller node for Compute services:

 

1. Login to the openstack controller node & install the compute packages which are necessary for controller node.

root@OSCTRL-UA:~# apt-get install nova-api nova-cert nova-conductor nova-consoleauth nova-novncproxy nova-scheduler python-novaclient
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libblas3 libgfortran3 libjs-swfobject liblapack3 libquadmath0 nova-common
  novnc python-amqplib python-cliff python-cliff-doc python-cmd2 python-ecdsa
  python-jinja2 python-m2crypto python-neutronclient python-nova python-novnc
  python-numpy python-oslo.rootwrap python-paramiko python-pyasn1
  python-pyparsing python-rfc3986 websockify
Suggested packages:
  python-amqplib-doc python-jinja2-doc gcc gfortran python-dev python-nose
  python-numpy-dbg python-numpy-doc doc-base
The following NEW packages will be installed:
  libblas3 libgfortran3 libjs-swfobject liblapack3 libquadmath0 nova-api
  nova-cert nova-common nova-conductor nova-consoleauth nova-novncproxy
  nova-scheduler novnc python-amqplib python-cliff python-cliff-doc
  python-cmd2 python-ecdsa python-jinja2 python-m2crypto python-neutronclient
  python-nova python-novaclient python-novnc python-numpy python-oslo.rootwrap
  python-paramiko python-pyasn1 python-pyparsing python-rfc3986 websockify
0 upgraded, 31 newly installed, 0 to remove and 17 not upgraded.
Need to get 7,045 kB of archives.
After this operation, 46.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main libquadmath0 amd64 4.8.4-2ubuntu1~14.04 [126 kB]

 

2.  Compute services stores information on Database to retrieve the data quickly. Configure the Compute service with database credentials. Add the below entry in nova.conf file.

root@OSCTRL-UA:~# tail -4 /etc/nova/nova.conf
[database]
connection = mysql://nova:novadb123@OSCTRL-UA/nova

 

3.Add the message queue configuration on nova.conf file. We are using RabbitMQ as message queue service.

Note: You need to add the lines below under [default] section in nova.conf.

root@OSCTRL-UA:~# grep -i rabbit -A5 /etc/nova/nova.conf
#Add Rabbit MQ config
rpc_backend = rabbit
rabbit_host = OSCTRL-UA
rabbit_password = rabbit123

 

4.The below configuration required for guest VNC config. Add the controller node IP address like below.

Note: You need to add the lines below under [default] section in nova.conf.

root@OSCTRL-UA:~# grep VNC -A4 /etc/nova/nova.conf
#VNC
my_ip = 192.168.203.130
vncserver_listen = 192.168.203.130
vncserver_proxyclient_address = 192.168.203.130
root@OSCTRL-UA:~#

 

5.Remove the nova sqllite DB since we are using mysql. sqllite is default test database on Ubuntu.

root@OSCTRL-UA:~#  rm /var/lib/nova/nova.sqlite
root@OSCTRL-UA:~#

 

6.Create the nova DB user on mysql.

root@OSCTRL-UA:~# mysql -u root -pstack
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 51
Server version: 5.5.44-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE DATABASE nova;
Query OK, 1 row affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'novadb123';
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'novadb123';
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
root@OSCTRL-UA:~#

 

 

7. Create the Compute service tables on Mysql. (nova).

root@OSCTRL-UA:~# su -s /bin/sh -c "nova-manage db sync" nova
2015-09-28 04:26:33.366 20105 INFO migrate.versioning.api [-] 215 -> 216...
2015-09-28 04:26:37.482 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:37.483 20105 INFO migrate.versioning.api [-] 216 -> 217...
2015-09-28 04:26:37.487 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:37.488 20105 INFO migrate.versioning.api [-] 217 -> 218...
2015-09-28 04:26:37.492 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:37.493 20105 INFO migrate.versioning.api [-] 218 -> 219...
2015-09-28 04:26:37.497 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:37.498 20105 INFO migrate.versioning.api [-] 219 -> 220...
2015-09-28 04:26:37.503 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:37.504 20105 INFO migrate.versioning.api [-] 220 -> 221...
2015-09-28 04:26:37.509 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:37.510 20105 INFO migrate.versioning.api [-] 221 -> 222...
2015-09-28 04:26:37.515 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:37.516 20105 INFO migrate.versioning.api [-] 222 -> 223...
2015-09-28 04:26:37.520 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:37.521 20105 INFO migrate.versioning.api [-] 223 -> 224...
2015-09-28 04:26:37.525 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:37.526 20105 INFO migrate.versioning.api [-] 224 -> 225...
2015-09-28 04:26:37.531 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:37.531 20105 INFO migrate.versioning.api [-] 225 -> 226...
2015-09-28 04:26:37.538 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:37.538 20105 INFO migrate.versioning.api [-] 226 -> 227...
2015-09-28 04:26:37.545 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:37.546 20105 INFO migrate.versioning.api [-] 227 -> 228...
2015-09-28 04:26:37.575 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:37.576 20105 INFO migrate.versioning.api [-] 228 -> 229...
2015-09-28 04:26:37.605 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:37.606 20105 INFO migrate.versioning.api [-] 229 -> 230...
2015-09-28 04:26:37.654 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:37.654 20105 INFO migrate.versioning.api [-] 230 -> 231...
2015-09-28 04:26:37.702 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:37.703 20105 INFO migrate.versioning.api [-] 231 -> 232...
2015-09-28 04:26:37.962 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:37.963 20105 INFO migrate.versioning.api [-] 232 -> 233...
2015-09-28 04:26:38.006 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:38.006 20105 INFO migrate.versioning.api [-] 233 -> 234...
2015-09-28 04:26:38.042 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:38.043 20105 INFO migrate.versioning.api [-] 234 -> 235...
2015-09-28 04:26:38.048 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:38.049 20105 INFO migrate.versioning.api [-] 235 -> 236...
2015-09-28 04:26:38.054 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:38.055 20105 INFO migrate.versioning.api [-] 236 -> 237...
2015-09-28 04:26:38.060 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:38.060 20105 INFO migrate.versioning.api [-] 237 -> 238...
2015-09-28 04:26:38.067 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:38.068 20105 INFO migrate.versioning.api [-] 238 -> 239...
2015-09-28 04:26:38.072 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:38.073 20105 INFO migrate.versioning.api [-] 239 -> 240...
2015-09-28 04:26:38.079 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:38.080 20105 INFO migrate.versioning.api [-] 240 -> 241...
2015-09-28 04:26:38.084 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:38.085 20105 INFO migrate.versioning.api [-] 241 -> 242...
2015-09-28 04:26:38.089 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:38.090 20105 INFO migrate.versioning.api [-] 242 -> 243...
2015-09-28 04:26:38.095 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:38.096 20105 INFO migrate.versioning.api [-] 243 -> 244...
2015-09-28 04:26:38.110 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:38.111 20105 INFO migrate.versioning.api [-] 244 -> 245...
2015-09-28 04:26:38.187 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:38.188 20105 INFO migrate.versioning.api [-] 245 -> 246...
2015-09-28 04:26:38.207 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:38.208 20105 INFO migrate.versioning.api [-] 246 -> 247...
2015-09-28 04:26:38.259 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:38.260 20105 INFO migrate.versioning.api [-] 247 -> 248...
2015-09-28 04:26:38.267 20105 INFO 248_add_expire_reservations_index [-] Skipped adding reservations_deleted_expire_idx because an equivalent index already exists.
2015-09-28 04:26:38.272 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:38.272 20105 INFO migrate.versioning.api [-] 248 -> 249...
2015-09-28 04:26:38.290 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:38.291 20105 INFO migrate.versioning.api [-] 249 -> 250...
2015-09-28 04:26:38.309 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:38.309 20105 INFO migrate.versioning.api [-] 250 -> 251...
2015-09-28 04:26:38.338 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:38.339 20105 INFO migrate.versioning.api [-] 251 -> 252...
2015-09-28 04:26:38.431 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:38.432 20105 INFO migrate.versioning.api [-] 252 -> 253...
2015-09-28 04:26:38.463 20105 INFO migrate.versioning.api [-] done
2015-09-28 04:26:38.464 20105 INFO migrate.versioning.api [-] 253 -> 254...
2015-09-28 04:26:38.498 20105 INFO migrate.versioning.api [-] done
root@OSCTRL-UA:~#

 

8. Create the nova users on keystone. So that Compute uses to authenticate with the Identity Service.

root@OSCTRL-UA:~# keystone user-create --name=nova --pass=nova123 --email=nova@unixarena.com
+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|  email   |        nova@unixarena.com        |
| enabled  |               True               |
|    id    | 0a8ef9375329415488361b4ea7267443 |
|   name   |               nova               |
| username |               nova               |
+----------+----------------------------------+
root@OSCTRL-UA:~#

 

9. Provide the admin role to the nova user.

root@OSCTRL-UA:~# keystone user-role-add --user=nova --tenant=service --role=admin
root@OSCTRL-UA:~#

 

10. Edit the nova.conf to update the keystone credentials that we create it .

Note: You need to add “auth_strategy = keystone” under [default] section in nova.conf.

root@OSCTRL-UA:~# grep keystone -A8 /etc/nova/nova.conf
auth_strategy = keystone
[keystone_authtoken]
auth_uri = http://OSCTRL-UA:5000
auth_host = OSCTRL-UA
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = nova
admin_password = nova123
root@OSCTRL-UA:~#

 

11. Register the compute service with identity service.

root@OSCTRL-UA:~# keystone service-create --name=nova --type=compute  --description="OpenStack Compute"
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |        OpenStack Compute         |
|   enabled   |               True               |
|      id     | 083b455a487647bbaa05a4a53b3a338f |
|     name    |               nova               |
|     type    |             compute              |
+-------------+----------------------------------+
root@OSCTRL-UA:~#

 

12. Create the end point service for nova.

root@OSCTRL-UA:~# keystone endpoint-create --service-id=$(keystone service-list | awk '/ compute / {print $2}') --publicurl=http://OSCTRL-UA:8774/v2/%\(tenant_id\)s --internalurl=http://OSCTRL-UA:8774/v2/%\(tenant_id\)s  --adminurl=http://OSCTRL-UA:8774/v2/%\(tenant_id\)s
+-------------+----------------------------------------+
|   Property  |                 Value                  |
+-------------+----------------------------------------+
|   adminurl  | http://OSCTRL-UA:8774/v2/%(tenant_id)s |
|      id     |    4e2f418ef1eb4083a655e0a4eb60b736    |
| internalurl | http://OSCTRL-UA:8774/v2/%(tenant_id)s |
|  publicurl  | http://OSCTRL-UA:8774/v2/%(tenant_id)s |
|    region   |               regionOne                |
|  service_id |    083b455a487647bbaa05a4a53b3a338f    |
+-------------+----------------------------------------+
root@OSCTRL-UA:~#

 

13. Restart the services.

root@OSCTRL-UA:~# service nova-api restart; service nova-cert restart; service nova-consoleauth restart; service nova-scheduler restart; service nova-conductor restart; service nova-novncproxy restart;
nova-api stop/waiting
nova-api start/running, process 20313
nova-cert stop/waiting
nova-cert start/running, process 20330
nova-consoleauth stop/waiting
nova-consoleauth start/running, process 20347
nova-scheduler stop/waiting
nova-scheduler start/running, process 20366
nova-conductor stop/waiting
nova-conductor start/running, process 20385
nova-novncproxy stop/waiting
nova-novncproxy start/running, process 20400
root@OSCTRL-UA:~#

 

Verify the service status,

 root@OSCTRL-UA:~# service nova-api status; service nova-cert status; service nova-consoleauth status; service nova-scheduler status; service nova-conductor status; service nova-novncproxy status
nova-api start/running, process 20313
nova-cert start/running, process 20330
nova-consoleauth start/running, process 20347
nova-scheduler start/running, process 20366
nova-conductor start/running, process 20385
nova-novncproxy start/running, process 20400
root@OSCTRL-UA:~#

 

14. You should be able to verify the nova configuration by listing the images.

root@OSCTRL-UA:~# nova image-list
+--------------------------------------+--------------+--------+--------+
| ID                                   | Name         | Status | Server |
+--------------------------------------+--------------+--------+--------+
| 7d19b639-6950-42dc-a64d-91c6662e0613 | CirrOS 0.3.0 | ACTIVE |        |
+--------------------------------------+--------------+--------+--------+
root@OSCTRL-UA:~#

 

We have successfully configured the compute configuration on the controller node.

Click page 2 to see the configuration on the Compute node.

VMTURBO-CLOUD-CAPACITY

2 comments

  1. can’t start nova-scheduler and nova-cert: attempt to write readonly database !

  2. I removed /var/lib/nova/nova.sqlite but is recreated

Leave a Reply

Your email address will not be published. Required fields are marked *