Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Production Ready OpenStack - Recipes for Successful Environments

You're reading from   Production Ready OpenStack - Recipes for Successful Environments Production Ready OpenStack - Recipes for Successful Environments

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher Packt
ISBN-13 9781783986903
Length 210 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Arthur Berezin Arthur Berezin
Author Profile Icon Arthur Berezin
Arthur Berezin
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Introduction to OpenStack and its Deployment Using Packages FREE CHAPTER 2. Deploying OpenStack Using Staypuft OpenStack Installer 3. Deploying Highly Available OpenStack 4. Keystone Identity Service 5. Glance Image Service 6. Cinder Block Storage Service 7. Neutron Networking Service 8. Nova-Compute Service 9. Horizon Dashboard Service Index

Installing Nova – Compute service

Nova-Compute service implements the compute service, which is the main part of an IaaS cloud. Nova is responsible for launching and managing instance of virtual machines. The compute service scales horizontally on standard hardware.

Getting ready

In our environment, we deploy a Controller/Computes layout. In the first step, we need to configure management services on the controller node and only then to add compute nodes to the environment. On the controller node, first we need to prepare the database, create a Keystone account, then open the needed firewall ports.

Run the following steps on the controller node!

Create database

  1. Access the database instance using MySQL command:
    [root@controller ~]# mysql -u root -p
    
  2. Create Nova database:
    MariaDB [(none)]> CREATE DATABASE nova_db;
    
  3. Create Nova credentials and allow access:
    MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_db.* TO 'nova_db_user'@'localhost' IDENTIFIED BY 'nova_db_password';
    MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_db.* TO 'nova_db_user'@'%' IDENTIFIED BY 'nova_db_password';
    
  4. Create Nova database tables:
    [root@controller ~]# su -s /bin/sh -c "nova-manage db sync" nova
    

Create Keystone service credentials and endpoint

  1. Create Nova service account in Keystone:
    [root@controller ~]# keystone user-create --name=nova --pass=nova_password
    [root@controller ~]# keystone user-role-add --user=nova --tenant=services --role=admin
    
  2. Create an endpoint for Nova
    [root@controller ~]# keystone endpoint-create --service=nova--publicurl=http://10.10.0.1:8774/v2/%\(tenant_id\) |--internalurl=http://10.10.0.1:8774/v2/%\(tenant_id\s --adminurl=http://10.10.0.1:8774/v2/%\(tenant_id\)s
    

Open service firewall ports

  1. Add firewall rules:
    [root@controller ~]# firewall-cmd --permanent --add-port=8774/tcp
    [root@controller ~]# firewall-cmd --permanent --add-port=6080/tcp
    [root@controller ~]# firewall-cmd --permanent --add-port=6081/tcp
    [root@controller ~]# firewall-cmd --permanent --add-port=5900-5999/tcp
    
  2. Reload firewall rules to take effect:
    [root@controller ~]# firewall-cmd --reload
    

Install service packages

Install service packages using yum command:

[root@controller ~]# yum install -y openstack-nova-api openstack-nova-cert openstack-nova-conductor  openstack-nova-console openstack-nova-novncproxy penstack-nova-scheduler python-novaclient

How to do it...

Follow these steps to configure Nova-Compute service:

Configure database connection

Using openstack-config command, we need to set the connection to the database:

[root@controller ~]# openstack-config --set /etc/nova/nova.conf database connection mysql://nova_db_user:nova_db_password@controller/nova_db
[root@controller ~]# su -s /bin/sh -c "nova-manage db sync" nova

Configure message broker

Set connection to RabbitMQ message broker:

[root@controller ~]# openstack-config --set /etc/nova/nova.conf DEFAULT rpc_backend rabbit
[root@controller ~]# openstack-config --set /etc/nova/nova.conf DEFAULT rabbit_host 10.10.0.1

Configure service

  1. Set local IP address of the controller:
    # openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 10.10.0.1
    # openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_listen 10.10.0.1
    # openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_proxyclient_address 10.10.0.1
    
  2. Configure Keystone as an authentication method:
    # openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone
    # openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_uri http://10.10.0.1:5000
    # openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_host 10.10.0.1
    # openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_protocol http
    # openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_port 35357
    # openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_user nova
    # openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_tenant_name services
    # openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_password nova_password
    

Start and enable Service

Using systemctl command, we can start and enable the service so that it starts after reboot:

[root@controller ~]# systemctl start openstack-nova-api
[root@controller ~]# systemctl start openstack-nova-cert
[root@controller ~]# systemctl start openstack-nova-consoleauth
[root@controller ~]# systemctl start openstack-nova-scheduler
[root@controller ~]# systemctl start openstack-nova-conductor
[root@controller ~]# systemctl start openstack-nova-novncproxy
[root@controller ~]# systemctl enable openstack-nova-api
[root@controller ~]# systemctl enable openstack-nova-cert
[root@controller ~]# systemctl enable openstack-nova-consoleauth
[root@controller ~]# systemctl enable openstack-nova-scheduler
[root@controller ~]# systemctl enable openstack-nova-conductor
[root@controller ~]# systemctl enable openstack-nova-novncproxy

Verify successful installation

On successful Nova installation and configuration, you should be able to execute this:

[root@el7-icehouse-controller ~(keystone_admin)]# nova image-list
+-------------------+---------------------+--------+--------+
| ID                | Name                | Status | Server |
+-------------------+---------------------+--------+--------+
| eb9c6911-...      | cirros-0.3.2-x86_64 | ACTIVE |        |
+-------------------+---------------------+--------+--------+

After the controller node is successfully installed and configured, we may add additional compute nodes to the OpenStack environment.

Configure compute nodes

Now we can proceed and configure the compute services on the compute node.

Run the following steps on the compute node!

Install service packages

Using yum command, install Nova-Compute package:

# yum install openstack-nova-compute

Configure database connection

Configure the Nova database connection:

[root@compute1 ~]# openstack-config --set /etc/nova/nova.conf database connection mysql://nova_db_user:nova_db_password@controller/nova_db

Configure message broker

Configure Nova to access the message broker:

[root@compute1 ~]# openstack-config --set /etc/nova/nova.conf DEFAULT rpc_backend rabbit
[root@compute1 ~]# openstack-config --set /etc/nova/nova.conf DEFAULT rabbit_host 10.10.0.1

Configure service

  1. Edit /etc/nova/nova.conf for the compute node to use Keystone authentication:
    [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone
    [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_uri http://controller:5000
    [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_host controller
    [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_protocol http
    [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_port 35357
    [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_user nova
    [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_tenant_name service
    [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_password nova_password
    
  2. Configure the remote console for instances terminal access:
    [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf
    DEFAULT my_ip 192.168.200.159
    [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf
    DEFAULT vnc_enabled True
    [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf DE
    \FAULT vncserver_listen 0.0.0.0
    [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_proxyclient_address 192.168.200.159
    [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf \DEFAULT novncproxy_base_url http://controller:6080/vnc_auto.html
    
  3. Configure which glance service to use to retrieve images:
    [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf DEFAULT glance_host controller
    

    Note

    If you are installing the compute node on a virtual machine, configure Nova to the user QEMU emulation instated of the default KVM backend. To configure QEMU, run the following command:

    [root@compute1 ~]# openstack-config --set /etc/nova/nova.conf libvirt virt_type qemu

Start and enable Service

Using systemctl command, start and enable the service:

[root@compute1 ~]# systemctl start libvirtd
[root@compute1 ~]# systemctl start openstack-nova-compute
[root@compute1 ~]# systemctl enable libvirtd
[root@compute1 ~]# systemctl enable openstack-nova-compute
You have been reading a chapter from
Production Ready OpenStack - Recipes for Successful Environments
Published in: Oct 2015
Publisher: Packt
ISBN-13: 9781783986903
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image