分享

openstack【Kilo】入门 【nova篇】十四:nova安装配置2:计算节点【centos】

pig2 发表于 2015-9-16 17:20:42 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 4 27759
本帖最后由 pig2 于 2015-9-23 17:27 编辑

问题导读


1.如何测试是否支持硬件加速?
2.不支持硬件加速该如何配置?
3.如何验证nova是否安装成功?





安装配置计算hypervisor 组件

1.安装包
[mw_shl_code=bash,true]yum install openstack-nova-compute sysfsutils[/mw_shl_code]

2.编辑文件 /etc/nova/nova.conf ,完成下面内容

a.在[DEFAULT] 和 [oslo_messaging_rabbit] 部分,配置RabbitMQ 消息队列
[mw_shl_code=bash,true][DEFAULT]
...
rpc_backend = rabbit

[oslo_messaging_rabbit]
...
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS[/mw_shl_code]

RABBIT_PASS 替换为自己设置密码

b.在 [DEFAULT] 和 [keystone_authtoken] 部分,配置keystone访问
[mw_shl_code=bash,true][DEFAULT]
...
auth_strategy = keystone

[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 = NOVA_PASS[/mw_shl_code]

注意:注释掉[keystone_authtoken] 标签其它选项


c.在 [DEFAULT]部分,配置my_ip 选项
[mw_shl_code=bash,true][DEFAULT]
...
my_ip = MANAGEMENT_INTERFACE_IP_ADDRESS[/mw_shl_code]

MANAGEMENT_INTERFACE_IP_ADDRESS这里为10.0.0.31


d.在[DEFAULT]部分, 启用和配置远程 console 访问:
[mw_shl_code=bash,true][DEFAULT]
...
vnc_enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = MANAGEMENT_INTERFACE_IP_ADDRESS
novncproxy_base_url = http://controller:6080/vnc_auto.html[/mw_shl_code]

MANAGEMENT_INTERFACE_IP_ADDRESS替换为10.0.0.31

e.在 [glance] 部分,配置glance位置
[mw_shl_code=bash,true][glance]
...
host = controller[/mw_shl_code]

f.在 [oslo_concurrency] 部分,配置 lock 路径
[mw_shl_code=bash,true][oslo_concurrency]
...
lock_path = /var/lib/nova/tmp[/mw_shl_code]

g.启用日志详细信息记录
[mw_shl_code=bash,true][DEFAULT]
...
verbose = True[/mw_shl_code]

完成安装


1.测试计算节点是否支持硬件加速
[mw_shl_code=bash,true]egrep -c '(vmx|svm)' /proc/cpuinfo[/mw_shl_code]

如果返回值是0,则不支持硬件加速,使用QEMU 代替KVM
a.编辑文件 /etc/nova/nova.conf中 [libvirt]部分

[mw_shl_code=bash,true][libvirt]
...
virt_type = qemu[/mw_shl_code]

2.启动计算服务
[mw_shl_code=bash,true]systemctl enable libvirtd.service openstack-nova-compute.service
systemctl start libvirtd.service openstack-nova-compute.service[/mw_shl_code]

验证安装

1.加载管理员认证
[mw_shl_code=bash,true] source admin-openrc.sh[/mw_shl_code]

2.列出计算服务
[mw_shl_code=bash,true]nova service-list[/mw_shl_code]
[mw_shl_code=bash,true]+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary           | Host       | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| 1  | nova-conductor   | controller | internal | enabled | up    | 2014-09-16T23:54:02.000000 | -               |
| 2  | nova-consoleauth | controller | internal | enabled | up    | 2014-09-16T23:54:04.000000 | -               |
| 3  | nova-scheduler   | controller | internal | enabled | up    | 2014-09-16T23:54:07.000000 | -               |
| 4  | nova-cert        | controller | internal | enabled | up    | 2014-09-16T23:54:00.000000 | -               |
| 5  | nova-compute     | compute1   | nova     | enabled | up    | 2014-09-16T23:54:06.000000 | -               |
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+[/mw_shl_code]

3.列出API endpoints
[mw_shl_code=bash,true]nova endpoints
+-----------+------------------------------------------------------------+
| nova      | Value                                                      |
+-----------+------------------------------------------------------------+
| id        | 1fb997666b79463fb68db4ccfe4e6a71                           |
| interface | public                                                     |
| region    | RegionOne                                                  |
| region_id | RegionOne                                                  |
| url       | http://controller:8774/v2/ae7a98326b9c455588edd2656d723b9d |
+-----------+------------------------------------------------------------+
+-----------+------------------------------------------------------------+
| nova      | Value                                                      |
+-----------+------------------------------------------------------------+
| id        | bac365db1ff34f08a31d4ae98b056924                           |
| interface | admin                                                      |
| region    | RegionOne                                                  |
| region_id | RegionOne                                                  |
| url       | http://controller:8774/v2/ae7a98326b9c455588edd2656d723b9d |
+-----------+------------------------------------------------------------+
+-----------+------------------------------------------------------------+
| nova      | Value                                                      |
+-----------+------------------------------------------------------------+
| id        | e37186d38b8e4b81a54de34e73b43f34                           |
| interface | internal                                                   |
| region    | RegionOne                                                  |
| region_id | RegionOne                                                  |
| url       | http://controller:8774/v2/ae7a98326b9c455588edd2656d723b9d |
+-----------+------------------------------------------------------------+

+-----------+----------------------------------+
| glance    | Value                            |
+-----------+----------------------------------+
| id        | 41ad39f6c6444b7d8fd8318c18ae0043 |
| interface | admin                            |
| region    | RegionOne                        |
| region_id | RegionOne                        |
| url       | http://controller:9292           |
+-----------+----------------------------------+
+-----------+----------------------------------+
| glance    | Value                            |
+-----------+----------------------------------+
| id        | 50ecc4ce62724e319f4fae3861e50f7d |
| interface | internal                         |
| region    | RegionOne                        |
| region_id | RegionOne                        |
| url       | http://controller:9292           |
+-----------+----------------------------------+
+-----------+----------------------------------+
| glance    | Value                            |
+-----------+----------------------------------+
| id        | 7d3df077a20b4461a372269f603b7516 |
| interface | public                           |
| region    | RegionOne                        |
| region_id | RegionOne                        |
| url       | http://controller:9292           |
+-----------+----------------------------------+

+-----------+----------------------------------+
| keystone  | Value                            |
+-----------+----------------------------------+
| id        | 88150c2fdc9d406c9b25113701248192 |
| interface | internal                         |
| region    | RegionOne                        |
| region_id | RegionOne                        |
| url       | http://controller:5000/v2.0      |
+-----------+----------------------------------+
+-----------+----------------------------------+
| keystone  | Value                            |
+-----------+----------------------------------+
| id        | cecab58c0f024d95b36a4ffa3e8d81e1 |
| interface | public                           |
| region    | RegionOne                        |
| region_id | RegionOne                        |
| url       | http://controller:5000/v2.0      |
+-----------+----------------------------------+
+-----------+----------------------------------+
| keystone  | Value                            |
+-----------+----------------------------------+
| id        | fc90391ae7cd4216aca070042654e424 |
| interface | admin                            |
| region    | RegionOne                        |
| region_id | RegionOne                        |
| url       | http://controller:35357/v2.0     |
+-----------+----------------------------------+[/mw_shl_code]


4.列出镜像

[mw_shl_code=bash,true]nova image-list[/mw_shl_code]

[mw_shl_code=bash,true]+--------------------------------------+---------------------+--------+--------+
| ID                                   | Name                | Status | Server |
+--------------------------------------+---------------------+--------+--------+
| 38047887-61a7-41ea-9b49-27987d5e8bb9 | cirros-0.3.4-x86_64 | ACTIVE |        |
+--------------------------------------+---------------------+--------+--------+[/mw_shl_code]

相关篇章

openstack【Kilo】入门 【准备篇】一:整体介绍【centos】
http://www.aboutyun.com/thread-15205-1-1.html


openstack【Kilo】入门 【准备篇】二:检测网络互通性【centos】
http://www.aboutyun.com/thread-15206-1-1.html


openstack【Kilo】入门 【准备篇】三:NTP安装【centos】
http://www.aboutyun.com/thread-15207-1-1.html



openstack【Kilo】入门 【准备篇】四:openstack包【centos】
http://www.aboutyun.com/thread-15210-1-1.html



openstack【Kilo】入门 【准备篇】五:mysql及rabbitmq安装【centos】
http://www.aboutyun.com/thread-15213-1-1.html



openstack【Kilo】入门 【keystone篇】六:keystone安装配置【centos】
http://www.aboutyun.com/thread-15214-1-1.html



openstack【Kilo】入门 【keystone篇】七:创建服务实例和API endpoint【centos】
http://www.aboutyun.com/thread-15215-1-1.html



openstack【Kilo】入门 【keystone篇】八:创建租户, 用户, 和角色【centos】
http://www.aboutyun.com/thread-15216-1-1.html



openstack【Kilo】入门 【keystone篇】九:验证keystone安装【centos】
http://www.aboutyun.com/thread-15233-1-1.html




openstack【Kilo】入门 【keystone篇】十:创建openstack客户端脚本【centos】
http://www.aboutyun.com/thread-15234-1-1.html



openstack【Kilo】入门 【glance篇】十一:安装配置glance【centos】
http://www.aboutyun.com/thread-15242-1-1.html



openstack【Kilo】入门 【glance篇】十二:glance安装验证【centos】
http://www.aboutyun.com/thread-15243-1-1.html




openstack【Kilo】入门 【nova篇】十三:nova安装配置1:控制节点【centos】
http://www.aboutyun.com/thread-15258-1-1.html



openstack【Kilo】入门 【nova篇】十四:nova安装配置2:计算节点【centos】
http://www.aboutyun.com/thread-15259-1-1.html



openstack【Kilo】入门 【neutron篇】十五:neutron安装配置:控制节点【centos】
http://www.aboutyun.com/thread-15260-1-1.html




openstack【Kilo】入门 【neutron篇】十六:neutron安装配置:网络节点【centos】
http://www.aboutyun.com/thread-15272-1-1.html



openstack【Kilo】入门 【neutron篇】十七:neutron安装配置:计算节点【centos】
http://www.aboutyun.com/thread-15330-1-1.html




openstack【Kilo】入门 【neutron篇】十八:实例化网络【centos】
http://www.aboutyun.com/thread-15342-1-1.html




openstack【Kilo】入门 【neutron篇】十九:dasboard安装配置【centos】
http://www.aboutyun.com/thread-15352-1-1.html




openstack【Kilo】入门 【neutron篇】二十:创建实例(neutron)【centos】
http://www.aboutyun.com/thread-15356-1-1.html



已有(4)人评论

跳转到指定楼层
leoevo 发表于 2015-10-24 10:16:48
本帖最后由 leoevo 于 2015-10-24 15:20 编辑

我在按照文档学习部署时遇到了问题请帮助查看,使用的环境为虚拟机centos7,在安装完计算节点后发现服务启动有问题
openstack-nova-compute.service   loaded activating start     start
ipmievd.service                            loaded failed     failed
同时查看了nova-compute日志发现如下报错:
2015-10-24 10:00:35.396 23874 ERROR nova.openstack.common.threadgroup [req-43382c74-5240-46fc-ad59-141e0f38b29c - - - - -] XML error: Missing CPU model name
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup Traceback (most recent call last):
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/nova/openstack/common/threadgroup.py", line 145, in wait
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup     x.wait()
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/nova/openstack/common/threadgroup.py", line 47, in wait
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup     return self.thread.wait()
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/eventlet/greenthread.py", line 175, in wait
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup     return self._exit_event.wait()
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/eventlet/event.py", line 121, in wait
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup     return hubs.get_hub().switch()
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/eventlet/hubs/hub.py", line 294, in switch
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup     return self.greenlet.switch()
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/eventlet/greenthread.py", line 214, in main
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup     result = function(*args, **kwargs)
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/nova/openstack/common/service.py", line 502, in run_service
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup     service.start()
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/nova/service.py", line 164, in start
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup     self.manager.init_host()
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 1270, in init_host
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup     self.driver.init_host(host=self.host)
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 528, in init_host
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup     self._do_quality_warnings()
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 506, in _do_quality_warnings
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup     caps = self._host.get_capabilities()
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/host.py", line 750, in get_capabilities
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup     libvirt.VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES)
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 183, in doit
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup     result = proxy_call(self._autowrap, f, *args, **kwargs)
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 141, in proxy_call
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup     rv = execute(f, *args, **kwargs)
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 122, in execute
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup     six.reraise(c, e, tb)
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup   File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 80, in tworker
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup     rv = meth(*args, **kwargs)
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup   File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3329, in baselineCPU
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup     if ret is None: raise libvirtError ('virConnectBaselineCPU() failed', conn=self)
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup libvirtError: XML error: Missing CPU model name
2015-10-24 10:00:35.396 23874 TRACE nova.openstack.common.threadgroup
2015-10-24 10:00:38.177 23907 INFO nova.virt.driver [-] Loading compute driver 'libvirt.LibvirtDriver'
2015-10-24 10:00:38.190 23907 INFO nova.openstack.common.periodic_task [-] Skipping periodic task _periodic_update_dns because its interval is negative
2015-10-24 10:00:38.298 23907 INFO oslo_messaging._drivers.impl_rabbit [req-a32d6e86-a1b6-409d-b7fc-5a3b8ca0b7b8 - - - - -] Connecting to AMQP server on controller:5672
2015-10-24 10:00:38.319 23907 INFO oslo_messaging._drivers.impl_rabbit [req-a32d6e86-a1b6-409d-b7fc-5a3b8ca0b7b8 - - - - -] Connected to AMQP server on controller:5672
2015-10-24 10:00:38.324 23907 INFO oslo_messaging._drivers.impl_rabbit [req-a32d6e86-a1b6-409d-b7fc-5a3b8ca0b7b8 - - - - -] Connecting to AMQP server on controller:5672
2015-10-24 10:00:38.341 23907 INFO oslo_messaging._drivers.impl_rabbit [req-a32d6e86-a1b6-409d-b7fc-5a3b8ca0b7b8 - - - - -] Connected to AMQP server on controller:5672
2015-10-24 10:00:38.377 23907 INFO nova.service [-] Starting compute node (version 2015.1.1-1.el7)
2015-10-24 10:00:38.443 23907 INFO nova.virt.libvirt.driver [-] Connection event '1' reason 'None'
2015-10-24 10:00:38.457 23907 WARNING nova.virt.libvirt.driver [req-13e1c0be-180b-4ff4-8743-6781aa572157 - - - - -] Cannot update service status on host "compute1" since it is
not registered.
2015-10-24 10:00:38.464 23907 INFO nova.virt.libvirt.host [req-13e1c0be-180b-4ff4-8743-6781aa572157 - - - - -] Libvirt host capabilities <capabilities>
我把控制和计算节点的selinux都已经关闭问题依旧,控制点nova service-list也无法查看到计算节点
请帮忙分析 感谢

补充:
systemctl status libvirtd.service openstack-nova-compute.service -l查看了必要服务情况发现 libvirtd.service 也有报错

libvirtd.service - Virtualization daemon
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled)
   Active: active (running) since Sat 2015-10-24 15:08:25 CST; 15s ago
     Docs: man:libvirtd(8)
           http://libvirt.org
Main PID: 25958 (libvirtd)
   CGroup: /system.slice/libvirtd.service
           鈹斺攢25958 /usr/sbin/libvirtd
Oct 24 15:08:33 compute1 libvirtd[25958]: XML error: Missing CPU model name
Oct 24 15:08:33 compute1 libvirtd[25958]: End of file while reading data: Input/output error
Oct 24 15:08:36 compute1 libvirtd[25958]: internal error: Cannot find suitable CPU model for given data
Oct 24 15:08:36 compute1 libvirtd[25958]: Failed to get host CPU
Oct 24 15:08:36 compute1 libvirtd[25958]: XML error: Missing CPU model name
Oct 24 15:08:36 compute1 libvirtd[25958]: End of file while reading data: Input/output error
Oct 24 15:08:39 compute1 libvirtd[25958]: internal error: Cannot find suitable CPU model for given data
Oct 24 15:08:39 compute1 libvirtd[25958]: Failed to get host CPU
Oct 24 15:08:39 compute1 libvirtd[25958]: XML error: Missing CPU model name
Oct 24 15:08:39 compute1 libvirtd[25958]: End of file while reading data: Input/output error
回复

使用道具 举报

arsenduan 发表于 2015-10-24 13:01:37
leoevo 发表于 2015-10-24 10:16
我在按照文档学习部署时遇到了问题请帮助查看,使用的环境为虚拟机centos7,在安装完计算节点后发现服务启 ...

1.测试计算节点是否支持硬件加速

[mw_shl_code=bash,true]egrep -c '(vmx|svm)' /proc/cpuinfo[/mw_shl_code]


如果返回值是0,则不支持硬件加速,使用QEMU 代替KVM
a.编辑文件 /etc/nova/nova.conf中 [libvirt]部分

[mw_shl_code=bash,true][libvirt]
...
virt_type = qemu[/mw_shl_code]

这里执行下,看看什么问题

回复

使用道具 举报

leoevo 发表于 2015-10-24 15:17:49
arsenduan 发表于 2015-10-24 13:01
1.测试计算节点是否支持硬件加速

[mw_shl_code=bash,true]egrep -c '(vmx|svm)' /proc/cpuinfo[/mw_sh ...

我是测试的虚拟环境不支持硬件加速已经设置为qemu


补充内容 (2015-10-24 23:02):
我又查了两个关键服务的情况systemctl status libvirtd.service openstack-nova-compute.service -l发现libvirtd也有报错
libvirtd.service - Virtualization daemon
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled)
   Active: active (running) since Sat 2015-10-24 20:58:32 CST; 2h 1min ago
     Docs: man:libvirtd(8)
           http://libvirt.org
Main PID: 1093 (libvirtd)
   CGroup: /system.slice/libvirtd.service
           鈹溾攢1093 /usr/sbin/libvirtd
           鈹溾攢1834 /sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --dhcp-script=/usr/libexec/libvirt_leaseshelper
           鈹斺攢1835 /sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --dhcp-script=/usr/libexec/libvirt_leaseshelper

Oct 24 22:59:41 compute1 libvirtd[1093]: XML error: Missing CPU model name
Oct 24 22:59:41 compute1 libvirtd[1093]: End of file while reading data: Input/output error
Oct 24 22:59:44 compute1 libvirtd[1093]: internal error: Cannot find suitable CPU model for given data
Oct 24 22:59:44 compute1 libvirtd[1093]: Failed to get host CPU
Oct 24 22:59:44 compute1 libvirtd[1093]: XML error: Missing CPU model name
Oct 24 22:59:44 compute1 libvirtd[1093]: End of file while reading data: Input/output error
Oct 24 22:59:47 compute1 libvirtd[1093]: internal error: Cannot find suitable CPU model for given data
Oct 24 22:59:47 compute1 libvirtd[1093]: Failed to get host CPU
Oct 24 22:59:47 compute1 libvirtd[1093]: XML error: Missing CPU model name
Oct 24 22:59:47 compute1 libvirtd[1093]: End of file while reading data: Input/output error
回复

使用道具 举报

bioger_hit 发表于 2015-10-25 17:10:48
leoevo 发表于 2015-10-24 15:17
我是测试的虚拟环境不支持硬件加速已经设置为qemu

先把环境整理好,为何有乱码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条