关于Cell的基本介绍,可以参考贤哥的一篇文章:

    【OpenStack】G版中关于Nova的Cell  http://blog.csdn.net/lynn_kong/article/details/8564558

详细的代码分析,可以参考gaoxingnengjisuan的blog:

     OpenStack Nova-cell服务的源码解析(编者注:G版)http://blog.csdn.net/gaoxingnengjisuan/article/details/14216977

Cell的服务部署:

Cell的消息路由:

按照官方的推荐部署方案部署:即API Cell只部署nova-api,nova-cells服务,在Child Cell中部署除nova-api之外的全部cell服务(在本人的实际部署中,nova-compute单独部署在另一个节点)

在部署完nova-cells的服务之后,API cell上输入nova-manage service list,输出正常,但只显示本机的nova服务:
 
Binary           Host                                   Zone             Status     State Updated_At
nova-cells       API-cell                             internal         enabled    :-)   2014-04-04 09:57:47
 
在Child Cell 或nova-Compute节点上,输入nova-manage service list,输出也正常,但也只显示本Cell的nova服务:
 
Binary                   Host                                 Zone             Status     State Updated_At
nova-cert                Cell                                 internal         enabled    :-)   2014-04-04 10:00:11
nova-conductor       Cell                                 internal         enabled    :-)   2014-04-04 10:00:19
nova-consoleauth     Cell                                internal         enabled    :-)   2014-04-04 10:00:12
nova-scheduler        Cell                                 internal         enabled    :-)   2014-04-04 10:00:12
nova-cells               Cell                                 internal         enabled    :-)   2014-04-04 10:00:11
nova-compute     Computer3                         nova             enabled    :-)   2014-04-04 10:00:13
但是,在任意节点 终端输入 nova service-list 和 nova   host-list 命令将报错:

命令报错:

ERROR: Theserver has either erred or is incapable of performing the requested operation.(HTTP 500) (Request-ID: req-dfa169cf-db9e-44c6-b51b-0d80e4a89e3b)

跟踪 API Cell 节点的 nova-api.log, 输出如下错误信息:

2014-04-04 15:17:25.151 3172 ERROR nova.api.openstack [req-dfa169cf-db9e-44c6-b51b-0d80e4a89e3b 836609a159f244738933dc7c5cb6266a d965a
339b99a4d2da2be18bd0334b9ff] Caught error: invalid literal for int() with base 10: 'api!cell@1'
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack Traceback (most recent call last):
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/__init__.py", line 1
19, in __call__
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack return req.get_response(self.application)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1296, in send
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack application, catch_exc_info=False)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1260, in call_a
pplication
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack app_iter = application(self.environ, start_response)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack return resp(environ, start_response)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/keystoneclient/middleware/auth_token.py
", line 539, in __call__
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack return self.app(env, start_response) [26/1914]
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack return resp(environ, start_response)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack return resp(environ, start_response)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/routes/middleware.py", line 131, in __c
all__
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack response = self.app(environ, start_response)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack return resp(environ, start_response)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack resp = self.call_func(req, *args, **self.kwargs)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack return self.func(req, *args, **kwargs)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 938,
in __call__
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack content_type, body, accept)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 997,
in _process_stack
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack action_result = self.dispatch(meth, request, action_args)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 1078,
in dispatch
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack return method(req=request, **action_args)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/contrib/serv
ices.py", line 139, in index
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack services = self._get_services_list(req, detailed)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/contrib/serv
ices.py", line 117, in _get_services_list
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack services = self._get_services(req)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/contrib/serv
ices.py", line 86, in _get_services
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack context, set_zones=True)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/compute/cells_api.py", line 469, in service_get_all
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack services)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/objects/base.py", line 606, in obj
_make_list
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack **extra_args)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/objects/service.py", line 67, in _
from_db_object
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack service[key] = db_service[key]
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/objects/base.py", line 405, in __s
etitem__
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack setattr(self, name, value)
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/objects/base.py", line 66, in sett
er
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack return setattr(self, get_attrname(name), typefn(value))
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack ValueError: invalid literal for int() with base 10: 'api!cell@1'
2014-04-04 15:17:25.151 3172 TRACE nova.api.openstack
2014-04-04 15:17:25.154 3172 INFO nova.api.openstack [req-dfa169cf-db9e-44c6-b51b-0d80e4a89e3b 836609a159f244738933dc7c5cb6266a d965a3
39b99a4d2da2be18bd0334b9ff] http://192.168.122.12:8774/v2/d965a339b99a4d2da2be18bd0334b9ff/os-services returned with HTTP 500
2014-04-04 15:17:25.155 3172 INFO nova.osapi_compute.wsgi.server [req-dfa169cf-db9e-44c6-b51b-0d80e4a89e3b 836609a159f244738933dc7c5cb
6266a d965a339b99a4d2da2be18bd0334b9ff] 192.168.122.14 "GET /v2/d965a339b99a4d2da2be18bd0334b9ff/os-services HTTP/1.1" status: 500 len
: 335 time: 0.1216350

后来查询了N久,发现社区已有人提出Bugs:https://bugs.launchpad.net/nova/+bug/1251043

并已解决:

  Reviewed: https://review.openstack.org/81282
  Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=0df94733f7283cbc1e9ae7d27f5cd443158cae8e

因为在Cell中,主机名的ID 前面加了一个前缀:cell routing path,所以格式为<cell routing path>@ID,而nova object模块里,会用一个int()的方法来将id的字符串变为整数,而int('api!cell@1')显然会报一个ValueError!

Patch 中给出的办法就是用一个代理类ServiceProxy,来处理附加在id前面的cell_paths,如下:

class ServiceProxy(object):
def __init__(self, obj, cell_path):
self._obj = obj
self._cell_path = cell_path @property
def id(self):
return cells_utils.cell_with_item(self._cell_path, self._obj.id) def __getitem__(self, key):
if key == 'id':
return self.id return getattr(self._obj, key) def __getattr__(self, key):
return getattr(self._obj, key)

目前,输入nova service-list,得到正常输出,返回各个节点的nova服务,问题解决:

在Openstack H版部署Nova Cell 时 ,终端输入nova service-list 和 nova host-list 命令将报错的更多相关文章

  1. docker 部署mysql tomcat时 在root@localhost~下——-——docker exec -it 容器名 /bin/bash 报错

    在docker部署mysql时 报错 找不到 容器不自动启动  , docker start 容器名  也没有效果 多次尝试发现 原因是创建容器时在 下面创建的 更改为下创建 问题解决

  2. openstack Q版部署-----nova服务配置-控制节点(5)

    一.创建数据库(控制节点) 创建数据库以及用户: CREATE DATABASE nova_api; CREATE DATABASE nova; CREATE DATABASE nova_cell0; ...

  3. OpenStack H版与 Ceph 整合的现状

    转自:https://www.ustack.com/blog/openstack_and_ceph/ Contents 1 Ceph与Nova整合 2 Ceph与Cinder整合 3 相关Patch ...

  4. openstack Q版部署-----Cinder云存储服务(10)

    一.cinder介绍 一般 cinder-api 和 cinder-scheduler 安装在控制节点上, cinder-volume 安装在存储节点上. 二.数据库配置 # 在任意控制节点创建数据库 ...

  5. openstack Q版部署-----网络服务(neutron)安装部署(7)

    一.数据库配置(控制节点) 控制节点创建数据库: CREATE DATABASE neutron; GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'lo ...

  6. openstack Q版部署-----安装报错问题

    1.实例开机提示找不到磁盘Booting from Hard Disk... GRUB. 开启 CPU 虚拟化支持. 将计算节点 nova.conf 配置修改如下即可: [libvirt] cpu_m ...

  7. docker-compose exec时 出现"fork/exec /proc/self/exe: no such file or directory" 报错

    问题:跟往常一样执行docker-compos exec redis sh时出现如下错误,而容器是运行状态中. # docker-compose exec redis sh rpc error: co ...

  8. Dubbo+zookeeper部署到tomcat上注意事项,遇到的问题,闪退,运行报错等

    需要下载工具zookeeper-3.4.14.tar.gz,dubbo-2.5.x.zip,apache-tomcat-8.5.47-windows-x64.zip这些官网都可以先下载到 1.最新的z ...

  9. openstack Q版部署-----nova服务配置-计算节点(6)

    一.服务安装(计算节点) 安装软件: yum install openstack-nova-compute -y 编辑/etc/nova/nova.conf文件并设置如下内容: [DEFAULT] e ...

随机推荐

  1. iterator迭代器的使用

    部分摘自C++ Primer: 所有的标准库容器类都定义了相应的iterator类型,如vector:vector<int>::iterator iter; 这条语句定义了一个名为iter ...

  2. 20 Valid Parentheses(匹配括号)

    题目意思:判断一个字符串(){}[]是否符合 思路:用栈ps:实习一个多月了,代码也刷不动了,状态真不是一般的差 class Solution { public: bool isValid(strin ...

  3. 大型情感类电视连续剧--Android高德之旅(3)地图交互

    总要说两句 前两篇讲到了地图的基础显示和地图类型,今天来记录下高德地图交互相关的设置.地图的绘制分很多层,层级的显示需要根据不同的场景来设置.地图的触摸事件也很丰富,有单击.双击.单指拖拽.双指拖拽. ...

  4. 桂电在线-php-提取菜单到配置文件2

    继续昨晚没完成的主菜单模板: <!-- 菜单块 --> <div class="on-light" id="menus"> <?p ...

  5. 入门6:PHP 语法基础——循环

    一.for循环 for($i=0;$i<10;$i++){ echo "Hello".$i."</br>"; } 二.while循环 $i = ...

  6. onethink 换空间报错 解决方案

    onethink 换空间的时候有两个配置文件 Application\Common\Conf Application\User\Conf 如果报错先测试数据库 <?php $con = mysq ...

  7. Python 关于正负无穷float(‘inf’)的一些用法

    Python中可以用如下方式表示正负无穷: float("inf"), float("-inf") 利用 inf 做简单加.乘算术运算仍会得到 inf > ...

  8. Cannot open your terminal '/dev/pts/4' - please check.

    使用screen命令的时候出现了下面的错误 Cannot open your terminal '/dev/pts/4' - please check. 可以使用script命令来记录这个终端会话, ...

  9. winfrom获得鼠标的坐标

    Point mouse = this.PointToScreen(Control.MousePosition);label1.Text = mouse.X.ToString() + ":&q ...

  10. Spring4.0整合Hibernate3 .6

    转载自:http://greatwqs.iteye.com/blog/1044271 6.5  Spring整合Hibernate 时至今日,可能极少有J2EE应用会直接以JDBC方式进行持久层访问. ...