点此快速打开文章【图床_OpenStack-计算服务】
nova_api
, nova
, 和 nova_cell0
mysql 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‘;
用合适的密码代替
NOVA_DBPASS
。
nova
用户openstack user create --domain default --password NOVA_PASS nova
用合适的密码代替
NOVA_PASS
。
nova
用户添加 admin
角色openstack role add --project service --user nova admin
nova
服务实体openstack service create --name nova --description "OpenStack Compute" compute
Compute API
服务端点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
Placement
服务用户openstack user create --domain default --password PLACEMENT_PASS placement
用合适的密码代替
PLACEMENT_PASS
。
admin
角色将 Placement
用户添加到服务项目openstack role add --project service --user placement admin
Placement API
条目openstack service create --name placement --description "Placement API" placement
Placement API
服务端点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
nova
yum install openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler openstack-nova-placement-api -y &>/dev/null echo $?
cp /etc/nova/nova.conf{,.bak} egrep -v ‘^$|#‘ /etc/nova/nova.conf.bak >/etc/nova/nova.conf
/etc/nova/nova.conf
并完成如下动作:vim /etc/nova/nova.conf
- 在
[DEFAULT]
部分,只启用计算和元数据API
[DEFAULT] # ... enabled_apis = osapi_compute,metadata
- 在
[api_database]
和[database]
部分,配置数据库的连接[api_database] # ... connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova_api [database] # ... connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova
用你为
Compute
数据库选择的密码来代替NOVA_DBPASS
。
- 在
[DEFAULT]
部分,配置RabbitMQ
消息队列访问权限[DEFAULT] # ... transport_url = rabbit://openstack:RABBIT_PASS@controller
用你在
RabbitMQ
中为openstack
选择的密码替换RABBIT_PASS
。
- 在
[api]
和[keystone_authtoken]
部分中,配置身份服务访问[api] # ... auth_strategy = keystone [keystone_authtoken] # ... auth_uri = http://controller:5000 auth_url = http://controller:35357 memcached_servers = controller:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = nova password = NOVA_PASS
使用你在身份认证服务中设置的
nova
用户的密码替换NOVA_PASS
。
- 在
[DEFAULT]
部分,配置my_ip
来使用控制节点的管理接口的IP
地址。[DEFAULT] # ... my_ip = 10.0.0.11
- 在
[DEFAULT]
部分,启用网络服务支持[DEFAULT] # ... use_neutron = True firewall_driver = nova.virt.firewall.NoopFirewallDriver
- 在
[vnc]
部分,配置VNC
代理使用控制节点的管理接口IP
地址[vnc] enabled = true # ... vncserver_listen = $my_ip vncserver_proxyclient_address = $my_ip
- 在
[glance]
区域,配置镜像服务API
的位置:[glance] # ... api_servers = http://controller:9292
- 在
[oslo_concurrency]
部分,配置锁路径[oslo_concurrency] # ... lock_path = /var/lib/nova/tmp
- 在
[placement]
部分,配置Placement API
[placement] # ... os_region_name = RegionOne project_domain_name = Default project_name = service auth_type = password user_domain_name = Default auth_url = http://controller:35357/v3 username = placement password = PLACEMENT_PASS
替换
PLACEMENT_PASS
为你placement
在Identity
服务中为用户选择的密码
/etc/httpd/conf.d/00-nova-placement-api.conf
并完成如下动作:cp /etc/httpd/conf.d/00-nova-placement-api.conf{,.bak} vim /etc/httpd/conf.d/00-nova-placement-api.conf #在16行</VirtualHost>这一行上面增加以下内容 <Directory /usr/bin> <IfVersion >= 2.4> Require all granted </IfVersion> <IfVersion < 2.4> Order allow,deny Allow from all </IfVersion> </Directory>
Httpd
服务systemctl restart httpd
su -s /bin/sh -c "nova-manage api_db sync" nova su -s /bin/sh -c "nova-manage cell_v2 map_cell0" 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
检查
nova-manage cell_v2 list_cells
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
检查
openstack compute service list
nova
yum install openstack-nova-compute -y &>/dev/null echo $?
cp /etc/nova/nova.conf{,.bak} egrep -v ‘^$|#‘ /etc/nova/nova.conf.bak >/etc/nova/nova.conf
/etc/nova/nova.conf
并完成如下动作:vim /etc/nova/nova.conf
- 在
[DEFAULT]
部分,只启用计算和元数据API
[DEFAULT] # ... enabled_apis = osapi_compute,metadata
- 在
[DEFAULT]
部分,配置RabbitMQ
消息队列访问权限[DEFAULT] # ... transport_url = rabbit://openstack:RABBIT_PASS@controller
用你在
RabbitMQ
中为openstack
选择的密码替换RABBIT_PASS
。
- 在
[api]
和[keystone_authtoken]
部分中,配置身份服务访问[api] # ... auth_strategy = keystone [keystone_authtoken] # ... auth_uri = http://controller:5000 auth_url = http://controller:35357 memcached_servers = controller:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = nova password = NOVA_PASS
使用你在身份认证服务中设置的
nova
用户的密码替换NOVA_PASS
。
- 在
[DEFAULT]
部分,配置my_ip
来使用控制节点的管理接口的IP
地址。[DEFAULT] # ... my_ip = 10.0.0.31
- 在
[DEFAULT]
部分,启用网络服务支持[DEFAULT] # ... use_neutron = True firewall_driver = nova.virt.firewall.NoopFirewallDriver
- 在
[vnc]
部分,启用并配置远程控制台访问[vnc] # ... enabled = True vncserver_listen = 0.0.0.0 vncserver_proxyclient_address = $my_ip novncproxy_base_url = http://controller:6080/vnc_auto.html
- 在
[glance]
区域,配置镜像服务API
的位置:[glance] # ... api_servers = http://controller:9292
- 在
[oslo_concurrency]
部分,配置锁路径[oslo_concurrency] # ... lock_path = /var/lib/nova/tmp
- 在
[placement]
部分,配置Placement API
[placement] # ... os_region_name = RegionOne project_domain_name = Default project_name = service auth_type = password user_domain_name = Default auth_url = http://controller:35357/v3 username = placement password = PLACEMENT_PASS
替换
PLACEMENT_PASS
为你placement
在Identity
服务中为用户选择的密码
systemctl enable libvirtd.service openstack-nova-compute.service systemctl start libvirtd.service openstack-nova-compute.service
openstack compute service list
发现计算节点,每添加新节点,则需要执行以下操作:
su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
『MineGi有话说』:快来扫一扫下面链接的二维码,加入我们吧!
原文:https://www.cnblogs.com/MineGi/p/12781920.html