1. Detailed assembly
Function: hosting and management Web Hosting
Alternative host: User Request -> nova-api -> queue -> nova-scheduler -> nova-db (filter weights +) -> nova-scheduler -> queue
Creating VM: nova-compute -> queue -> nova-conductor -> nava-db -> nova-conductor -> queue -> nova-compute -> get the appropriate resources -> hypervisor -> Create a VM
Access VM:
Command Line
Browser: nova-console -> nova-cert -> nova-console
- Components Introduction
API components:
nova-api: responsible for receiving and responding to external operation request, RESTful format API, is the only way to the external access Nova.
nova-api-metadata: is a sub-nova-api service that provides metadata information to create a VM instance is.
Compute Core components:
nova-scheduler: VM instance is responsible for resource scheduling, recalculated by filtration and the right to decision-making VM instance is created on which the compute nodes.
nova-compute: Management VM instance, by receiving a request message queue, and bear the working operation.
nova-conductor: nova-compute nava-conductor means to achieve access to the database
Console Interface components:
nova-cert: responsible for authentication
nova-consoleauth: User Control Panel authorization verification
nova-novncproxy: VNC proxy, support for browser-based client vnc
2. The control node deployment
- Database Configuration
$ mysql -u root -p
MariaDB [(none)]> CREATE DATABASE nova_api;
MariaDB [(none)]> CREATE DATABASE nova;
MariaDB [(none)]> CREATE DATABASE nova_cell0;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY 'nova';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY 'nova'; MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'nova'; MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'nova'; MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' IDENTIFIED BY 'nova'; MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' IDENTIFIED BY 'nova'; 复制代码
- Software Installation
# yum install -y openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler openstack-nova-placement-api
复制代码
- Modify the configuration file
Modify nova.conf file
vim /etc/nova/nova.conf
[DEFAULT]
# 开发nova服务的api接口,直接取消注释
enabled_apis = osapi_compute,metadata
[api_database]
# 配置nova-api的数据库连接地址
connection = mysql+pymysql://nova:nova@controller/nova_api
[database]
# 配置nova的数据库链接地址
connection = mysql+pymysql://nova:nova@controller/nova
[DEFAULT]
# 配置rabbitmq的链接地址
transport_url = rabbit://openstack:openstack@controller
[api]
# 配置api验证方式,取消注释 auth_strategy = keystone [keystone_authtoken] # 配置keystone的认证信息 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 = nova [DEFAULT] # 配置ip my_ip = 192.168.188.100 [DEFAULT] # 配置使用的网络信息,直接取消注释即可,关闭防火墙驱动 use_neutron = True firewall_driver = nova.virt.firewall.NoopFirewallDriver [vnc] enabled = true # 开启vnc功能,配置vnc的联系方式 server_listen = $my_ip server_proxyclient_address = $my_ip [glance] # 配置glance的联系地址 api_servers = http://controller:9292 [oslo_concurrency] # 配置锁文件路径 lock_path = /var/lib/nova/tmp [placement] # 配置资源跟踪用户placement的认证信息 os_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 复制代码
Modify placement-api profile
vim /etc/httpd/conf.d/00-nova-placement-api.conf <Directory /usr/bin> = 2.4> Require all granted <IfVersion < 2.4> Order allow,deny Allow from all
Restart http service
systemctl restart httpd
- Information Synchronization
Synchronous nova-api database information and database information cell0
# su -s /bin/sh -c "nova-manage api_db sync" nova
# su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
复制代码
Creating cell1 record, synchronize database information 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
复制代码
- Rights Profile
Load admin user environment variables
source admin-openstack.sh
Add a user nova
openstack user create --domain default --password nova nova
The nova user to the service project admin role group
openstack role add --project service --user nova admin
Creating nova service, configuration api address records
openstack service create --name nova --description "OpenStack Compute" compute
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 a placement user, the user resource for tracking record. Added to the service group project admin role
$ openstack user create --domain default --password placement placement
$ openstack role add --project service --user placement admin
复制代码
Create a placement service, configuration api address records
$ openstack service create --name placement --description "Placement API" placement
$ 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
复制代码
- Verify the effect
# systemctl enable openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service
openstack-nova-novncproxy.service
# systemctl start openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
复制代码
Each endpoint verification services
openstack catalog list
Logging
/ Var / log / Nova
3. compute node deployment
- Ready to work
install software
yum install -y openstack-nova-compute sysfsutils libguestfs-tools
- Modify the configuration file
修改nova.conf配置文件
vim /etc/nova/nova.conf
[DEFAULT]
# ...
enabled_apis = osapi_compute,metadata
[DEFAULT]
# ...
transport_url = rabbit://openstack:openstack@controller
[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 = nova
[DEFAULT]
# ... my_ip = 192.168.188.101 #计算节点的IP地址 [DEFAULT] # ... use_neutron = True firewall_driver = nova.virt.firewall.NoopFirewallDriver [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] # ... os_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 #Determine whether your compute node supports hardware acceleration for virtual machines: #If this command returns a value of one or greater, your compute node supports hardware acceleration which typically requires no additional configuration. #If this command returns a value of zero, your compute node does not support hardware acceleration and you must configure libvirt to use QEMU instead of KVM. [libvirt] # ... virt_type = qemu 复制代码
[DEFAULT]
# 调整计算节点提供的资源参数(因为学习环境底层是VMware虚拟机)
vif_plugging_is_fatal=false
vif_plugging_timeout=10
复制代码
Start the service and set the boot from Kai
# systemctl enable libvirtd.service openstack-nova-compute.service
# systemctl start libvirtd.service openstack-nova-compute.service
复制代码
- Test results
The control node adding compute nodes
source admin-openstack.sh
oepnstack compute service list
复制代码
New computing node record added to the database nova
su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
Verify that all API is normal
nova-status upgrade check