Install and configure controller node

Install and configure controller node

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:

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

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

      CREATE DATABASE neutron;
      
    • Grant proper access to the neutron database, replacing NEUTRON_DBPASS with a suitable password:

      GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' \
        IDENTIFIED BY 'NEUTRON_DBPASS';
      GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' \
        IDENTIFIED BY 'NEUTRON_DBPASS';
      
    • 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 neutron user:

      $ openstack user create --domain default --password-prompt neutron
      User Password:
      Repeat User Password:
      +-----------+----------------------------------+
      | Field     | Value                            |
      +-----------+----------------------------------+
      | domain_id | default                          |
      | enabled   | True                             |
      | id        | b20a6692f77b4258926881bf831eb683 |
      | name      | neutron                          |
      +-----------+----------------------------------+
      
    • Add the admin role to the neutron user:

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

      Note

      This command provides no output.

    • Create the neutron service entity:

      $ openstack service create --name neutron \
        --description "OpenStack Networking" network
      +-------------+----------------------------------+
      | Field       | Value                            |
      +-------------+----------------------------------+
      | description | OpenStack Networking             |
      | enabled     | True                             |
      | id          | f71529314dab4a4d8eca427e701d209e |
      | name        | neutron                          |
      | type        | network                          |
      +-------------+----------------------------------+
      
  4. Create the Networking service API endpoints:

    $ openstack endpoint create --region RegionOne \
      network public http://controller:9696
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | 85d80a6d02fc4b7683f611d7fc1493a3 |
    | interface    | public                           |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | f71529314dab4a4d8eca427e701d209e |
    | service_name | neutron                          |
    | service_type | network                          |
    | url          | http://controller:9696           |
    +--------------+----------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      network internal http://controller:9696
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | 09753b537ac74422a68d2d791cf3714f |
    | interface    | internal                         |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | f71529314dab4a4d8eca427e701d209e |
    | service_name | neutron                          |
    | service_type | network                          |
    | url          | http://controller:9696           |
    +--------------+----------------------------------+
    
    $ openstack endpoint create --region RegionOne \
      network admin http://controller:9696
    +--------------+----------------------------------+
    | Field        | Value                            |
    +--------------+----------------------------------+
    | enabled      | True                             |
    | id           | 1ee14289c9374dffb5db92a5c112fc4e |
    | interface    | admin                            |
    | region       | RegionOne                        |
    | region_id    | RegionOne                        |
    | service_id   | f71529314dab4a4d8eca427e701d209e |
    | service_name | neutron                          |
    | service_type | network                          |
    | url          | http://controller:9696           |
    +--------------+----------------------------------+
    

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 public (provider) networks. No self-service 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 (private) 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.

Note

Option 2 also supports attaching instances to public (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.

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:

    • In the [DEFAULT] section, configure access parameters:

      [DEFAULT]
      ...
      auth_uri = http://controller:5000
      auth_url = http://controller:35357
      auth_region = RegionOne
      auth_plugin = password
      project_domain_id = default
      user_domain_id = default
      project_name = service
      username = neutron
      password = NEUTRON_PASS
      

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

    • In the [DEFAULT] section, configure the metadata host:

      [DEFAULT]
      ...
      nova_metadata_ip = controller
      
    • In the [DEFAULT] section, configure the metadata proxy shared secret:

      [DEFAULT]
      ...
      metadata_proxy_shared_secret = METADATA_SECRET
      

      Replace METADATA_SECRET with a suitable secret for the metadata proxy.

    • (Optional) To assist with troubleshooting, enable verbose logging in the [DEFAULT] section:

      [DEFAULT]
      ...
      verbose = True
      

Configure Compute to use Networking

  • Edit the /etc/nova/nova.conf file and perform the following actions:

    • In the [neutron] section, configure access parameters, enable the metadata proxy, and configure the secret:

      [neutron]
      ...
      url = http://controller:9696
      auth_url = http://controller:35357
      auth_plugin = password
      project_domain_id = default
      user_domain_id = default
      region_name = RegionOne
      project_name = service
      username = neutron
      password = NEUTRON_PASS
      
      service_metadata_proxy = True
      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:

    # su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf \
      --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.

  2. Restart the Compute API service:

    # service nova-api restart
    
  3. Restart the Networking services.

    For both networking options:

    # service neutron-server restart
    # service neutron-plugin-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
    
  1. 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/neutron/neutron.sqlite
    
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.