Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

Install and configure controller node

Contents


o Prerequisites
o Install and configure components
o Finalize installation

This section describes how to install and configure the Compute service, code-named nova, on the controller
node.

Prerequisites¶
Before you install and configure the Compute service, you must create databases, service credentials, and API
endpoints.

1. To create the databases, complete these steps:


o Use the database access client to connect to the database server as the root user:
o $ mysql -u root -p
o Create the nova_api and nova databases:
o CREATE DATABASE nova_api;
o CREATE DATABASE nova;
o Grant proper access to the databases:
o GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' \
o IDENTIFIED BY 'NOVA_DBPASS';
o GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' \
o IDENTIFIED BY 'NOVA_DBPASS';
o GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' \
o IDENTIFIED BY 'NOVA_DBPASS';
o GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' \
o IDENTIFIED BY 'NOVA_DBPASS';

Replace NOVA_DBPASS with a suitable password.

o Exit the database access client.


2. Source the admin credentials to gain access to admin-only CLI commands:
3. $ . admin-openrc
4. To create the service credentials, complete these steps:
o Create the nova user:
o $ openstack user create --domain default \
o --password-prompt nova
o User Password:
o Repeat User Password:
o +-----------+----------------------------------+
o | Field | Value |
o +-----------+----------------------------------+
o | domain_id | e0353a670a9e496da891347c589539e9 |
o | enabled | True |
o | id | 8c46e4760902464b889293a74a0c90a8 |
o | name | nova |
o +-----------+----------------------------------+
o Add the admin role to the nova user:
o $ openstack role add --project service --user nova admin
 

Note

This command provides no output.

o Create the nova service entity:


o $ openstack service create --name nova \
o --description "OpenStack Compute" compute
o +-------------+----------------------------------+
o | Field | Value |
o +-------------+----------------------------------+
o | description | OpenStack Compute |
o | enabled | True |
o | id | 060d59eac51b4594815603d75a00aba2 |
o | name | nova |
o | type | compute |
o +-------------+----------------------------------+
5. Create the Compute service API endpoints:
6. $ openstack endpoint create --region RegionOne \
7. compute public http://controller:8774/v2.1/%\(tenant_id\)s
8. +--------------+-------------------------------------------+
9. | Field | Value |
10. +--------------+-------------------------------------------+
11. | enabled | True |
12. | id | 3c1caa473bfe4390a11e7177894bcc7b |
13. | interface | public |
14. | region | RegionOne |
15. | region_id | RegionOne |
16. | service_id | e702f6f497ed42e6a8ae3ba2e5871c78 |
17. | service_name | nova |
18. | service_type | compute |
19. | url | http://controller:8774/v2.1/%(tenant_id)s |
20. +--------------+-------------------------------------------+
21.
22. $ openstack endpoint create --region RegionOne \
23. compute internal http://controller:8774/v2.1/%\(tenant_id\)s
24. +--------------+-------------------------------------------+
25. | Field | Value |
26. +--------------+-------------------------------------------+
27. | enabled | True |
28. | id | e3c918de680746a586eac1f2d9bc10ab |
29. | interface | internal |
30. | region | RegionOne |
31. | region_id | RegionOne |
32. | service_id | e702f6f497ed42e6a8ae3ba2e5871c78 |
33. | service_name | nova |
34. | service_type | compute |
35. | url | http://controller:8774/v2.1/%(tenant_id)s |
36. +--------------+-------------------------------------------+
37.
38. $ openstack endpoint create --region RegionOne \
39. compute admin http://controller:8774/v2.1/%\(tenant_id\)s
40. +--------------+-------------------------------------------+
41. | Field | Value |
42. +--------------+-------------------------------------------+
43. | enabled | True |
44. | id | 38f7af91666a47cfb97b4dc790b94424 |
45. | interface | admin |
46. | region | RegionOne |
47. | region_id | RegionOne |
48. | service_id | e702f6f497ed42e6a8ae3ba2e5871c78 |
49. | service_name | nova |
50. | service_type | compute |
51. | url | http://controller:8774/v2.1/%(tenant_id)s |
52. +--------------+-------------------------------------------+

Install and configure components¶


 
Note

Default configuration files vary by distribution. You might need to add these sections and options rather than
modifying existing sections and options. Also, an ellipsis (...) in the configuration snippets indicates potential
default configuration options that you should retain.

1. Install the packages:


2. # apt-get install nova-api nova-conductor nova-consoleauth \
3. nova-novncproxy nova-scheduler

2. Edit the /etc/nova/nova.conf file and complete the following actions:


o In the [DEFAULT] section, enable only the compute and metadata APIs:
o [DEFAULT]
o ...
o enabled_apis = osapi_compute,metadata
o In the [api_database] and [database] sections, configure database access:
o [api_database]
o ...
o connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova_api
o
o [database]
o ...
o connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova

Replace NOVA_DBPASS with the password you chose for the Compute databases.

o In the [DEFAULT] and [oslo_messaging_rabbit] sections, configure RabbitMQ message queue


access:
o [DEFAULT]
o ...
o rpc_backend = rabbit
o
o [oslo_messaging_rabbit]
o ...
o rabbit_host = controller
o rabbit_userid = openstack
o rabbit_password = RABBIT_PASS

Replace RABBIT_PASS with the password you chose for the openstack account in RabbitMQ.

o In the [DEFAULT] and [keystone_authtoken] sections, configure Identity service access:


o [DEFAULT]
o ...
o auth_strategy = keystone
o
o [keystone_authtoken]
o ...
o auth_uri = http://controller:5000
o auth_url = http://controller:35357
o memcached_servers = controller:11211
o auth_type = password
o project_domain_name = default
o user_domain_name = default
o project_name = service
o username = nova
o password = NOVA_PASS

Replace NOVA_PASS with the password you chose for the nova user in the Identity service.

Note

Comment out or remove any other options in the [keystone_authtoken] section.

o In the [DEFAULT] section, configure the my_ip option to use the management interface IP
address of the controller node:
o [DEFAULT]
o ...
o my_ip = 10.0.0.11
o In the [DEFAULT] section, enable support for the Networking service:
o [DEFAULT]
o ...
o use_neutron = True
o firewall_driver = nova.virt.firewall.NoopFirewallDriver

Note

By default, Compute uses an internal firewall driver. Since the Networking service includes a
firewall driver, you must disable the Compute firewall driver by using the
nova.virt.firewall.NoopFirewallDriver firewall driver.

o In the [vnc] section, configure the VNC proxy to use the management interface IP address of
the controller node:
o [vnc]
o ...
o vncserver_listen = $my_ip
o vncserver_proxyclient_address = $my_ip
o In the [glance] section, configure the location of the Image service API:
o [glance]
o ...
o api_servers = http://controller:9292
o In the [oslo_concurrency] section, configure the lock path:
o [oslo_concurrency]
o ...
o lock_path = /var/lib/nova/tmp
o Due to a packaging bug, remove the logdir option from the [DEFAULT] section.

3. Populate the Compute databases:


4. # su -s /bin/sh -c "nova-manage api_db sync" nova
5. # su -s /bin/sh -c "nova-manage db sync" nova
 

Note

Ignore any deprecation messages in this output.

Finalize installation¶
 Restart the Compute services:
 # service nova-api restart
 # service nova-consoleauth restart
 # service nova-scheduler restart
 # service nova-conductor restart
 # service nova-novncproxy restart

Install and configure controller node


updated: 2019-08-16 17:01

Contents


o Prerequisites
o Configure networking options
o Configure the metadata agent
o Configure Compute to use Networking
o Finalize installation

Prerequisites¶
Before you configure the OpenStack Networking (neutron) service, you must create a database, service
credentials, and API endpoints.

1. To create the database, complete these steps:


o Use the database access client to connect to the database server as the root user:
o $ mysql -u root -p
o Create the neutron database:
o CREATE DATABASE neutron;
o Grant proper access to the neutron database, replacing NEUTRON_DBPASS with a suitable
password:
o GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' \
o IDENTIFIED BY 'NEUTRON_DBPASS';
o GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' \
o IDENTIFIED BY 'NEUTRON_DBPASS';
oExit the database access client.
2. Source the admin credentials to gain access to admin-only CLI commands:
3. $ . admin-openrc
4. To create the service credentials, complete these steps:
o Create the neutron user:
o $ openstack user create --domain default --password-prompt neutron
o User Password:
o Repeat User Password:
o +-----------+----------------------------------+
o | Field | Value |
o +-----------+----------------------------------+
o | domain_id | e0353a670a9e496da891347c589539e9 |
o | enabled | True |
o | id | b20a6692f77b4258926881bf831eb683 |
o | name | neutron |
o +-----------+----------------------------------+
o Add the admin role to the neutron user:
o $ openstack role add --project service --user neutron admin

Note

This command provides no output.

o Create the neutron service entity:


o $ openstack service create --name neutron \
o --description "OpenStack Networking" network
o +-------------+----------------------------------+
o | Field | Value |
o +-------------+----------------------------------+
o | description | OpenStack Networking |
o | enabled | True |
o | id | f71529314dab4a4d8eca427e701d209e |
o | name | neutron |
o | type | network |
o +-------------+----------------------------------+
5. Create the Networking service API endpoints:
6. $ openstack endpoint create --region RegionOne \
7. network public http://controller:9696
8. +--------------+----------------------------------+
9. | Field | Value |
10. +--------------+----------------------------------+
11. | enabled | True |
12. | id | 85d80a6d02fc4b7683f611d7fc1493a3 |
13. | interface | public |
14. | region | RegionOne |
15. | region_id | RegionOne |
16. | service_id | f71529314dab4a4d8eca427e701d209e |
17. | service_name | neutron |
18. | service_type | network |
19. | url | http://controller:9696 |
20. +--------------+----------------------------------+
21.
22. $ openstack endpoint create --region RegionOne \
23. network internal http://controller:9696
24. +--------------+----------------------------------+
25. | Field | Value |
26. +--------------+----------------------------------+
27. | enabled | True |
28. | id | 09753b537ac74422a68d2d791cf3714f |
29. | interface | internal |
30. | region | RegionOne |
31. | region_id | RegionOne |
32. | service_id | f71529314dab4a4d8eca427e701d209e |
33. | service_name | neutron |
34. | service_type | network |
35. | url | http://controller:9696 |
36. +--------------+----------------------------------+
37.
38. $ openstack endpoint create --region RegionOne \
39. network admin http://controller:9696
40. +--------------+----------------------------------+
41. | Field | Value |
42. +--------------+----------------------------------+
43. | enabled | True |
44. | id | 1ee14289c9374dffb5db92a5c112fc4e |
45. | interface | admin |
46. | region | RegionOne |
47. | region_id | RegionOne |
48. | service_id | f71529314dab4a4d8eca427e701d209e |
49. | service_name | neutron |
50. | service_type | network |
51. | url | http://controller:9696 |
52. +--------------+----------------------------------+

Configure networking options¶


You can deploy the Networking service using one of two architectures represented by options 1 and 2.

Option 1 deploys the simplest possible architecture that only supports attaching instances to provider (external)
networks. No self-service (private) networks, routers, or floating IP addresses. Only the admin or other
privileged user can manage provider networks.

Option 2 augments option 1 with layer-3 services that support attaching instances to self-service networks. The
demo or other unprivileged user can manage self-service networks including routers that provide connectivity
between self-service and provider networks. Additionally, floating IP addresses provide connectivity to
instances using self-service networks from external networks such as the Internet.

Self-service networks typically use overlay networks. Overlay network protocols such as VXLAN include
additional headers that increase overhead and decrease space available for the payload or user data. Without
knowledge of the virtual network infrastructure, instances attempt to send packets using the default Ethernet
maximum transmission unit (MTU) of 1500 bytes. The Networking service automatically provides the correct
MTU value to instances via DHCP. However, some cloud images do not use DHCP or ignore the DHCP MTU
option and require configuration using metadata or a script.

 
Note

Option 2 also supports attaching instances to provider networks.

Choose one of the following networking options to configure services specific to it. Afterwards, return here and
proceed to Configure the metadata agent.

 Networking Option 1: Provider networks


 Networking Option 2: Self-service networks

Configure the metadata agent¶


The metadata agent provides configuration information such as credentials to instances.
 Edit the /etc/neutron/metadata_agent.ini file and complete the following actions:
o In the [DEFAULT] section, configure the metadata host and shared secret:
o [DEFAULT]
o ...
o nova_metadata_ip = controller
o metadata_proxy_shared_secret = METADATA_SECRET

Replace METADATA_SECRET with a suitable secret for the metadata proxy.

Configure Compute to use Networking¶


 Edit the /etc/nova/nova.conf file and perform the following actions:
o In the [neutron] section, configure access parameters, enable the metadata proxy, and configure
the secret:
o [neutron]
o ...
o url = http://controller:9696
o auth_url = http://controller:35357
o auth_type = password
o project_domain_name = default
o user_domain_name = default
o region_name = RegionOne
o project_name = service
o username = neutron
o password = NEUTRON_PASS
o
o service_metadata_proxy = True
o metadata_proxy_shared_secret = METADATA_SECRET

Replace NEUTRON_PASS with the password you chose for the neutron user in the Identity
service.

Replace METADATA_SECRET with the secret you chose for the metadata proxy.

Finalize installation¶
1. Populate the database:
2. # su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf \
3. --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron

Note

Database population occurs later for Networking because the script requires complete server and plug-in
configuration files.

4. Restart the Compute API service:


5. # service nova-api restart
6. Restart the Networking services.

For both networking options:

# service neutron-server restart


# service neutron-linuxbridge-agent restart
# service neutron-dhcp-agent restart
# service neutron-metadata-agent restart

For networking option 2, also restart the layer-3 service:

# service neutron-l3-agent restart

You might also like