Rate This Document
Findability
Accuracy
Completeness
Readability

Installing, Configuring, and Verifying Nova

Nova performs lifecycle management of compute (VM) instances in the OpenStack project, including creating, scheduling, and terminating VMs.

Creating the Nova Database

Perform the following operations on the controller node.

  1. Connect to the database as user root.
    1
    mysql -u root -p
    
  2. Create the nova, nova_api, and nova_cell0 databases.
    1
    2
    3
    4
    CREATE DATABASE nova_api;
    CREATE DATABASE nova;
    CREATE DATABASE nova_cell0;
    CREATE DATABASE placement;
    
  3. Grant proper access to the databases.
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' \
    IDENTIFIED BY '<PASSWORD>';
    GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' \
    IDENTIFIED BY '<PASSWORD>';
    
    GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' \
    IDENTIFIED BY '<PASSWORD>';
    GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' \
    IDENTIFIED BY '<PASSWORD>';
    
    GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' \
    IDENTIFIED BY '<PASSWORD>';
    GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' \
    IDENTIFIED BY '<PASSWORD>';
    
    GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'localhost' IDENTIFIED BY '<PASSWORD>'; 
    GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'%' IDENTIFIED BY '<PASSWORD>';
    
  4. Exit the database.
    1
    exit
    

Creating Roles and Users

Perform the following operations on the controller node.

  1. Log in to the OpenStack CLI as the admin user.
    1
    source /etc/keystone/admin-openrc
    
  2. Create the nova user.
    1
    openstack user create --domain default --password-prompt nova
    
  3. Add the admin role to the nova user.
    1
    openstack role add --project service --user nova admin
    
  4. Create a Nova service entity.
    1
    openstack service create --name nova --description "OpenStack Compute" compute
    
  5. Create compute API service endpoints.
    1
    2
    3
    openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1
    openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1
    openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1
    
  6. Create the placement user and set a password.
    1
    openstack user create --domain default --password-prompt placement
    
  7. Add a role.
    1
    openstack role add --project service --user placement admin 
    
  8. Create a Placement service entity.
    1
    openstack service create --name placement --description "Placement API" placement
    
  9. Create Placement API service endpoints.
    1
    2
    3
    openstack endpoint create --region RegionOne placement public http://controller:8778 
    openstack endpoint create --region RegionOne placement internal http://controller:8778 
    openstack endpoint create --region RegionOne placement admin http://controller:8778
    

Installing and Configuring Nova (Controller Node)

Perform the following operations on the controller node.

  1. Install components.
    1
    yum -y install openstack-nova-api openstack-nova-conductor openstack-nova-novncproxy openstack-nova-scheduler openstack-nova-placement-api novnc-0.5.1-2.oe1.noarch
    
  2. Edit the /etc/nova/nova.conf file to configure Nova.
    1. Enable compute and metadata APIs, configure RabbitMQ message queue access, and enable the network service.
      1
      2
      3
      4
      5
      6
      7
      [DEFAULT]
      enabled_apis = osapi_compute,metadata
      transport_url = rabbit://openstack:<PASSWORD>@controller
      my_ip = 172.168.201.11
      use_neutron = true
      firewall_driver = nova.virt.firewall.NoopFirewallDriver
      allow_resize_to_same_host = true
      

      my_ip specifies the management IP address of the controller node, and PASSWORD is the password set by the RabbitMQ service for the openstack user.

    2. Configure database access.
      1
      2
      3
      4
      [api_database]
      connection = mysql+pymysql://nova:<PASSWORD>@controller/nova_api
      [database]
      connection = mysql+pymysql://nova:<PASSWORD>@controller/nova
      
    3. Configure Identity service access.
       1
       2
       3
       4
       5
       6
       7
       8
       9
      10
      11
      [api]
      auth_strategy = keystone
      [keystone_authtoken]
      auth_url = http://controller:5000/v3
      memcached_servers = controller:11211
      auth_type = password
      project_domain_name = Default
      user_domain_name = Default
      project_name = service
      username = nova
      password = <PASSWORD>
      
    4. In the /etc/nova/nova.conf file, enable the metadata agent and set the password in the [neutron] section.
       1
       2
       3
       4
       5
       6
       7
       8
       9
      10
      11
      12
      [neutron]
      url = http://controller:9696
      auth_url = http://controller:5000
      auth_type = password
      project_domain_name = default
      user_domain_name = default
      region_name = RegionOne
      project_name = service
      username = neutron
      password = <PASSWORD>
      service_metadata_proxy = true
      metadata_proxy_shared_secret = <PASSWORD>
      
    5. Configure the VNC proxy to use the management IP address of the controller node.
      1
      2
      3
      4
      [vnc]
      enabled = true
      server_listen = $my_ip
      server_proxyclient_address = $my_ip
      
    6. Configure the location of the Image service API.
      1
      2
      [glance]
      api_servers = http://controller:9292
      
    7. Configure the lock path.
      1
      2
      [oslo_concurrency]
      lock_path = /var/lib/nova/tmp
      
    8. Configure the access to the Placement service.
      1
      2
      3
      4
      5
      6
      7
      8
      9
      [placement]
      region_name = RegionOne
      project_domain_name = Default
      project_name = service
      auth_type = password
      user_domain_name = Default
      auth_url = http://controller:5000/v3
      username = placement
      password = <PASSWORD>
      
    9. In the [placement_database] section, configure the database access and set PASSWORD to the password for accessing the database.
      1
      2
      [placement_database]
      connection = mysql+pymysql://placement:<PASSWORD>@controller/placement
      
    10. Modify the /etc/httpd/conf.d/00-nova-placement-api.conf file.
      1
      vim /etc/httpd/conf.d/00-nova-placement-api.conf
      

      Add the following to the ErrorLog /var/log/placement/placement-api.log file:

      1
      2
      3
      4
      5
      6
      7
      8
      9
        <Directory /usr/bin> 
          <IfVersion >= 2.4> 
            Require all granted 
          </IfVersion> 
          <IfVersion < 2.4> 
            Order allow,deny 
            Allow from all 
          </IfVersion> 
        </Directory>
      

    11. Restart the httpd service.
      1
      systemctl restart httpd
      
    12. Populate the nova-api database.
      1
      2
      3
      4
      su -s /bin/sh -c "nova-manage api_db sync" nova
      su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
      su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
      su -s /bin/sh -c "nova-manage db sync" nova
      
    13. Check whether cell 0 and cell 1 are correctly registered.
      1
      su -s /bin/sh -c "nova-manage cell_v2 list_cells" nova
      

    14. Enable the compute service and configure it to start as the system boots.
      1
      2
      3
      4
      systemctl enable openstack-nova-api.service openstack-nova-scheduler.service \
      openstack-nova-conductor.service openstack-nova-novncproxy.service
      systemctl start openstack-nova-api.service openstack-nova-scheduler.service \
      openstack-nova-conductor.service openstack-nova-novncproxy.service
      

Installing and Configuring Nova (Compute Node)

Perform the following operations on the compute node.

  1. Install components.
    1
    yum -y install openstack-nova-compute edk2-aarch64
    
  2. Edit the /etc/nova/nova.conf file.
    1. Enable the computing and metadata APIs.
      1
      2
      3
      4
      5
      6
      7
      8
      9
      [DEFAULT]
      enabled_apis = osapi_compute,metadata
      transport_url = rabbit://openstack:<PASSWORD>@controller
      my_ip = 172.168.201.12
      use_neutron = true
      firewall_driver = nova.virt.firewall.NoopFirewallDriver
      compute_driver=libvirt.LibvirtDriver
      instances_path = /var/lib/nova/instances/
      lock_path = /var/lib/nova/tmp
      

      Set my_ip to the management IP address of the compute node.

    2. Configure Identity service access.
       1
       2
       3
       4
       5
       6
       7
       8
       9
      10
      11
      [api]
      auth_strategy = keystone
      [keystone_authtoken]
      auth_url = http://controller:5000/v3
      memcached_servers = controller:11211
      auth_type = password
      project_domain_name = Default
      user_domain_name = Default
      project_name = service
      username = nova
      password = <PASSWORD>
      
    3. Add the following to the [neutron] section in the /etc/nova/nova.conf file:
       1
       2
       3
       4
       5
       6
       7
       8
       9
      10
      [neutron]
      url = http://controller:9696
      auth_url = http://controller:5000
      auth_type = password
      project_domain_name = default
      user_domain_name = default
      region_name = RegionOne
      project_name = service
      username = neutron
      password = <PASSWORD>
      
    4. Enable and configure the access to the remote console.
      1
      2
      3
      4
      5
      [vnc]
      enabled = true
      server_listen = $my_ip
      server_proxyclient_address = $my_ip
      novncproxy_base_url = http://controller:6080/vnc_auto.html
      
    5. Configure the location of the Image service API.
      1
      2
      [glance]
      api_servers = http://controller:9292
      
    6. Configure the lock path.
      1
      2
      [oslo_concurrency]
      lock_path = /var/lib/nova/tmp
      
    7. Configure the Placement API.
      1
      2
      3
      4
      5
      6
      7
      8
      9
      [placement]
      region_name = RegionOne
      project_domain_name = Default
      project_name = service
      auth_type = password
      user_domain_name = Default
      auth_url = http://controller:5000/v3
      username = placement
      password = <PASSWORD>
      
    8. Add the following to the [libvirt] section:
      1
      virt_type = kvm
      

      In the nova.conf configuration file, the PCI number of the created VM is 6 by default. To change the PCI number, you can modify the num_pcie_ports parameter in the nova.conf configuration file on the compute node.

      1
      vim /etc/nova/nova.conf
      

      Open the comment and modify the following configuration:

      1
      num_pcie_ports=15
      

      Restart and log in to the VM, and run the lspci command.

  3. Create an AAVMF file and links to it.
    mkdir -p /usr/share/AAVMF
    chown nova:nova /usr/share/AAVMF
    ln -s /usr/share/edk2/aarch64/QEMU_EFI-pflash.raw /usr/share/AAVMF/AAVMF_CODE.fd
    ln -s /usr/share/edk2/aarch64/vars-template-pflash.raw /usr/share/AAVMF/AAVMF_VARS.fd
  4. Modify the /etc/libvirt/qemu.conf file.
    1. Open the file.
      vi /etc/libvirt/qemu.conf
    2. Press i to enter the insert mode and add the following content:
      nvram = ["/usr/share/AAVMF/AAVMF_CODE.fd:/usr/share/AAVMF/AAVMF_VARS.fd",
            "/usr/share/edk2/aarch64/QEMU_EFI-pflash.raw:/usr/share/edk2/aarch64/vars-template-pflash.raw"]
    3. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
  5. Enable the Compute service and its dependencies and make them to start as the system boots.
    1
    2
    systemctl enable libvirtd.service openstack-nova-compute.service
    systemctl start libvirtd.service openstack-nova-compute.service
    

Adding Compute Nodes to the Cell Database

Perform the following operations on the controller node.

  1. Log in to the OpenStack CLI as the admin user.
    1
    source /etc/keystone/admin-openrc
    
  2. Check the database host.
    1
    openstack compute service list --service nova-compute
    
  3. Discover hosts.
    1
    su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
    

    When adding a compute node, run the following commands on the controller node to register the new compute node:

    1
    nova-manage cell_v2 discover_hosts
    

    Alternatively, set an interval so that the controller node periodically discovers compute nodes.

    1
    vim /etc/nova/nova.conf
    
    1
    2
    [scheduler]
    discover_hosts_in_cells_interval = 300
    

Verifying Nova

Perform the following operations on the controller node.

  1. Log in to the OpenStack CLI as the admin user.
    1
    source /etc/keystone/admin-openrc
    
  2. List service components.
    1
    openstack compute service list
    
  3. List the API endpoints in the Identity service to verify connectivity with the Identity service.
    1
    openstack catalog list
    
  4. List images in the Glance service.
    1
    openstack image list
    
  5. Check that cells and the placement API are working properly and that other prerequisites are met.
    1
    nova-status upgrade check
    

Common Nova Commands

Command

Description

openstack flavor create <flavor-name> --vcpus 4 --ram 8192 --disk 20

Creates a flavor with specified specifications.

openstack server create --flavor m1.nano --image cirros \

--nic net-id=provider --security-group default \

--key-name mykey provider-vm

Creates a VM instance.

openstack server start provider-vm

Starts an instance.

openstack server list

Queries all instances.

openstack server stop vm1

Stops an instance.

openstack server delete vm1

Deletes the selected instance.