控制节点:
一、安装及配置Compute服务
1.创建数据库及管理用户
登陆数据库
mysql -u root -p
执行以下命令
CREATE DATABASE nova;
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'NOVA_DBPASS';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'NOVA_DBPASS';
2.生效admin变量
source admin-openrc.sh
3.创建nova用户
openstack user create --domain default --password-prompt nova
添加admin角色到nova用户及service项目openstack role add --project service --user nova admin
创建nova服务实体
openstack service create --name nova --description "OpenStack Compute" compute
4.创建服务API端点
openstack endpoint create --region RegionOne compute public http://controller:8774/v2/%\\(tenant_id\\)s
openstack endpoint create --region RegionOne compute internal http://controller:8774/v2/%\\(tenant_id\\)s
openstack endpoint create --region RegionOne compute admin http://controller:8774/v2/%\\(tenant_id\\)s
5.安装nova相关包
yum install openstack-nova-api openstack-nova-cert openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler python-novaclient -y
6.配置/etc/nova/nova.conf
[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
my_ip = 10.0.0.11
network_api_class = nova.network.neutronv2.api.API
security_group_api = neutron
linuxnet_interface_driver = nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver
enabled_apis=osapi_compute,metadata
verbose = True
......
[database]
connection = mysql://nova:NOVA_DBPASS@controller/nova
......
[glance]
host = controller
......
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = 111111
......
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
......
[oslo_messaging_rabbit]
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS
......
[vnc]
vncserver_listen = $my_ip
vncserver_proxyclient_address = $my_ip
7.同步nova数据库
su -s /bin/sh -c "nova-manage db sync" nova
8.启动nova相关服务,并设置开机自启
systemctl enable openstack-nova-api.service openstack-nova-cert.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-cert.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
计算节点:
二、安装配置计算节点
1.安装nova相关包
yum install openstack-nova-compute sysfsutils
2.配置/etc/nova/nova.conf
[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
my_ip = 10.0.0.31
network_api_class = nova.network.neutronv2.api.API
security_group_api = neutron
linuxnet_interface_driver = nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver
verbose = True
......
[glance]
host = controller
......
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = 111111
......
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
......
[oslo_messaging_rabbit]
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS
......
[vnc]
enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://controller:6080/vnc_auto.html
......
3.判断硬件是否支持硬件加速
egrep -c '(vmx|svm)' /proc/cpuinfo
输出为1或大于1则支持
4.启动nova相关服务,并设置开机自启
systemctl enable libvirtd.service openstack-nova-compute.service
systemctl start libvirtd.service openstack-nova-compute.service
控制节点:
三、验证操作
1.加载admin脚本环境变量
source admin-openrc.sh
2.列出已经成功的nova服务
nova service-list
3.查看在Identity服务上的API端点
nova endpoints
4.查看image镜像服务
nova image-list