How to Install and Configure OpenStack Nova

In this tutorial, How to Install and Configure the OpenStack compute ( Nova). In previous, My post has How to install OpenStack all in one Centos 7. If you have not yet installed OpenStack nova then step install as below

Step by step Install and Configure OpenStack Nova

Create a User and Database on MariaDB for Nova.

[root@DevopsRoles ~(keystone)]# mysql -u root -p 
MariaDB [(none)]> create database nova; 
MariaDB [(none)]> grant all privileges on nova.* to nova@'localhost' identified by 'password'; 
MariaDB [(none)]> grant all privileges on nova.* to nova@'%' identified by 'password';
MariaDB [(none)]> create database nova_api; 
MariaDB [(none)]> grant all privileges on nova_api.* to nova@'localhost' identified by 'password';
MariaDB [(none)]> grant all privileges on nova_api.* to nova@'%' identified by 'password';
MariaDB [(none)]> create database nova_placement; 
MariaDB [(none)]> grant all privileges on nova_placement.* to nova@'localhost' identified by 'password';
MariaDB [(none)]> grant all privileges on nova_placement.* to nova@'%' identified by 'password'; 
MariaDB [(none)]> create database nova_cell0;
MariaDB [(none)]> grant all privileges on nova_cell0.* to nova@'localhost' identified by 'password';
MariaDB [(none)]> grant all privileges on nova_cell0.* to nova@'%' identified by 'password'; 
MariaDB [(none)]> flush privileges; 
MariaDB [(none)]> exit

Add users and others for Nova in Keystone.

“>
# add nova user (set in service project)
[root@DevopsRoles ~(keystone)]# openstack user create --domain default --project service --password servicepassword nova 

# add nova user in admin role
[root@DevopsRoles ~(keystone)]# openstack role add --project service --user nova admin

# add placement user (set in service project)
[root@DevopsRoles ~(keystone)]# openstack user create --domain default --project service --password servicepassword placement

# add placement user in admin role
[root@DevopsRoles ~(keystone)]# openstack role add --project service --user placement admin

# add service entry for nova
[root@DevopsRoles ~(keystone)]# openstack service create --name nova --description "OpenStack Compute service" compute

# add service entry for placement
[root@DevopsRoles ~(keystone)]# openstack service create --name placement --description "OpenStack Compute Placement service" placement

# define keystone host
[root@DevopsRoles ~(keystone)]# export controller=10.0.2.15

# add endpoint for nova (public)
[root@DevopsRoles ~(keystone)]# openstack endpoint create --region RegionOne compute public http://$controller:8774/v2.1/%\(tenant_id\)s

# add endpoint for nova (internal)
[root@DevopsRoles ~(keystone)]# openstack endpoint create --region RegionOne compute internal http://$controller:8774/v2.1/%\(tenant_id\)s 

# add endpoint for nova (admin)
[root@DevopsRoles ~(keystone)]# openstack endpoint create --region RegionOne compute admin http://$controller:8774/v2.1/%\(tenant_id\)s 

# add endpoint for placement (public)
[root@DevopsRoles ~(keystone)]# openstack endpoint create --region RegionOne placement public http://$controller:8778 

# add endpoint for placement (internal)
[root@DevopsRoles ~(keystone)]# openstack endpoint create --region RegionOne placement internal http://$controller:8778 

# add endpoint for placement (admin)
[root@DevopsRoles ~(keystone)]# openstack endpoint create --region RegionOne placement admin http://$controller:8778 

Install OpenStack Nova.

# install from Stein, EPEL
[root@DevopsRoles ~(keystone)]# yum --enablerepo=centos-openstack-stein,epel -y install openstack-nova

Configure OpenStack Nova.

[root@DevopsRoles ~(keystone)]# mv /etc/nova/nova.conf /etc/nova/nova.conf.org 
[root@DevopsRoles ~(keystone)]# vi /etc/nova/nova.conf

# create new
[DEFAULT]
# define own IP
my_ip = 10.0.2.15
state_path = /var/lib/nova
enabled_apis = osapi_compute,metadata
log_dir = /var/log/nova
# RabbitMQ connection info
transport_url = rabbit://openstack:password@10.0.2.15

[api]
auth_strategy = keystone

# Glance connection info
[glance]
api_servers = http://10.0.2.15:9292

[oslo_concurrency]
lock_path = $state_path/tmp

# MariaDB connection info
[api_database]
connection = mysql+pymysql://nova:password@10.0.2.15/nova_api

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

# Keystone auth info
[keystone_authtoken]
www_authenticate_uri = http://10.0.2.15:5000
auth_url = http://10.0.2.15:5000
memcached_servers = 10.0.2.15:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = servicepassword

[placement]
auth_url = http://10.0.2.15:5000
os_region_name = RegionOne
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = placement
password = servicepassword

[placement_database]
connection = mysql+pymysql://nova:password@10.0.2.15/nova_placement

[wsgi]
api_paste_config = /etc/nova/api-paste.ini

[root@DevopsRoles ~(keystone)]# chmod 640 /etc/nova/nova.conf 
[root@DevopsRoles ~(keystone)]# chgrp nova /etc/nova/nova.conf 
[root@DevopsRoles ~(keystone)]# vi /etc/httpd/conf.d/00-nova-placement-api.conf
# add near line 15
  <Directory /usr/bin>
    Require all granted
  </Directory>
</VirtualHost>

If SELinux is enabled on Centos 7

[root@DevopsRoles ~(keystone)]# yum --enablerepo=centos-openstack-stein -y install openstack-selinux 
[root@DevopsRoles ~(keystone)]# semanage port -a -t http_port_t -p tcp 8778 

Allow ports for services with Firewalld is running

[root@DevopsRoles ~(keystone)]# firewall-cmd --add-port={6080/tcp,6081/tcp,6082/tcp,8774/tcp,8775/tcp,8778/tcp} --permanent
[root@DevopsRoles ~(keystone)]# firewall-cmd --reload

Add Data into Database

[root@DevopsRoles ~(keystone)]# su -s /bin/bash nova -c "nova-manage api_db sync"
[root@DevopsRoles ~(keystone)]# su -s /bin/bash nova -c "nova-manage cell_v2 map_cell0"
[root@DevopsRoles ~(keystone)]# su -s /bin/bash nova -c "nova-manage db sync"
[root@DevopsRoles ~(keystone)]# su -s /bin/bash nova -c "nova-manage cell_v2 create_cell --name cell1"
[root@DevopsRoles ~(keystone)]# systemctl restart httpd 
[root@DevopsRoles ~(keystone)]# chown nova. /var/log/nova/nova-placement-api.log

Start Nova services.

systemctl start openstack-nova-api openstack-nova-consoleauth openstack-nova-conductor openstack-nova-scheduler openstack-nova-novncproxy
systemctl enable openstack-nova-api openstack-nova-consoleauth openstack-nova-conductor openstack-nova-scheduler openstack-nova-novncproxy

show status

[root@DevopsRoles ~(keystone)]# openstack compute service list 

Install Nova Compute.

Your system has to install KVM HyperVisor.

# install from Stein, EPEL
[root@DevopsRoles ~(keystone)]# yum --enablerepo=centos-openstack-stein,epel -y install openstack-nova-compute

Add Optional to the following settings.

[root@DevopsRoles ~(keystone)]# vi /etc/nova/nova.conf
# add follows (enable VNC)
[vnc]
enabled = True
server_listen = 0.0.0.0
server_proxyclient_address = 10.0.2.15
novncproxy_base_url = http://10.0.2.15:6080/vnc_auto.html 

If SELinux is enabled on Centos 7

[root@DevopsRoles ~(keystone)]# yum --enablerepo=centos-openstack-stein -y install openstack-selinux 

Allow ports for services with Firewalld is running

[root@DevopsRoles ~(keystone)]# firewall-cmd --add-port=5900-5999/tcp --permanent 
[root@DevopsRoles ~(keystone)]# firewall-cmd --reload 

Start Nova Compute.

[root@DevopsRoles ~(keystone)]# systemctl start openstack-nova-compute 
[root@DevopsRoles ~(keystone)]# systemctl enable openstack-nova-compute
# discover Compute Node
[root@DevopsRoles ~(keystone)]# su -s /bin/bash nova -c "nova-manage cell_v2 discover_hosts"
# show status
[root@DevopsRoles ~(keystone)]# openstack compute service list 

You have to Install and Configure OpenStack Nova. Thank you for reading the DevopsRoles page!

, ,

About HuuPV

My name is Huu. I love technology and especially Devops Skill such as Docker, vagrant, git so forth. I likes open-sources. so I created DevopsRoles.com site to share the knowledge that I have learned. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.