8.4. Install a Compute Node
8.4.1. Create the Compute Service Database
root user.
Procedure 8.5. Creating the Compute Service database
- Connect to the database service using the
mysqlcommand.#mysql -u root -p - Create the
novadatabase.mysql>CREATE DATABASE nova; - Create a
novadatabase user and grant it access to thenovadatabase.mysql>GRANT ALL ON nova.* TO 'nova'@'%' IDENTIFIED BY 'PASSWORD';mysql>GRANT ALL ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'PASSWORD';Replace PASSWORD with a secure password that will be used to authenticate with the database server as this user. - Flush the database privileges to ensure that they take effect immediately.
mysql>FLUSH PRIVILEGES; - Exit the
mysqlclient.mysql>quit
8.4.2. Configure Compute Service Authentication
- Create the
computeuser, who has theadminrole in theservicestenant. - Create the
computeservice entry and assign it an endpoint.
- Created an Administrator role named
admin(refer to Section 3.8, “Create an Administrator Account” for instructions) - Created the
servicestenant (refer to Section 3.10, “Create the Services Tenant” for instructions)
Note
keystonerc_admin file (which contains administrator credentials) and the keystone command-line utility is installed.
Procedure 8.6. Configuring the Compute Service to authenticate through the Identity Service
- Authenticate as the administrator of the Identity service by running the
sourcecommand on thekeystonerc_adminfile containing the required credentials:#source ~/keystonerc_admin - Create a user named
computefor the OpenStack Compute service to use:#keystone user-create --name compute --pass PASSWORD+----------+----------------------------------+ | Property | Value | +----------+----------------------------------+ | email | | | enabled | True | | id | 96cd855e5bfe471ce4066794bbafb615 | | name | compute | | tenantId | | +----------+----------------------------------+Replace PASSWORD with a secure password that will be used by the Compute service when authenticating against the Identity service. - Use the
keystone user-role-addcommand to link thecomputeuser,adminrole, andservicestenant together:#keystone user-role-add --user compute --role admin --tenant services - Create the
computeservice entry:#keystone service-create --name compute \--type compute \--description "OpenStack Compute Service"+-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | description | OpenStack Compute Service | | id | 8dea97f5ee254b309c1792d2bd821e59 | | name | compute | | type | compute | +-------------+----------------------------------+ - Create the
computeendpoint entry:#keystone endpoint-create \--service compute--publicurl "http://IP:8774/v2/\$(tenant_id)s" \--adminurl "http://IP:8774/v2/\$(tenant_id)s" \--internalurl "http://IP:8774/v2/\$(tenant_id)s"Replace IP with the IP address or host name of the system that will be acting as the compute node.
8.4.3. Install the Compute Service Packages
- openstack-nova-api
- Provides the OpenStack Compute API service. At least one node in the environment must host an instance of the API service. This must be the node pointed to by the Identity service endpoint definition for the Compute service.
- openstack-nova-compute
- Provides the OpenStack Compute service.
- openstack-nova-conductor
- Provides the Compute conductor service. The conductor handles database requests made by Compute nodes, ensuring that individual Compute nodes do not require direct database access. At least one node in each environment must act as a Compute conductor.
- openstack-nova-scheduler
- Provides the Compute scheduler service. The scheduler handles scheduling of requests made to the API across the available Compute resources. At least one node in each environment must act as a Compute scheduler.
- python-cinderclient
- Provides client utilities for accessing storage managed by the OpenStack Block Storage service. This package is not required if you do not intend to attach block storage volumes to your instances or you intend to manage such volumes using a service other than the OpenStack Block Storage service.
root user:
#yum install -y openstack-nova-api openstack-nova-compute \openstack-nova-conductor openstack-nova-scheduler \python-cinderclient
Note
8.4.4. Configure the Compute Service to Use SSL
nova.conf file to configure SSL.
Table 8.3. SSL options for Compute
| Configuration Option | Description |
|---|---|
enabled_ssl_apis
|
A list of APIs with enabled SSL.
|
ssl_ca_file
|
CA certificate file to use to verify connecting clients.
|
ssl_cert_file
|
SSL certificate of API server.
|
ssl_key_file
|
SSL private key of API server.
|
tcp_keepidle
|
Sets the value of TCP_KEEPIDLE in seconds for each server socket. Defaults to 600.
|
8.4.5. Configure the Compute Service
8.4.5.1. Configure Compute Service Authentication
root user.
Procedure 8.7. Configuring the Compute Service to authenticate through the Identity Service
- Set the authentication strategy (
auth_strategy) configuration key tokeystoneusing theopenstack-configcommand.#openstack-config --set /etc/nova/nova.conf \DEFAULT auth_strategy keystone - Set the authentication host (
auth_host) configuration key to the IP address or host name of the Identity server.#openstack-config --set /etc/nova/api-paste.ini \filter:authtoken auth_host IPReplace IP with the IP address or host name of the Identity server. - Set the administration tenant name (
admin_tenant_name) configuration key to the name of the tenant that was created for the use of the Compute service. In this guide, examples use services.#openstack-config --set /etc/nova/api-paste.ini \filter:authtoken admin_tenant_name services - Set the administration user name (
admin_user) configuration key to the name of the user that was created for the use of the Compute service. In this guide, examples use compute.#openstack-config --set /etc/nova/api-paste.ini \filter:authtoken admin_user compute - Set the administration password (
admin_password) configuration key to the password that is associated with the user specified in the previous step.#openstack-config --set /etc/nova/api-paste.ini \filter:authtoken admin_password PASSWORD
8.4.5.2. Configure the Compute Service Database Connection
/etc/nova/nova.conf file. It must be updated to point to a valid database server before starting the service.
openstack-nova-conductor). Compute nodes communicate with the conductor using the messaging infrastructure, the conductor in turn orchestrates communication with the database. As a result individual compute nodes do not require direct access to the database. This procedure only needs to be followed on nodes that will host the conductor service. There must be at least one instance of the conductor service in any compute environment.
root user on the server hosting the Compute service.
Procedure 8.8. Configuring the Compute Service SQL database connection
- Use the
openstack-configcommand to set the value of thesql_connectionconfiguration key.#openstack-config --set /etc/nova/nova.conf \DEFAULT sql_connection mysql://USER:PASS@IP/DBReplace:- USER with the database user name the Compute service is to use, usually
nova. - PASS with the password of the chosen database user.
- IP with the IP address or host name of the database server.
- DB with the name of the database that has been created for use by the compute, usually
nova.
Important
8.4.5.3. Configure RabbitMQ Message Broker Settings for the Compute Service
Procedure 8.9. Configuring the Compute service to use the RabbitMQ message broker
- Log in as
rootto the Compute controller node. - In
/etc/nova/nova.confof that system, set RabbitMQ as the RPC back end.#openstack-config --set /etc/nova/nova.conf \DEFAULT rpc_backend rabbit - Set the Compute service to connect to the RabbitMQ host:
#openstack-config --set /etc/nova/nova.conf \DEFAULT rabbit_host RABBITMQ_HOSTReplace RABBITMQ_HOST with the IP address or host name of the message broker. - Set the message broker port to
5672:#openstack-config --set /etc/nova/nova.conf \DEFAULT rabbit_port 5672 - Set the RabbitMQ username and password created for the Compute service:
#openstack-config --set /etc/nova/nova.conf \DEFAULT rabbit_userid nova#openstack-config --set /etc/nova/nova.conf \DEFAULT rabbit_password NOVA_PASSWherenovaand NOVA_PASS are the RabbitMQ username and password created for Compute (in Section 2.4.2, “Install and Configure the RabbitMQ Message Broker”).
8.4.5.4. Configure Resource Overcommitment
Important
- Default CPU overcommit ratio - 16
- Default memory overcommit ratio - 1.5
- The default CPU overcommit ratio of 16 means that up to 16 virtual cores can be assigned to a node for each physical core.
- The default memory overcommit ratio of 1.5 means that instances can be assigned to a physical node if the total instance memory usage is less than 1.5 times the amount of physical memory available.
cpu_allocation_ratio and ram_allocation_ratio directives in /etc/nova/nova.conf to change these default settings.
8.4.5.5. Reserve Host Resources
/etc/nova/nova.conf:
reserved_host_memory_mb- Defaults to 512MB.reserved_host_disk_mb- Defaults to 0MB.
8.4.5.6. Configure Compute Networking
8.4.5.6.1. Compute Networking Overview
nova-network service must not run. Instead all network related decisions are delegated to the OpenStack Networking Service.
nova-manage and nova to manage networks or IP addressing, including both fixed and floating IPs, is not supported with OpenStack Networking.
Important
nova-network and reboot any physical nodes that were running nova-network before using these nodes to run OpenStack Network. Problems can arise from inadvertently running the nova-network process while using OpenStack Networking service; for example, a previously running nova-network could push down stale firewall rules.
8.4.5.6.2. Update the Compute Configuration
root user.
Procedure 8.10. Updating the connection and authentication settings of Compute nodes
- Modify the
network_api_classconfiguration key to indicate that the OpenStack Networking service is in use.#openstack-config --set /etc/nova/nova.conf \DEFAULT network_api_class nova.network.neutronv2.api.API - Set the value of the
neutron_urlconfiguration key to point to the endpoint of the networking API.#openstack-config --set /etc/nova/nova.conf \DEFAULT neutron_url http://IP:9696/Replace IP with the IP address or host name of the server hosting the API of the OpenStack Networking service. - Set the value of the
neutron_admin_tenant_nameconfiguration key to the name of the tenant used by the OpenStack Networking service. Examples in this guide use services.#openstack-config --set /etc/nova/nova.conf \DEFAULT neutron_admin_tenant_name services - Set the value of the
neutron_admin_usernameconfiguration key to the name of the administrative user for the OpenStack Networking service. Examples in this guide use neutron.#openstack-config --set /etc/nova/nova.conf \DEFAULT neutron_admin_username neutron - Set the value of the
neutron_admin_passwordconfiguration key to the password associated with the administrative user for the networking service.#openstack-config --set /etc/nova/nova.conf \DEFAULT neutron_admin_password PASSWORD - Set the value of the
neutron_admin_auth_urlconfiguration key to the URL associated with the Identity service endpoint.#openstack-config --set /etc/nova/nova.conf \DEFAULT neutron_admin_auth_url http://IP:35357/v2.0Replace IP with the IP address or host name of the Identity service endpoint. - Set the value of the
security_group_apiconfiguration key toneutron.#openstack-config --set /etc/nova/nova.conf \DEFAULT security_group_api neutronThis enables the use of OpenStack Networking security groups. - Set the value of the
firewall_driverconfiguration key tonova.virt.firewall.NoopFirewallDriver.#openstack-config --set /etc/nova/nova.conf \DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriverThis must be done when OpenStack Networking security groups are in use.
8.4.5.6.3. Configure the L2 Agent
8.4.5.6.4. Configure Virtual Interface Plugging
nova-compute creates an instance, it must 'plug' each of the vNIC associated with the instance into a OpenStack Networking controlled virtual switch. Compute must also inform the virtual switch of the OpenStack Networking port identifier associated with each vNIC.
nova.virt.libvirt.vif.LibvirtGenericVIFDriver, is provided in Red Hat Enterprise Linux OpenStack Platform. This driver relies on OpenStack Networking being able to return the type of virtual interface binding required. The following plug-ins support this operation:
- Linux Bridge
- Open vSwitch
- NEC
- BigSwitch
- CloudBase Hyper-V
- Brocade
openstack-config command to set the value of the vif_driver configuration key appropriately:
#openstack-config --set /etc/nova/nova.conf \libvirt vif_driver \nova.virt.libvirt.vif.LibvirtGenericVIFDriver
Important
- Open vSwitch with security groups enabled, use the Open vSwitch specific driver,
nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver, instead of the generic driver. - Linux Bridge, you must add the following to the
/etc/libvirt/qemu.conffile to ensure that the virtual machine launches properly:user = "root" group = "root" cgroup_device_acl = [ "/dev/null", "/dev/full", "/dev/zero", "/dev/random", "/dev/urandom", "/dev/ptmx", "/dev/kvm", "/dev/kqemu", "/dev/rtc", "/dev/hpet", "/dev/net/tun", ]
8.4.5.7. Configure the Firewall to Allow Compute Service Traffic
5900 to 5999.
root user to the server hosting the Compute service and perform the following procedure:
Procedure 8.11. Configuring the firewall to allow Compute Service traffic (for Red Hat Enterprise Linux 6-based systems)
- Open the
/etc/sysconfig/iptablesfile in a text editor. - Add an INPUT rule allowing TCP traffic on ports in the ranges
5900to5999by adding the following line to the file.-A INPUT -p tcp -m multiport --dports 5900:5999 -j ACCEPT
The new rule must appear before any INPUT rules that REJECT traffic. - Save the changes to the
/etc/sysconfig/iptablesfile. - Restart the
iptablesservice to ensure that the change takes effect.#service iptables restart
Procedure 8.12. Configuring the firewall to allow Compute Service traffic (for Red Hat Enterprise Linux 7-based systems)
- Add a rule allowing TCP traffic on ports in the range
5900to5999:#firewall-cmd --permanent --add-port=5900-5999/tcp - For the change to take immediate effect, add the rule to the runtime mode:
#firewall-cmd --add-port=5900-5999/tcp
8.4.6. Populate the Compute Service Database
Important
Procedure 8.13. Populating the Compute Service database
- Log in to a system hosting an instance of the
openstack-nova-conductorservice. - Use the
sucommand to switch to thenovauser.#su nova -s /bin/sh - Run the
nova-manage db synccommand to initialize and populate the database identified in/etc/nova/nova.conf.$nova-manage db sync
8.4.7. Launch the Compute Services
Procedure 8.14. Launching Compute services
Starting the Message Bus Service
Libvirt requires that themessagebusservice be enabled and running.- Use the
servicecommand to start themessagebusservice.#service messagebus start - Use the
chkconfigcommand to enable themessagebusservice permanently.#chkconfig messagebus on
Starting the Libvirtd Service
The Compute service requires that thelibvirtdservice be enabled and running.- Use the
servicecommand to start thelibvirtdservice.#service libvirtd start - Use the
chkconfigcommand to enable thelibvirtdservice permanently.#chkconfig libvirtd on
Starting the API Service
Start the API service on each system that will be hosting an instance of it. Note that each API instance should either have its own endpoint defined in the Identity service database or be pointed to by a load balancer that is acting as the endpoint.- Use the
servicecommand to start theopenstack-nova-apiservice.#service openstack-nova-api start - Use the
chkconfigcommand to enable theopenstack-nova-apiservice permanently.#chkconfig openstack-nova-api on
Starting the Scheduler
Start the scheduler on each system that will be hosting an instance of it.- Use the
servicecommand to start theopenstack-nova-schedulerservice.#service openstack-nova-scheduler start - Use the
chkconfigcommand to enable theopenstack-nova-schedulerservice permanently.#chkconfig openstack-nova-scheduler on
Starting the Conductor
The conductor is intended to minimize or eliminate the need for Compute nodes to access the database directly. Compute nodes instead communicate with the conductor through a message broker and the conductor handles database access.Start the conductor on each system that is intended to host an instance of it. Note that it is recommended that this service is not run on each and every Compute node as this eliminates the security benefits of restricting direct database access from the Compute nodes.- Use the
servicecommand to start theopenstack-nova-conductorservice.#service openstack-nova-conductor start - Use the
chkconfigcommand to enable theopenstack-nova-conductorservice permanently.#chkconfig openstack-nova-conductor on
Starting the Compute Service
Start the Compute service on every system that is intended to host virtual machine instances.- Use the
servicecommand to start theopenstack-nova-computeservice.#service openstack-nova-compute start - Use the
chkconfigcommand to enable theopenstack-nova-computeservice permanently.#chkconfig openstack-nova-compute on
Starting Optional Services
Depending on environment configuration you may also need to start these services:openstack-nova-cert- The X509 certificate service, required if you intend to use the EC2 API to the Compute service.
Note
If you intend to use the EC2 API to the Compute service, you need to set the options in thenova.confconfiguration file. For more information, see Configuring the EC2 API section in the Red Hat Enterprise Linux OpenStack Platform Configuration Reference Guide. This document is available from the following link: openstack-nova-network- The Nova networking service. Note that you must not start this service if you have installed and configured, or intend to install and configure, OpenStack Networking.
openstack-nova-objectstore- The Nova object storage service. It is recommended that the OpenStack Object Storage service (Swift) is used for new deployments.