Openstack computing host installation and configuration process II

Openstack computing host installation and configuration process

1. Environment configuration

Hosts configuration
   modify the / etc/hosts file and add wtcontroller, wtcompute1 and wtcompute2:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16.10.100 wtcontroller
172.16.10.101 wtcompute1
172.16.10.102 wtcompute2

                    

echo "wtcompute1"> /etc/hostname

1.1 revision yum source

yum source of time 163 used in this example:

CentOS7-Base-163.repo
 Copy the above files to the directory / etc/yum.repos.d
 Back up the CentOS-Base.repo file in this directory
 Modify CentOS7-Base-163.repo to CentOS-Base.repo
 Execute the following command:
Clear all? Clear cache
 yum makecache? Generate cache
 yum list displays all installed and installable packages

                   

systemctl stop initial-setup-text 

1.2 firewall operation

systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl status firewalld.service

1.3 turn off selinux security service

setenforce 0
getenforce
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/sysconfig/selinux
grep SELINUX=disabled /etc/sysconfig/selinux

1.4 installation time synchronization NTP service

yum install chrony -y
vim /etc/chrony.conf
--Refer to the network configuration and make sure the following configuration is on:
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
//And modify the following configuration to open the following network segment node to calibrate to the control node:
allow 172.16.10.0/24
Restart the service and set the service self start
systemctl restart chronyd.service
systemctl status chronyd.service
systemctl enable chronyd.service
systemctl list-unit-files |grep chronyd.service

   revise time zone

timedatectl set-timezone Asia/Shanghai
chronyc sources

1.5 install openstack update yum

yum install centos-release-openstack-rocky -y
yum clean all
yum makecache

1.6 install client software

yum install python-openstackclient openstack-selinux -y

2 installation process

2.1 installing nova

yum install openstack-nova-compute python-openstackclient openstack-utils -y
//Quickly modify the configuration file (/ etc/nova/nova.conf)
openstack-config --set  /etc/nova/nova.conf DEFAULT my_ip 192.168.3.170 
openstack-config --set  /etc/nova/nova.conf DEFAULT use_neutron True
openstack-config --set  /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver
openstack-config --set  /etc/nova/nova.conf DEFAULT enabled_apis  osapi_compute,metadata
openstack-config --set  /etc/nova/nova.conf DEFAULT transport_url  rabbit://openstack:wtoe@123456@wtcontroller
openstack-config --set  /etc/nova/nova.conf api auth_strategy  keystone 
openstack-config --set  /etc/nova/nova.conf keystone_authtoken auth_url http://wtcontroller:5000/v3
openstack-config --set  /etc/nova/nova.conf keystone_authtoken memcached_servers wtcontroller:11211
openstack-config --set  /etc/nova/nova.conf keystone_authtoken auth_type password
openstack-config --set  /etc/nova/nova.conf keystone_authtoken project_domain_name default
openstack-config --set  /etc/nova/nova.conf keystone_authtoken user_domain_name default
openstack-config --set  /etc/nova/nova.conf keystone_authtoken project_name  service
openstack-config --set  /etc/nova/nova.conf keystone_authtoken username nova
openstack-config --set  /etc/nova/nova.conf keystone_authtoken password wtoe@123456
openstack-config --set  /etc/nova/nova.conf vnc enabled True
openstack-config --set  /etc/nova/nova.conf vnc server_listen 0.0.0.0
openstack-config --set  /etc/nova/nova.conf vnc server_proxyclient_address  '$my_ip'
openstack-config --set  /etc/nova/nova.conf vnc novncproxy_base_url  http://wtcontroller:6080/vnc_auto.html
openstack-config --set  /etc/nova/nova.conf glance api_servers http://wtcontroller:9292
openstack-config --set  /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmp
openstack-config --set  /etc/nova/nova.conf placement region_name RegionOne
openstack-config --set  /etc/nova/nova.conf placement project_domain_name Default
openstack-config --set  /etc/nova/nova.conf placement project_name service
openstack-config --set  /etc/nova/nova.conf placement auth_type password
openstack-config --set  /etc/nova/nova.conf placement user_domain_name Default
openstack-config --set  /etc/nova/nova.conf placement auth_url http://wtcontroller:5000/v3
openstack-config --set  /etc/nova/nova.conf placement username placement
openstack-config --set  /etc/nova/nova.conf placement password wtoe@123456

   check the validity of the revision

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

The configuration file should be as follows (take node ip as 172.16.10.101):

[DEFAULT]
my_ip = 172.16.10.101
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:wtoe@123456@wtcontroller
instances_path=$state_path/instances
[api]
auth_strategy = keystone
[api_database]
[barbican]
[cache]
[cells]
[cinder]
[compute]
[conductor]
[console]
[consoleauth]
[cors]
[database]
[devices]
[ephemeral_storage_encryption]
[filter_scheduler]
[glance]
api_servers = http://wtcontroller:9292
[guestfs]
[healthcheck]
[hyperv]
[ironic]
[key_manager]
[keystone]
[keystone_authtoken]
auth_url = http://wtcontroller:5000/v3
memcached_servers = wtcontroller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = wtoe@123456
[libvirt]
inject_password = true 
inject_partition = -1
[matchmaker_redis]
[metrics]
[mks]
[neutron]
url = http://wtcontroller:9696
auth_url = http://wtcontroller:5000
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = wtoe@123456
[notifications]
[osapi_v21]
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_messaging_zmq]
[oslo_middleware]
[oslo_policy]
[pci]
[placement]
region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://wtcontroller:5000/v3
username = placement
password = wtoe@123456
[placement_database]
[powervm]
[profiler]
[quota]
[rdp]
[remote_debug]
[scheduler]
[serial_console]
[service_user]
[spice]
[upgrade_levels]
[vault]
[vendordata_dynamic_auth]
[vmware]
[vnc]
enabled = True
server_listen = 0.0.0.0
server_proxyclient_address = $my_ip
novncproxy_base_url = http://wtcontroller:6080/vnc_auto.html
[workarounds]
[wsgi]
[xenserver]
[xvp]
[zvm]

Configure hardware acceleration for virtual machines

First, determine whether your compute node supports hardware acceleration of virtual machines.

egrep -c '(vmx|svm)' /proc/cpuinfo

  ා if the return bit is 0, it means that the computing node does not support hardware acceleration. You need to configure libvirt to use QEMU to manage the virtual machine. Use the following command:

openstack-config --set  /etc/nova/nova.conf libvirt virt_type  qemu
egrep -v "^#|^$" /etc/nova/nova.conf|grep 'virt_type'

  ා if the value returned is other, it means that the computing node supports hardware acceleration and does not need additional configuration, use the following command:

openstack-config --set  /etc/nova/nova.conf libvirt virt_type  kvm

   if an instance creation error still occurs when the computing node supports hardware acceleration, you need to further confirm whether the hardware acceleration is turned on:

dmesg | grep kvm
 If there is a display of [3.692481] kvm: disabled by bios
 You need to turn on the virtualization option in bios

                  
Two services need to be started

systemctl start libvirtd.service openstack-nova-compute.service  
systemctl status libvirtd.service openstack-nova-compute.service
systemctl enable libvirtd.service openstack-nova-compute.service
systemctl list-unit-files |grep libvirtd.service
systemctl list-unit-files |grep openstack-nova-compute.service

Login to the control node for configuration
The following commands operate on the control node:

. admin-openrc 

Check and confirm that there are new computing nodes in the database

openstack compute service list --service nova-compute

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

#Set up tasks for automatic registration of newly created nodes (already added to the configuration file)

[scheduler]
discover_hosts_in_cells_interval = 300

Verify in control node

1)Application administrator environment variable script
. admin-openrc 
2)List view installed nova Service component
#Verify that each process was successfully registered and started
openstack compute service list
3)Listed in the authentication service API Endpoint to verify its connectivity
openstack catalog list
4)List the existing mirrors in the mirror service check the connectivity of the mirror service
openstack image list
5)inspect nova Status of components
#Check whether the placement API and cell service are working properly
nova-status upgrade check

2.2 Neutron installation

yum install openstack-neutron-openvswitch ebtables ipset -y (Computing node)
//Quick configuration / etc/neutron/neutron.conf
openstack-config --set /etc/neutron/neutron.conf DEFAULT transport_url  rabbit://openstack:wtoe@123456@wtcontroller
openstack-config --set /etc/neutron/neutron.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken www_authenticate_uri  http://wtcontroller:5000
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_url http://wtcontroller:5000
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken memcached_servers wtcontroller:11211
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_type password
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_domain_name default
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken user_domain_name default
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_name service
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken username neutron
openstack-config --set /etc/neutron/neutron.conf keystone_authtoken password wtoe@123456
openstack-config --set /etc/neutron/neutron.conf oslo_concurrency lock_path /var/lib/neutron/tmp

   view the active configuration

egrep -v '(^$|^#)' /etc/neutron/neutron.conf
Quick configuration/etc/neutron/plugins/ml2/openvswitch_agent.ini
openstack-config --set  /etc/neutron/plugins/ml2/openvswitch_agent.ini agent tunnel_types  vxlan
openstack-config --set  /etc/neutron/plugins/ml2/openvswitch_agent.ini agent l2_population  True
penstack-config --set  /etc/neutron/plugins/ml2/openvswitch_agent.ini ovs local_ip  172.16.20.81
penstack-config --set  /etc/neutron/plugins/ml2/openvswitch_agent.ini ovs tunnel_bridge  br-tun
openstack-config --set /etc/neutron/plugins/ml2/openvswitch_agent.ini securitygroup firewall_driver neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
openstack-config --set /etc/neutron/plugins/ml2/openvswitch_agent.ini securitygroup enable_security_group True 

   view the active configuration

egrep -v "^#|^$" /etc/neutron/plugins/ml2/openvswitch_agent.ini

   quick configuration / etc/nova/nova.conf

openstack-config --set /etc/nova/nova.conf neutron url http://wtcontroller:9696
openstack-config --set /etc/nova/nova.conf neutron auth_url http://wtcontroller:5000
openstack-config --set /etc/nova/nova.conf neutron auth_type password
openstack-config --set /etc/nova/nova.conf neutron project_domain_name default
openstack-config --set /etc/nova/nova.conf neutron user_domain_name default
openstack-config --set /etc/nova/nova.conf neutron region_name RegionOne
openstack-config --set /etc/nova/nova.conf neutron project_name service 
openstack-config --set /etc/nova/nova.conf neutron username neutron
openstack-config --set /etc/nova/nova.conf neutron password wtoe@123456 

View the active configuration

egrep -v '(^$|^#)' /etc/nova/nova.conf

Restart the compute node

systemctl restart openstack-nova-compute.service
systemctl status openstack-nova-compute.service

                  
#Need to start 1 service, bridge agent

systemctl restart neutron-openvswitch-agent.service
systemctl status neutron-openvswitch-agent.service
systemctl enable neutron-openvswitch-agent.service
systemctl list-unit-files |grep neutron* |grep enabled

Check the control node to confirm that the neutron service is installed successfully
Get administrative rights

source admin-openrc

List view loaded network plug-ins

openstack extension list --network

Or use another method: display profile information

neutron ext-list

View network agent list

openstack network agent list

#Normally, there are 3 services for the control node and 1 service for the calculation node. If not, check the configuration of the calculation node: network card name, IP address, port, password and other elements

Tags: Linux OpenStack yum CentOS SELinux

Posted on Mon, 06 Apr 2020 08:53:20 -0700 by Toboe