Dieser Abschnitt beschreibt, wie der Compute-Dienst auf dem Controller-Node zu installieren und zu konfigurieren ist, der Codename lautet Nova.
Bevor Sie den Compute-Dienst installieren und konfigurieren, müssen Sie Datenbanken, Diensteanmeldeinformationen und API-Endpunkte erstellen.
Führen Sie diese Schritte zum Erstellen der Datenbanken aus:
Benutzen Sie den Datenbank-Client zur Verbindung zum Datenbank-Server als Benutzer root :
$ mysql -u root -p
Erstellen Sie die Datenbanken nova_api und nova:
CREATE DATABASE nova_api;
CREATE DATABASE nova;
Vergeben Sie die richtigen Zugriffsberechtigungen für die Datenbanken:
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' \
IDENTIFIED BY 'NOVA_DBPASS';
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' \
IDENTIFIED BY 'NOVA_DBPASS';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' \
IDENTIFIED BY 'NOVA_DBPASS';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' \
IDENTIFIED BY 'NOVA_DBPASS';
Ersetzen Sie NOVA_DBPASS durch ein geeignetes Passwort.
Beenden Sie den Datenbank-Client.
Sourcen Sie die admin Anmeldeinformationen, um Zugriff auf die Admin-Kommandos zu bekommen:
$ . admin-openrc
Um die Dienstanmeldeinformationen zu erstellen, vervollständigen Sie folgende Schritte:
Erstellen Sie den Benutzer nova:
$ openstack user create --domain default \
--password-prompt nova
User Password:
Repeat User Password:
+-----------+----------------------------------+
| Field | Value |
+-----------+----------------------------------+
| domain_id | e0353a670a9e496da891347c589539e9 |
| enabled | True |
| id | 8c46e4760902464b889293a74a0c90a8 |
| name | nova |
+-----------+----------------------------------+
Fügen Sie die Rolle admin zum Benutzer nova hinzu:
$ openstack role add --project service --user nova admin
Bemerkung
Das Kommando erzeugt keine Ausgabe.
Create the nova service entity:
$ openstack service create --name nova \
--description "OpenStack Compute" compute
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Compute |
| enabled | True |
| id | 060d59eac51b4594815603d75a00aba2 |
| name | nova |
| type | compute |
+-------------+----------------------------------+
Create the Compute service API endpoints:
$ openstack endpoint create --region RegionOne \
compute public http://controller:8774/v2.1/%\(tenant_id\)s
+--------------+-------------------------------------------+
| Field | Value |
+--------------+-------------------------------------------+
| enabled | True |
| id | 3c1caa473bfe4390a11e7177894bcc7b |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | e702f6f497ed42e6a8ae3ba2e5871c78 |
| service_name | nova |
| service_type | compute |
| url | http://controller:8774/v2.1/%(tenant_id)s |
+--------------+-------------------------------------------+
$ openstack endpoint create --region RegionOne \
compute internal http://controller:8774/v2.1/%\(tenant_id\)s
+--------------+-------------------------------------------+
| Field | Value |
+--------------+-------------------------------------------+
| enabled | True |
| id | e3c918de680746a586eac1f2d9bc10ab |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | e702f6f497ed42e6a8ae3ba2e5871c78 |
| service_name | nova |
| service_type | compute |
| url | http://controller:8774/v2.1/%(tenant_id)s |
+--------------+-------------------------------------------+
$ openstack endpoint create --region RegionOne \
compute admin http://controller:8774/v2.1/%\(tenant_id\)s
+--------------+-------------------------------------------+
| Field | Value |
+--------------+-------------------------------------------+
| enabled | True |
| id | 38f7af91666a47cfb97b4dc790b94424 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | e702f6f497ed42e6a8ae3ba2e5871c78 |
| service_name | nova |
| service_type | compute |
| url | http://controller:8774/v2.1/%(tenant_id)s |
+--------------+-------------------------------------------+
Bemerkung
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.
Installieren Sie die Pakete:
# zypper install openstack-nova-api openstack-nova-scheduler \
openstack-nova-conductor openstack-nova-consoleauth \
openstack-nova-novncproxy iptables
Bearbeiten Sie die Datei /etc/nova/nova.conf und führen folgende Schritte durch:
In the [DEFAULT] section, enable only the compute and metadata APIs:
[DEFAULT]
...
enabled_apis = osapi_compute,metadata
In the [api_database] and [database] sections, configure database access:
[api_database]
...
connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova_api
[database]
...
connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova
Replace NOVA_DBPASS with the password you chose for the Compute databases.
Konfigurieren Sie den RabbitMQ Nachrichtenwarteschlangen-Zugriff in den Sektionen [DEFAULT] und [oslo_messaging_rabbit] :
[DEFAULT]
...
rpc_backend = rabbit
[oslo_messaging_rabbit]
...
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS
Ersetzen Sie RABBIT_PASS mit dem Passwort, welches Sie für den openstack Account in RabbitMQ gewählt haben.
Konfigurieren Sie den Identitätsdienst-Zugriff in den Sektionen [DEFAULT] und [keystone_authtoken]:
[DEFAULT]
...
auth_strategy = keystone
[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = NOVA_PASS
Ersetzen Sie NOVA_PASS durch das Passwort, das Sie für den Benutzer nova im Identitätsdienst vergeben haben.
Bemerkung
Alle anderen Optionen in der Sektion [keystone_authtoken] müssen auskommentiert oder gelöscht werden.
Konfigurieren Sie in der Sektion [DEFAULT] die Option my_ip so, dass die IP-Adresse der Management-Schnittstelle des Controller Nodes genutzt wird.
[DEFAULT]
...
my_ip = 10.0.0.11
Aktivieren Sie die Unterstützung für den Netzwerkdienst in der [DEFAULT] Sektion:
[DEFAULT]
...
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
Bemerkung
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.
In the [vnc] section, configure the VNC proxy to use the management interface IP address of the controller node:
[vnc]
...
vncserver_listen = $my_ip
vncserver_proxyclient_address = $my_ip
Konfigurieren Sie den Ort der Abbilddienst API in der Sektion [glance]:
[glance]
...
api_servers = http://controller:9292
Konfigurieren Sie den Sperrpfad in der Sektion [oslo_concurrency]:
[oslo_concurrency]
...
lock_path = /var/run/nova
Start the Compute services and configure them to start when the system boots:
# systemctl enable openstack-nova-api.service \
openstack-nova-consoleauth.service openstack-nova-scheduler.service \
openstack-nova-conductor.service openstack-nova-novncproxy.service
# systemctl start openstack-nova-api.service \
openstack-nova-consoleauth.service openstack-nova-scheduler.service \
openstack-nova-conductor.service openstack-nova-novncproxy.service
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.