6. Install Nova service [VMware virtual machine to build Openstack+Ironic]

6. Install Nova service [VMware virtual machine to build Openstack + Ironic]

Basic instructions

To provide computing services, it needs to be installed on the control node and computing node.

controller node

Database operations
1. Enter the database
mysql -uroot -p123456
2. Create nova database
CREATE DATABASE nova_api default character set utf8;
CREATE DATABASE nova default character set utf8;
CREATE DATABASE nova_cell0 default character set utf8;
3. Create user and authorize
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY '123456';

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

GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' IDENTIFIED BY '123456';
Create users and configure endpoints
1. Activate environment variables
 source /root/source-admin.sh
2. Create user
openstack user create --domain default --password 123456 nova
3. Create roles and authorize
openstack role add --project service --user nova admin
4. Create services
openstack service create --name nova --description "OpenStack Compute" compute
5. Create 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
Install and configure nova components
1. Install software
yum -y install openstack-nova-api openstack-nova-conductor openstack-nova-novncproxy openstack-nova-scheduler
2. Modify configuration file
cd /etc/nova/ & amp; & amp; mv nova.conf nova.conf.source & amp; & amp; cat nova.conf.source |grep -Ev "^#|^$" > nova. conf & amp; & amp; chown root:nova nova.conf
vim /etc/nova/nova.conf
[DEFAULT]
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:123456@controller
my_ip = 10.0.0.11

[api_database]
connection = mysql + pymysql://nova:123456@controller/nova_api

[database]
connection = mysql + pymysql://nova:123456@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=123456

[service_user]
send_service_user_token = true
auth_url = https://controller/identity
auth_strategy = keystone
auth_type = password
project_domain_name = Default
project_name = service
user_domain_name = Default
username=nova
password=123456

[vnc]
enabled = true
server_listen = $my_ip
server_proxyclient_address = $my_ip

[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=123456

[scheduler]
discover_hosts_in_cells_interval = 300
3. Synchronize nova-api database
su -s /bin/sh -c "nova-manage api_db sync" nova
4. Synchronize cell0 database
su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
5. Create cell1
su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
6. Synchronize nova database
su -s /bin/sh -c "nova-manage db sync" nova
7. Verify whether cell0 and cell1 are registered correctly
su -s /bin/sh -c "nova-manage cell_v2 list_cells" nova
8. Start the service and set it to start automatically at boot
systemctl enable openstack-nova-api.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
systemctl restart openstack-nova-api.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
systemctl status openstack-nova-api.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service

compute node

Install and configure nova components
1. Install software
yum -y install openstack-nova-compute
2. Modify configuration file
cd /etc/nova/ & amp; & amp; mv nova.conf nova.conf.source & amp; & amp; cat nova.conf.source |grep -Ev "^#|^$" > nova. conf & amp; & amp; chown nova:root nova.conf
vim /etc/nova/nova.conf
[DEFAULT]
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:123456@controller
my_ip = 10.0.0.31

[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=123456

[service_user]
send_service_user_token = true
auth_url = https://controller/identity
auth_strategy = keystone
auth_type = password
project_domain_name = Default
project_name = service
user_domain_name = Default
username=nova
password=123456

[vnc]
enabled = true
server_listen = 0.0.0.0
server_proxyclient_address = $my_ip
novncproxy_base_url = http://controller:6080/vnc_auto.html

[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=123456


[libvirt]
#virt_type = kvm
virt_type = qemu
3. Start and restart the service
systemctl enable libvirtd.service openstack-nova-compute.service
systemctl restart libvirtd.service openstack-nova-compute.service
systemctl status libvirtd.service openstack-nova-compute.service
4. Add computing nodes to the database on the controller node

–control node operation–

openstack compute service list --service nova-compute

su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova

Verification

–Controller node operation–

Start environment variables

source /root/source-admin.sh

Show all computing services

openstack compute service list

Show all endpoints

openstack catalog list

Show all images

openstack image list

Detect cells

nova-status upgrade check