Install Compute controller servicesCompute is a collection of services that enable you to launch
virtual machine instances. You can configure these services to run
on separate nodes or the same node. In this guide, most services
run on the controller node and the service that launches virtual
machines runs on a dedicated compute node. This section shows you
how to install and configure these services on the controller
node.Install the
openstack-nova meta-package, which
installs various Compute packages that are used on the
controller node.#yum install openstack-nova python-novaclientInstall these Compute
packages, which provide the Compute services that run on the
controller node.#apt-get install nova-novncproxy novnc nova-api \
nova-ajax-console-proxy nova-cert nova-conductor \
nova-consoleauth nova-doc nova-scheduler \
python-novaclient#apt-get install nova-consoleproxy nova-api \
nova-cert nova-conductor nova-consoleauth \
nova-scheduler python-novaclient#zypper install openstack-nova-api openstack-nova-scheduler \
openstack-nova-cert openstack-nova-conductor openstack-nova-console \
openstack-nova-consoleauth openstack-nova-doc \
openstack-nova-novncproxy python-novaclientRespond to the prompts for database
management, [keystone_authtoken] settings,
RabbitMQ
credentials, and API endpoint registration. The nova-manage
db sync command runs automatically.Compute stores information in a database. In this guide, we
use a MySQL database on the controller node. Configure Compute
with the database location and credentials. Replace
NOVA_DBPASS with the password for the
database that you will create in a later step.#openstack-config --set /etc/nova/nova.conf \
database connection mysql://nova:NOVA_DBPASS@controller/novaEdit the [database] section
in the /etc/nova/nova.conf file to modify this
key:
[database]
connection = mysql://nova:NOVA_DBPASS@controller/novaSet these configuration keys to configure Compute to use
the Qpid message broker:#openstack-config --set /etc/nova/nova.conf \
DEFAULT rpc_backend nova.openstack.common.rpc.impl_qpid#openstack-config --set /etc/nova/nova.conf DEFAULT qpid_hostname controllerConfigure the Compute Service to use the RabbitMQ message broker by
setting these configuration keys in the [DEFAULT]
configuration group of the /etc/nova/nova.conf
file:rpc_backend = nova.rpc.impl_kombu
rabbit_host = controller
rabbit_password = RABBIT_PASSSet these configuration keys to configure Compute to use
the RabbitMQ message broker:#openstack-config --set /etc/nova/nova.conf \
DEFAULT rpc_backend nova.rpc.impl_kombu#openstack-config --set /etc/nova/nova.conf DEFAULT rabbit_host controller#openstack-config --set /etc/nova/nova.conf DEFAULT rabbit_password RABBIT_PASSRun the openstack-db command to create
the Compute service database and tables and a
nova database user.#openstack-db --init --service nova --password NOVA_DBPASSBy default, the Ubuntu packages create an SQLite database.
Delete the nova.sqlite file created in
the /var/lib/nova/ directory so that it
does not get used by mistake.Use the password you created previously to log in as root.
Create a nova database user:#mysql -u root -pmysql>CREATE DATABASE nova;mysql>GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' \
IDENTIFIED BY 'NOVA_DBPASS';mysql>GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' \
IDENTIFIED BY 'NOVA_DBPASS';Create the Compute service tables:#nova-manage db syncSet the ,
, and
configuration options to the internal IP address of the
controller node:#openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 192.168.0.10#openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_listen 192.168.0.10#openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_proxyclient_address 192.168.0.10Edit the
/etc/nova/nova.conf file and add these
lines to the [DEFAULT] section:In Debian, the debconf
package automatically sets up my_ip
parameter but you must edit the
/etc/nova/nova.conf file to configure
the and
options,
which appear at the end of the file:...
[DEFAULT]
...
my_ip=192.168.0.10
vncserver_listen=192.168.0.10
vncserver_proxyclient_address=192.168.0.10Create a nova user that Compute uses to
authenticate with the Identity Service. Use the
service tenant and give the user the
admin role:#keystone user-create --name=nova --pass=NOVA_PASS --email=nova@example.com#keystone user-role-add --user=nova --tenant=service --role=adminConfigure Compute to use these credentials with the Identity
Service running on the controller. Replace
NOVA_PASS with your Compute password.#openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone#openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_host controller#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 service#openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_password NOVA_PASSEdit the [DEFAULT] section
in the /etc/nova/nova.conf file to add this
key:
[DEFAULT]
...
auth_strategy=keystoneAdd these keys to the
[keystone_authtoken] section:
[keystone_authtoken]
...
auth_host = controller
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = nova
admin_password = NOVA_PASSAdd the credentials to the
/etc/nova/api-paste.ini file. Add these
options to the [filter:authtoken]
section:Use of .ini filesYou might sometimes have to edit .ini files
during initial setup. However,
do not edit these files for general configuration tasks.[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_host = controller
auth_port = 35357
auth_protocol = http
auth_uri = http://controller:5000/v2.0
admin_tenant_name = service
admin_user = nova
admin_password = NOVA_PASSEnsure that the
option is set in the
/etc/nova/nova.conf file.You must register Compute with the Identity Service so
that other OpenStack services can locate it. Register the
service and specify the endpoint:#keystone service-create --name=nova --type=compute \
--description="Nova Compute service"#keystone endpoint-create \
--service-id=$(keystone service-list | awk '/ compute / {print $2}') \
--publicurl=http://controller:8774/v2/%\(tenant_id\)s \
--internalurl=http://controller:8774/v2/%\(tenant_id\)s \
--adminurl=http://controller:8774/v2/%\(tenant_id\)sStart Compute
services and configure them to start when the system
boots:Restart 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#service openstack-nova-api start#service openstack-nova-cert start#service openstack-nova-consoleauth start#service openstack-nova-scheduler start#service openstack-nova-conductor start#service openstack-nova-novncproxy start#chkconfig openstack-nova-api on#chkconfig openstack-nova-cert on#chkconfig openstack-nova-consoleauth on#chkconfig openstack-nova-scheduler on#chkconfig openstack-nova-conductor on#chkconfig openstack-nova-novncproxy onTo verify your configuration, list available
images:#nova image-list+--------------------------------------+-----------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+-----------------+--------+--------+
| acafc7c0-40aa-4026-9673-b879898e1fc2 | CirrOS 0.3.1 | ACTIVE | |
+--------------------------------------+-----------------+--------+--------+