Files
openstack-manuals/doc/install-guide/source/nova-controller-install.rst
chenxing bac986bd46 [install] Add one step to make Placement service running
The placement service was configured with the 00-nova-placement-api.conf
file. We need restart the httpd to enable configuration.

Change-Id: I485e1bba6b8d39d29f4c741308e4d7d79b001536
Closes-Bug: #1688646
2017-05-07 15:18:03 +00:00

24 KiB

Install and configure controller node

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:

    ubuntu

    • Use the database access client to connect to the database server as the root user:

      # mysql

    rdo or debian or obs

    • Use the database access client to connect to the database server as the root user:

      $ mysql -u root -p
    • Create the nova_api, nova, and nova_cell0 databases:

      MariaDB [(none)]> CREATE DATABASE nova_api;
      MariaDB [(none)]> CREATE DATABASE nova;
      MariaDB [(none)]> CREATE DATABASE nova_cell0;
    • Grant proper access to the databases:

      MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' \
        IDENTIFIED BY 'NOVA_DBPASS';
      MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' \
        IDENTIFIED BY 'NOVA_DBPASS';
      
      MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' \
        IDENTIFIED BY 'NOVA_DBPASS';
      MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' \
        IDENTIFIED BY 'NOVA_DBPASS';
      
      MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' \
        IDENTIFIED BY 'NOVA_DBPASS';
      MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' \
        IDENTIFIED BY 'NOVA_DBPASS';

      Replace NOVA_DBPASS with a suitable password.

    • Exit the database access client.

  2. Source the admin credentials to gain access to admin-only CLI commands:

    $ . admin-openrc
  3. Create the Compute service credentials:

    • Create the nova user:

      $ openstack user create --domain default --password-prompt nova
      
      User Password:
      Repeat User Password:
      +---------------------+----------------------------------+
      | Field               | Value                            |
      +---------------------+----------------------------------+
      | domain_id           | default                          |
      | enabled             | True                             |
      | id                  | 8a7dbf5279404537b1c7b86c033620fe |
      | name                | nova                             |
      | options             | {}                               |
      | password_expires_at | None                             |
      +---------------------+----------------------------------+
    • Add the admin role to the nova user:

      $ openstack role add --project service --user nova admin

      Note

      This command provides no output.

    • 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                          |
      +-------------+----------------------------------+
  4. Create the Compute API service endpoints:

    $ openstack endpoint create --region RegionOne \
      compute public http://controller:8774/v2.1
    
    +--------------+-------------------------------------------+
    | Field        | Value                                     |
    +--------------+-------------------------------------------+
    | enabled      | True                                      |
    | id           | 3c1caa473bfe4390a11e7177894bcc7b          |
    | interface    | public                                    |
    | region       | RegionOne                                 |
    | region_id    | RegionOne                                 |
    | service_id   | 060d59eac51b4594815603d75a00aba2          |
    | service_name | nova                                      |
    | service_type | compute                                   |
    | url          | http://controller:8774/v2.1               |
    +--------------+-------------------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      compute internal http://controller:8774/v2.1
    
    +--------------+-------------------------------------------+
    | Field        | Value                                     |
    +--------------+-------------------------------------------+
    | enabled      | True                                      |
    | id           | e3c918de680746a586eac1f2d9bc10ab          |
    | interface    | internal                                  |
    | region       | RegionOne                                 |
    | region_id    | RegionOne                                 |
    | service_id   | 060d59eac51b4594815603d75a00aba2          |
    | service_name | nova                                      |
    | service_type | compute                                   |
    | url          | http://controller:8774/v2.1               |
    +--------------+-------------------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      compute admin http://controller:8774/v2.1
    
    +--------------+-------------------------------------------+
    | Field        | Value                                     |
    +--------------+-------------------------------------------+
    | enabled      | True                                      |
    | id           | 38f7af91666a47cfb97b4dc790b94424          |
    | interface    | admin                                     |
    | region       | RegionOne                                 |
    | region_id    | RegionOne                                 |
    | service_id   | 060d59eac51b4594815603d75a00aba2          |
    | service_name | nova                                      |
    | service_type | compute                                   |
    | url          | http://controller:8774/v2.1               |
    +--------------+-------------------------------------------+
  5. Create a Placement service user using your chosen PLACEMENT_PASS:

    $ openstack user create --domain default --password-prompt placement
    
    User Password:
    Repeat User Password:
    +---------------------+----------------------------------+
    | Field               | Value                            |
    +---------------------+----------------------------------+
    | domain_id           | default                          |
    | enabled             | True                             |
    | id                  | fa742015a6494a949f67629884fc7ec8 |
    | name                | placement                        |
    | options             | {}                               |
    | password_expires_at | None                             |
    +---------------------+----------------------------------+
  6. Add the Placement user to the service project with the admin role:

    $ openstack role add --project service --user placement admin

    Note

    This command provides no output.

  7. Create the Placement API entry in the service catalog:

    $ openstack service create --name placement --description "Placement API" placement
    +-------------+----------------------------------+
    | Field       | Value                            |
    +-------------+----------------------------------+
    | description | Placement API                    |
    | enabled     | True                             |
    | id          | 2d1a27022e6e4185b86adac4444c495f |
    | name        | placement                        |
    | type        | placement                        |
    +-------------+----------------------------------+
  8. Create the Placement API service endpoints:

    $ openstack endpoint create --region RegionOne placement public http://controller:8778
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | 2b1b2637908b4137a9c2e0470487cbc0 |
    | interface    | public                           |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | 2d1a27022e6e4185b86adac4444c495f |
    | service_name | placement                        |
    | service_type | placement                        |
    | url          | http://controller:8778           |
    +--------------+----------------------------------+
    
    $ openstack endpoint create --region RegionOne placement internal http://controller:8778
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | 02bcda9a150a4bd7993ff4879df971ab |
    | interface    | internal                         |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | 2d1a27022e6e4185b86adac4444c495f |
    | service_name | placement                        |
    | service_type | placement                        |
    | url          | http://controller:8778           |
    +--------------+----------------------------------+
    
    $ openstack endpoint create --region RegionOne placement admin http://controller:8778
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | 3d71177b9e0f406f98cbff198d74b182 |
    | interface    | admin                            |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | 2d1a27022e6e4185b86adac4444c495f |
    | service_name | placement                        |
    | service_type | placement                        |
    | url          | http://controller:8778           |
    +--------------+----------------------------------+

Install and configure components

obs

Note

As of the Newton release, SUSE OpenStack packages are shipped with the upstream default configuration files. For example, /etc/nova/nova.conf has customizations in /etc/nova/nova.conf.d/010-nova.conf. While the following instructions modify the default configuration file, adding a new file in /etc/nova/nova.conf.d achieves the same result.

obs

  1. Install the packages:

    # zypper install openstack-nova-api openstack-nova-scheduler \
      openstack-nova-conductor openstack-nova-consoleauth \
      openstack-nova-novncproxy openstack-nova-placement-api \
      iptables

rdo

  1. Install the packages:

    # yum install openstack-nova-api openstack-nova-conductor \
      openstack-nova-console openstack-nova-novncproxy \
      openstack-nova-scheduler openstack-nova-placement-api

ubuntu

  1. Install the packages:

    # apt install nova-api nova-conductor nova-consoleauth \
      nova-novncproxy nova-scheduler nova-placement-api

debian

  1. Install the packages:

    # apt install nova-api nova-conductor nova-consoleauth \
      nova-consoleproxy nova-scheduler

    Note

    nova-api-metadata is included in the nova-api package, and can be selected through debconf.

    Note

    A unique nova-consoleproxy package provides the nova-novncproxy, nova-spicehtml5proxy, and nova-xvpvncproxy packages. To select packages, edit the /etc/default/nova-consoleproxy file or use the debconf interface. You can also manually edit the /etc/default/nova-consoleproxy file, and stop and start the console daemons.

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

    rdo or obs

    • 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.

    • In the [DEFAULT] section, configure RabbitMQ message queue access:

      [DEFAULT]
      # ...
      transport_url = rabbit://openstack:RABBIT_PASS@controller

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

    • In the [api] and [keystone_authtoken] sections, configure Identity service access:

      [api]
      # ...
      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

      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.

    • In the [DEFAULT] section, configure the my_ip option to use the management interface IP address of the controller node:

      [DEFAULT]
      # ...
      my_ip = 10.0.0.11

obs or rdo or ubuntu

  • In the [DEFAULT] section, enable support for the Networking service:

    [DEFAULT]
    # ...
    use_neutron = True
    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.

  • In the [vnc] section, configure the VNC proxy to use the management interface IP address of the controller node:

    [vnc]
    enabled = true
    # ...
    vncserver_listen = $my_ip
    vncserver_proxyclient_address = $my_ip

debian

  • In the [spice] section, disable spice:

    [spice]
    enabled = false
  • In the [glance] section, configure the location of the Image service API:

    [glance]
    # ...
    api_servers = http://controller:9292

obs

  • In the [oslo_concurrency] section, configure the lock path:
[oslo_concurrency]
# ...
lock_path = /var/run/nova

rdo

  • In the [oslo_concurrency] section, configure the lock path:

    [oslo_concurrency]
    # ...
    lock_path = /var/lib/nova/tmp

ubuntu

  • In the [oslo_concurrency] section, configure the lock path:

    [oslo_concurrency]
    # ...
    lock_path = /var/lib/nova/tmp

ubuntu

https://bugs.launchpad.net/ubuntu/+source/nova/+bug/1506667

  • Due to a packaging bug, remove the log_dir option from the [DEFAULT] section.
  • In the [placement] section, configure the Placement API:

    [placement]
    # ...
    os_region_name = RegionOne
    project_domain_name = Default
    project_name = service
    auth_type = password
    user_domain_name = Default
    auth_url = http://controller:35357/v3
    username = placement
    password = PLACEMENT_PASS

    Replace PLACEMENT_PASS with the password you choose for the placement user in the Identity service. Comment out any other options in the [placement] section.

rdo

  • Due to a packaging bug, you must enable access to the Placement API by adding the following configuration to /etc/httpd/conf.d/00-nova-placement-api.conf:

    <Directory /usr/bin>
       <IfVersion >= 2.4>
          Require all granted
       </IfVersion>
       <IfVersion < 2.4>
          Order allow,deny
          Allow from all
       </IfVersion>
    </Directory>
  • Restart the httpd service:

    # systemctl restart httpd

rdo or ubuntu or debian or obs

  1. Populate the nova-api database:

    # su -s /bin/sh -c "nova-manage api_db sync" nova

    Note

    Ignore any deprecation messages in this output.

  2. Register the cell0 database:

    # su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
  3. Create the cell1 cell:

    # su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
    109e1d4b-536a-40d0-83c6-5f121b82b650
  4. Populate the nova database:

    # su -s /bin/sh -c "nova-manage db sync" nova
  5. Verify nova cell0 and cell1 are registered correctly:

    # nova-manage cell_v2 list_cells
    +-------+--------------------------------------+
    | Name  | UUID                                 |
    +-------+--------------------------------------+
    | cell1 | 109e1d4b-536a-40d0-83c6-5f121b82b650 |
    | cell0 | 00000000-0000-0000-0000-000000000000 |
    +-------+--------------------------------------+

Finalize installation

obs

  • Enable the placement API Apache vhost:

    # mv /etc/apache2/vhosts.d/nova-placement-api.conf.sample /etc/apache2/vhosts.d/nova-placement-api.conf
    # systemctl reload apache2.service
  • 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

rdo

  • 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

debian

  • Shutdown nova-spicehtml5proxy:

    # service nova-spicehtml5proxy stop
  • Select novnc startup in /etc/default/nova-consoleproxy:

    NOVA_CONSOLE_PROXY_TYPE=novnc
  • Add a systemd service file for nova-novncproxy in /lib/systemd/system/nova-novncproxy.service:

    [Unit]
    Description=OpenStack Compute NoVNC proxy
    After=postgresql.service mysql.service keystone.service rabbitmq-server.service ntp.service
    
    Documentation=man:nova-novncproxy(1)
    
    [Service]
    User=nova
    Group=nova
    Type=simple
    WorkingDirectory=/var/lib/nova
    PermissionsStartOnly=true
    ExecStartPre=/bin/mkdir -p /var/lock/nova /var/log/nova /var/lib/nova
    ExecStartPre=/bin/chown nova:nova /var/lock/nova /var/lib/nova
    ExecStartPre=/bin/chown nova:adm /var/log/nova
    ExecStart=/etc/init.d/nova-novncproxy systemd-start
    Restart=on-failure
    LimitNOFILE=65535
    TimeoutStopSec=65
    
    [Install]
    WantedBy=multi-user.target
  • Start the noVNC proxy:

    # systemctl daemon-reload
    # systemctl enable nova-novncproxy
    # service start nova-novncproxy
  • Restart the other Compute services:

    # service nova-api restart
    # service nova-consoleauth restart
    # service nova-scheduler restart
    # service nova-conductor restart

ubuntu or debian

  • Restart the Compute services:

    # service nova-api restart
    # service nova-consoleauth restart
    # service nova-scheduler restart
    # service nova-conductor restart
    # service nova-novncproxy restart