OpenStack Victoria version - 6.1 control node Nova computing service component

6.1 control node Nova computing service component

More steps: OpenStack Victoria installation and deployment series tutorials

OpenStack deployment series
Openstack deployment tutorial series
OpenStack Ussuri offline installation and deployment series tutorial (full)
OpenStack Train offline installation and deployment series tutorial (full)
Welcome to leave messages for communication and common progress.

API, endpoint creation and database related

1. Create database and authorize

mysql -uroot -proot

Three databases need to be created: nova_api´╝înova´╝înova_cell0, set the password to 111111

CREATE DATABASE nova_api;
CREATE DATABASE nova;
CREATE DATABASE nova_cell0;

GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY '111111';
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY '111111';

GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY '111111';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY '111111';

GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' IDENTIFIED BY '111111';
GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' IDENTIFIED BY '111111';

flush privileges;
show databases;
select user,host from mysql.user;

exit

2. Create computing service credentials

(1) Create nova user on keystone

First load the environment variable source / Admin openrc sh

cd 
source admin-openrc.sh
openstack user create --domain default --password=111111 nova
openstack user list

(2) Configure the nova user as the admin role on keystone and add it to the service project

openstack role add --project service --user nova admin

(3) Create entity of nova computing service

openstack service create --name nova --description "OpenStack Compute" compute
openstack service list

3. Create compute API service endpoint

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
openstack endpoint list

nova related software installation and configuration

1. Install nova related software

yum install openstack-nova-api openstack-nova-conductor   openstack-nova-novncproxy openstack-nova-scheduler -y

2. Modification of configuration file

Edit VIM / etc / Nova / nova Conf file, nearly 6000 lines

cp /etc/nova/nova.conf /etc/nova/nova.conf.bak
egrep -v "^$|^#" /etc/nova/nova.conf.bak >/etc/nova/nova.conf

The command line modifies the configuration information. The command should not be operated in batches at one time. Because there are too many commands, the batch execution terminal may make errors. It is recommended to execute in batches

crudini --set /etc/nova/nova.conf DEFAULT enabled_apis osapi_compute,metadata
crudini --set /etc/nova/nova.conf DEFAULT transport_url rabbit://openstack:111111@controller:5672/
crudini --set /etc/nova/nova.conf DEFAULT my_ip 10.0.0.11

crudini --set /etc/nova/nova.conf api_database connection mysql+pymysql://nova:111111@controller/nova_api
crudini --set /etc/nova/nova.conf database connection mysql+pymysql://nova:111111@controller/nova
crudini --set /etc/nova/nova.conf api auth_strategy keystone
crudini --set /etc/nova/nova.conf keystone_authtoken www_authenticate_uri http://controller:5000/
crudini --set /etc/nova/nova.conf keystone_authtoken auth_url http://controller:5000/
crudini --set /etc/nova/nova.conf keystone_authtoken memcached_servers controller:11211
crudini --set /etc/nova/nova.conf keystone_authtoken auth_type password
crudini --set /etc/nova/nova.conf keystone_authtoken project_domain_name Default
crudini --set /etc/nova/nova.conf keystone_authtoken user_domain_name Default
crudini --set /etc/nova/nova.conf keystone_authtoken project_name service
crudini --set /etc/nova/nova.conf keystone_authtoken username nova
crudini --set /etc/nova/nova.conf keystone_authtoken password 111111
crudini --set /etc/nova/nova.conf vnc enabled true
crudini --set /etc/nova/nova.conf vnc server_listen '$my_ip'
crudini --set /etc/nova/nova.conf vnc server_proxyclient_address '$my_ip'
crudini --set /etc/nova/nova.conf glance api_servers http://controller:9292
crudini --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmp
crudini --set /etc/nova/nova.conf placement region_name RegionOne
crudini --set /etc/nova/nova.conf placement project_domain_name Default
crudini --set /etc/nova/nova.conf placement project_name service
crudini --set /etc/nova/nova.conf placement auth_type password
crudini --set /etc/nova/nova.conf placement user_domain_name Default
crudini --set /etc/nova/nova.conf placement auth_url http://controller:5000/v3
crudini --set /etc/nova/nova.conf placement username placement
crudini --set /etc/nova/nova.conf placement password 111111
crudini --set /etc/nova/nova.conf scheduler discover_hosts_in_cells_interval 300
echo "Result of Configuration"
egrep -v "^#|^$" /etc/nova/nova.conf

3. Create and synchronize databases

(1) Synchronize Nova API database

su -s /bin/sh -c "nova-manage api_db sync" nova

mysql -unova -pnova -e "use nova_api;show tables;"
mysql -unova -p111111 -e "use nova_api;show tables;"

(2) Synchronize cell0 database

su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova

(3) Create cell1 cell

su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova

(4) Initialize and synchronize nova database

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

(5) Verify Nova_ Are cell0 and cell1 added successfully

su -s /bin/sh -c "nova-manage cell_v2 list_cells" nova

(6) Validate database

mysql -unova -p111111 -e "use nova_api;show tables;"
mysql -uplacement -p111111 -e "use placement;show tables;"

4. Start the computing server and set the startup self startup

systemctl start openstack-nova-api openstack-nova-scheduler openstack-nova-conductor openstack-nova-novncproxy
systemctl enable openstack-nova-api openstack-nova-scheduler openstack-nova-conductor openstack-nova-novncproxy

5. Verify whether the service is started successfully

Use command

source admin-openrc.sh 
nova service-list
netstat -lntup | grep 6080
systemctl list-unit-files |grep openstack-nova* |grep enabled

Four services have been started. Why do you only see two services?

This is because the Nova service list command is sent to openstack Nova API, and the openstack Nova API service returns the response result. If the Nova API service is closed, the openstack Nova scheduler and openstack Nova conductor services cannot be started, while the openstack Nova novncproxy service is started successfully, which is viewed through the port. netstat -lntup | grep 6080, View the process number obtained from the last command of process ps -ef | grep.

The noVNC page can be accessed through the Web, but the virtual machine is not connected yet

Control node Nova service installation completed

So far, the installation of computing service nova in the control node is completed. The next article introduces the installation method of Nova service in the independent computing node.

If you use VMware virtual machine, you can now shut down and take a snapshot.

poweroff 

Keywords: OpenStack cloud serving iaas

Added by loudrake on Sat, 19 Feb 2022 10:36:46 +0200