五、Openstack计算服务(nova)下


简单介绍:

nova计算节点上主要有组件:nova-compute

nova-compute:管理虚拟机的核心服务通过Hypervior的API来创建和销毁虚拟机实例


安装

nova安装在计算节点的部分(nova-compute


安装nova-compute软件包

yum install openstack-nova-compute

修改配置文件 /etc/nova/nova.conf

vi /etc/nova/nova.conf

[DEFAULT]
rpc_backend = rabbit启用消息队列
auth_strategy = keystone启用keystone认证
my_ip = 192.168.100.20 使用计算节点管理接口ip(如果多台nova-compute只有这项设置不同,其他一样)
use_neutron = True启用网络服务支持
firewall_driver = nova.virt.firewall.NoopFirewallDriver

配置消息队列

[oslo_messaging_rabbit]
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = 123456

配置认证服务访问

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

启用并配置远程控制台访问

[vnc]
enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://192.168.100.10:6080/vnc_auto.html(用控制节点管理网络ip方便以后创建虚拟机直接控制台查看不用解析)

配置镜像服务 API 的位置

[glance]
api_servers = http://controller:9292

配置锁路径

[oslo_concurrency]
lock_path = /var/lib/nova/tmp

查看计算节点是否支持虚拟机的硬件加速,不然可能无法正常创建虚拟机

[root@compute ~]# egrep -c '(vmx|svm)' /proc/cpuinfo
2
返回0不支持,其他支持
因为我开启了虚拟机硬件加速的所以支持,如果不支持则添加:

vi /etc/nova/nova.conf

[libvirt]
virt_type = qemu


启动计算服务设置开机自启

systemctl enable libvirtd.service openstack-nova-compute.service

systemctl start libvirtd.service openstack-nova-compute.service

控制节点验证

[root@controller ~]# . admin-openrc 
[root@controller ~]# openstack compute service list
+----+------------------+------------+----------+---------+-------+----------------------------+
| Id | Binary           | Host       | Zone     | Status  | State | Updated At                 |
+----+------------------+------------+----------+---------+-------+----------------------------+
|  1 | nova-scheduler   | controller | internal | enabled | up    | 2017-11-16T21:09:43.000000 |
|  2 | nova-conductor   | controller | internal | enabled | up    | 2017-11-16T21:09:50.000000 |
|  3 | nova-consoleauth | controller | internal | enabled | up    | 2017-11-16T21:09:48.000000 |
|  6 | nova-compute     | compute    | nova     | enabled | up    | 2017-11-16T21:09:43.000000 |
+----+------------------+------------+----------+---------+-------+----------------------------+

如果有down的

查看 tail -f  /var/log/nova/  下日志文件排查


Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐