openstack-manuals/doc/install-guide/source/nova-controller-install.rst

15 KiB

Install and configure controller node

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

obs or rdo or ubuntu

Prerequisites

Before you install and configure the Compute service, you must create a database, service credentials, and API endpoints.

  1. To create the database, complete these steps:

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

      $ mysql -u root -p
    • Create the nova database:

      CREATE DATABASE nova;
    • Grant proper access to the nova database:

      GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' \
        IDENTIFIED BY 'NOVA_DBPASS';
      GRANT ALL PRIVILEGES ON nova.* 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:

    $ source admin-openrc.sh
  3. To create the service credentials, complete these steps:

    • 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        | 8c46e4760902464b889293a74a0c90a8 |
      | name      | nova                             |
      +-----------+----------------------------------+
    • 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 service API endpoints:

    $ openstack endpoint create --region RegionOne \
      compute public http://controller:8774/v2/%\(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/%(tenant_id)s |
    +--------------+-----------------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      compute internal http://controller:8774/v2/%\(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/%(tenant_id)s |
    +--------------+-----------------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      compute admin http://controller:8774/v2/%\(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/%(tenant_id)s |
    +--------------+-----------------------------------------+

Install and configure components

obs

  1. Install the packages:

    # zypper install openstack-nova-api openstack-nova-scheduler \
      openstack-nova-cert openstack-nova-conductor \
      openstack-nova-consoleauth openstack-nova-novncproxy \
      python-novaclient iptables

rdo

  1. Install the packages:

    # yum install openstack-nova-api openstack-nova-cert \
      openstack-nova-conductor openstack-nova-console \
      openstack-nova-novncproxy openstack-nova-scheduler \
      python-novaclient

ubuntu

  1. Install the packages:

    # apt-get install nova-api nova-cert nova-conductor \
      nova-consoleauth nova-novncproxy nova-scheduler \
      python-novaclient

debian

  1. Install the packages:

    # apt-get install nova-api nova-cert nova-conductor \
      nova-consoleauth nova-consoleproxy nova-scheduler \
      python-novaclient

    Respond to prompts for database management <debconf/debconf-dbconfig-common>, Identity service credentials <debconf/debconf-keystone-authtoken>, service endpoint registration <debconf/debconf-api-endpoints>, and message broker credentials <debconf/debconf-rabbitmq>.

    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:

    obs or rdo or ubuntu

    • In the [database] section, configure database access:

      ubuntu or obs

      [database]
      ...
      connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova

      rdo

      [database]
      ...
      connection = mysql://nova:NOVA_DBPASS@controller/nova

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

    • In the [DEFAULT] and [oslo_messaging_rabbit] sections, configure RabbitMQ message queue access:

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

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

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

      [DEFAULT]
      ...
      auth_strategy = keystone
      
      [keystone_authtoken]
      ...
      auth_uri = http://controller:5000
      auth_url = http://controller:35357
      auth_plugin = password
      project_domain_id = default
      user_domain_id = 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

    debian

    • The .config and .postinst maintainer scripts of the nova-common package detect automatically the IP address which goes in the my_ip directive of the [DEFAULT] section. This value will normally still be prompted, and you can check that it is correct in the nova.conf after nova-common is installed:

      [DEFAULT]
      ...
      my_ip = 10.0.0.11
    • In the [DEFAULT] section, enable support for the Networking service:

      [DEFAULT]
      ...
      network_api_class = nova.network.neutronv2.api.API
      security_group_api = neutron
      linuxnet_interface_driver = nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver
      firewall_driver = nova.virt.firewall.NoopFirewallDriver

      Note

      By default, Compute uses an internal firewall service. Since Networking includes a firewall service, you must disable the Compute firewall service 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
    • In the [glance] section, configure the location of the Image service:

      [glance]
      ...
      host = controller

    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
    • In the [DEFAULT] section, disable the EC2 API:

      [DEFAULT]
      ...
      enabled_apis=osapi_compute,metadata
    • (Optional) To assist with troubleshooting, enable verbose logging in the [DEFAULT] section:

      [DEFAULT]
      ...
      verbose = True

rdo

  1. Populate the Compute database:

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

ubuntu

  1. Populate the Compute database:

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

Finalize installation

obs

  • Start the Compute services and configure them to start when the system boots:

    # systemctl enable openstack-nova-api.service \
      openstack-nova-cert.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-cert.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-cert.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-cert.service openstack-nova-consoleauth.service \
      openstack-nova-scheduler.service openstack-nova-conductor.service \
      openstack-nova-novncproxy.service

ubuntu or debian

  • Restart the 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

ubuntu

  • By default, the Ubuntu packages create an SQLite database.

    Because this configuration uses an SQL database server, you can remove the SQLite database file:

    # rm -f /var/lib/nova/nova.sqlite