我要评分
获取效率
正确性
完整性
易理解

Installing Nova

Nova performs lifecycle management of compute (VM) instances in the OpenStack project, including creating, scheduling, and terminating VMs. Install Nova on the controller and compute nodes. The operations for installing Nova on the controller node are different from those on the compute node.

Installing and Configuring Nova on the Controller Node

  1. Create a database, a service credential, and API endpoints.
    1. Log in to the database as the root user.
      mysql -u root -p 
    2. Create a database.
      CREATE DATABASE nova_api; 
      CREATE DATABASE nova; 
      CREATE DATABASE nova_cell0; 
      GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY 'NOVA_DBPASS'; 
      GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY 'NOVA_DBPASS'; 
      GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'NOVA_DBPASS'; 
      GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'NOVA_DBPASS'; 
      GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' IDENTIFIED BY 'NOVA_DBPASS';
      GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' IDENTIFIED BY 'NOVA_DBPASS'; 

      Replace NOVA_DBPASS with the Nova database user password. The password cannot contain the characters including #@$ and can contain the special characters including &=-_.+!*()

    1. Exit the database.
      exit
    2. Create a Nova service credential.
      source ~/.admin-openrc 
      openstack user create --domain default --password-prompt nova 
      openstack role add --project service --user nova admin 
      openstack service create --name nova --description "OpenStack Computer" compute

      The password cannot contain the characters including #@$ and can contain the special characters including &=-_.+!*()

    3. Create Nova API endpoints.
      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
  2. Install the software package.
    yum install openstack-nova-api openstack-nova-conductor openstack-nova-novncproxy openstack-nova-scheduler
  3. Modify the configuration file.
    1. Open the file.
      vi /etc/nova/nova.conf
    2. Press i to enter the insert mode and add the following content:
      [DEFAULT]  
      enabled_apis = osapi_compute,metadata 
      transport_url = rabbit://openstack:RABBIT_PASSWORD@controller:5672/ 
      my_ip = 192.168.14.2
      use_neutron = true 
      firewall_driver = nova.virt.firewall.NoopFirewallDriver 
      block_device_allocate_retries = 360   
      block_device_allocate_retries_interval = 5
       
      [api_database] 
      connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova_api
      
      [database] 
      connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova
       
      [api] 
      auth_strategy = keystone 
       
      [keystone_authtoken] 
      www_authenticate_uri = http://controller:5000/ 
      auth_url = http://controller:5000/ 
      memcached_servers = controller:11211 
      auth_type = password 
      project_domain_name = Default 
      user_domain_name = Default 
      project_name = service 
      username = nova 
      password = NOVA_PASSWORD 
       
      [vnc] 
      enabled = true 
      server_listen = 192.168.14.2
      server_proxyclient_address = 192.168.14.2
       
      [glance] 
      api_servers = http://controller:9292 
       
      [oslo_concurrency] 
      lock_path = /var/lib/nova/tmp 
       
      [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 = PLACEMENT_PASSWORD
       
      [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 = NEUTRON_PASSWORD
      service_metadata_proxy = true 
      metadata_proxy_shared_secret = NEUTRON_PASSWORD
      • The [default] field is used to enable the compute and metadata APIs, configure the RabbitMQ message queue entry and my_ip, and enable the Neutron network service.
      • The [api_database] and [database] fields are used to configure the database parameters.
      • The [api] and [keystone_authtoken] fields are used to configure the identity authentication service entry.
      • The [vnc] field is used to enable and configure the entry for the remote console.
      • The [glance] field is used to configure the API address for the image service.
      • The [oslo_concurrency] field is used to configure the lock path.
      • The [placement] field is used to configure the Placement service entry.
      • Replace RABBIT_PASSWORD with the password of the OpenStack user in RabbitMQ.
      • my_ip indicates the management IP address of the current node.
      • server_listen indicates the management IP address of the corresponding node.
      • server_proxyclient_address indicates the management IP address of the corresponding node.
      • Replace NOVA_DBPASS with the password of the Nova database.
      • Replace NOVA_PASSWORD with the password of the Nova user.
      • Replace PLACEMENT_PASSWORD with the password of the Placement user.
      • Replace NEUTRON_PASSWORD with the password of the Neutron user.
      • Replace METADATA_SECRET with a proper metadata agent secret.
    1. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
  4. Synchronize the database.
    1. Synchronize the nova-api database.
      su -s /bin/sh -c "nova-manage api_db sync" nova
    2. Register the cell0 database.
      su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
    3. Create a cell1 cell.
      su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
    4. Synchronize the nova database.
      su -s /bin/sh -c "nova-manage db sync" nova
    5. Verify that cell0 and cell1 are correctly registered.
      su -s /bin/sh -c "nova-manage cell_v2 list_cells" nova
  5. Enable the compute service and configure it to start upon system startup.
    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 on the Compute Node

  1. Install the components.
    yum install openstack-nova-compute edk2-aarch64
  2. Modify the configuration file.
    1. Open the file.
      vi /etc/nova/nova.conf
    2. Press i to enter the insert mode and add the following content:
      [DEFAULT]   
      enabled_apis = osapi_compute,metadata 
      transport_url = rabbit://openstack:RABBIT_PASSWORD@controller:5672/
      my_ip = 192.168.14.4
      use_neutron = true 
      firewall_driver = nova.virt.firewall.NoopFirewallDriver
      block_device_allocate_retries = 360   
      block_device_allocate_retries_interval = 5
      compute_driver=libvirt.LibvirtDriver 
      instances_path = /var/lib/nova/instances/ 
      lock_path = /var/lib/nova/tmp 
      log_dir = /var/log/nova 
       
      [api] 
      auth_strategy = keystone 
       
      [keystone_authtoken] 
      www_authenticate_uri = http://controller:5000/ 
      auth_url = http://controller:5000/ 
      memcached_servers = controller:11211 
      auth_type = password 
      project_domain_name = Default 
      user_domain_name = Default 
      project_name = service 
      username = nova 
      password = NOVA_PASSWORD
       
      [vnc] 
      enabled = true 
      server_listen = 192.168.14.4 
      server_proxyclient_address = 192.168.14.4 
      novncproxy_base_url = http://controller:6080/vnc_auto.html 
       
      [glance] 
      api_servers = http://controller:9292 
       
      [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 = PLACEMENT_PASSWORD
       
      [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 = NEUTRON_PASSWORD
      
      [libvirt] 
      virt_type = kvm 
      live_migration_uri = qemu+ssh://root@%s/system
      live_migration_inbound_addr = 192.168.14.4
      • The [default] field is used to enable the compute and metadata APIs, configure the RabbitMQ message queue entry and my_ip, and enable the Neutron network service.
      • The [vnc] field is used to enable and configure the remote console entry.
      • The [glance] field is used to configure the API address for the image service.
      • The [placement] field is used to configure the Placement service entry.
      • Replace RABBIT_PASSWORD with the password of the OpenStack user in RabbitMQ.
      • my_ip indicates the management IP address of the current node.
      • live_migration_inbound_addr indicates the management IP address of the current node.
      • server_listen indicates the management IP address of the corresponding node.
      • server_proxyclient_address indicates the management IP address of the corresponding node.
      • Replace NOVA_DBPASS with the password of the Nova database.
      • Replace NOVA_PASSWORD with the password of the Nova user.
      • Replace PLACEMENT_PASSWORD with the password of the Placement user.
      • Replace NEUTRON_PASSWORD with the password of the Neutron user.
    3. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
  3. Create an AAVMF file and its links.
    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. Start the compute service.
    systemctl enable libvirtd.service openstack-nova-compute.service 
    systemctl start libvirtd.service openstack-nova-compute.service
  6. Run the following command on the controller node:
    su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova

Verifying Nova on the Controller Node

  1. Verify Nova.
    source ~/.admin-openrc
  2. List service components to verify that each service is successfully started and registered.
    openstack compute service list
  3. List the API endpoints in the identity service and verify the connection to the identity service.
    openstack catalog list
  4. Check whether the cells are running properly and whether other prerequisites are met.
    nova-status upgrade check