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.
- Connect to the database as user root.
1mysql -u root -p
- 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;
- 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>';
- Exit the database.
1exit
Creating Roles and Users
Perform the following operations on the controller node.
- Log in to the OpenStack CLI as the admin user.
1source /etc/keystone/admin-openrc
- Create the nova user.
1openstack user create --domain default --password-prompt nova
- Add the admin role to the nova user.
1openstack role add --project service --user nova admin
- Create a Nova service entity.
1openstack service create --name nova --description "OpenStack Compute" compute
- 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
- Create the placement user and set a password.
1openstack user create --domain default --password-prompt placement
- Add a role.
1openstack role add --project service --user placement admin
- Create a Placement service entity.
1openstack service create --name placement --description "Placement API" placement
- 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.
- Install components.
1yum -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
- Edit the /etc/nova/nova.conf file to configure Nova.
- 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.
- 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
- 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>
- 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>
- 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
- Configure the location of the Image service API.
1 2
[glance] api_servers = http://controller:9292
- Configure the lock path.
1 2
[oslo_concurrency] lock_path = /var/lib/nova/tmp
- 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>
- 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
- Modify the /etc/httpd/conf.d/00-nova-placement-api.conf file.
1vim /etc/httpd/conf.d/00-nova-placement-api.confAdd 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>

- Restart the httpd service.
1systemctl restart httpd
- 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
- Check whether cell 0 and cell 1 are correctly registered.
1su -s /bin/sh -c "nova-manage cell_v2 list_cells" nova

- 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
- Enable compute and metadata APIs, configure RabbitMQ message queue access, and enable the network service.
Installing and Configuring Nova (Compute Node)
Perform the following operations on the compute node.
- Install components.
1yum -y install openstack-nova-compute edk2-aarch64
- Edit the /etc/nova/nova.conf file.
- 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.
- 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>
- 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>
- 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
- Configure the location of the Image service API.
1 2
[glance] api_servers = http://controller:9292
- Configure the lock path.
1 2
[oslo_concurrency] lock_path = /var/lib/nova/tmp
- 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>
- Add the following to the [libvirt] section:
1virt_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.
1vim /etc/nova/nova.confOpen the comment and modify the following configuration:
1num_pcie_ports=15
Restart and log in to the VM, and run the lspci command.

- Enable the computing and metadata APIs.
- 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
- Modify the /etc/libvirt/qemu.conf file.
- Open the file.
vi /etc/libvirt/qemu.conf
- 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"] - Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
- Open the file.
- 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.
- Log in to the OpenStack CLI as the admin user.
1source /etc/keystone/admin-openrc
- Check the database host.
1openstack compute service list --service nova-compute
- Discover hosts.
1su -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:
1nova-manage cell_v2 discover_hosts
Alternatively, set an interval so that the controller node periodically discovers compute nodes.
1vim /etc/nova/nova.conf1 2
[scheduler] discover_hosts_in_cells_interval = 300
Verifying Nova
Perform the following operations on the controller node.
- Log in to the OpenStack CLI as the admin user.
1source /etc/keystone/admin-openrc
- List service components.
1openstack compute service list
- List the API endpoints in the Identity service to verify connectivity with the Identity service.
1openstack catalog list
- List images in the Glance service.
1openstack image list
- Check that cells and the placement API are working properly and that other prerequisites are met.
1nova-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. |