【时间】2014年2月25日
【平台】ubuntu 12.04.3
openstack havana with nova-network in multi-host
【日志】实例启动时输出的日志内容如下:
...
...- util.py[WARNING]: 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [114/120s]: url error [[Errno 111] Connection refused]
... - DataSourceEc2.py[CRITICAL]: giving up on md after 121 seconds
...
【情景】multi-host模式下,由nova-network提供网络服务。当使用官方提供的ubuntu12.04镜像启用新的实例时,无法获得实例的用户名,也无法注入ssh秘钥。
最后发现实例启动时输出的日志有多行WARNING信息,提示获取metadata数据失败。
【分析】因为本人的nova相关模块部署的时间较早,版本较低,且官方安装文档提到:
nova-api-metadata service. Accepts metadata requests from instances. The nova-api-metadata service is generally only used when you run in multi-host mode with nova-network installations.
On Debian systems, it is included in the nova-api package, and can be selected through debconf.
所以根据早期版本的官方安装文档,compute节点没有安装nova-api-metadata模块。然而,根据新的官方安装文档:
So that the nova-network service can forward metadata requests on each compute node, each compute node must install the nova-api-metadata service, as follows:
# apt-get install nova-network nova-api-metadata
在multi-host模式下,metadata服务请求由nova-network来转发,故每个compute节点上都需要安装nova-api-metadata模块。
【解决】
在compute节点上:
#apt-get install nova-api-metadata
#service nova-compute restart;service nova-network restart;service nova-api-metadata restart
在controller节点上:
#service nova-scheduler restart;service nova-api restart;service nova-cert restart;service nova-conductor restart;service nova-novncproxy restart;service nova-consoleauth restart
注意: 如果很久前部署的openstack平台,那么安装nova-api-metadata模块之后,可能出现版本兼容问题。详见另一博文。
【参考】
http://docs.openstack.org/havana/install-guide/install/apt/content/compute-service.html
http://docs.openstack.org/havana/install-guide/install/apt/content/nova-network.html
http://openstack.redhat.com/forum/discussion/282/how-to-fix-sshping-to-vms-metadata-api-issue/p1
http://www.vpsee.com/2011/11/how-to-solve-datasourceec2-pywarning-http169-254-169-254-failed-url-error-problem/
https://answers.launchpad.net/nova/+question/159317
http://docs.openstack.org/admin-guide-cloud/content/section_metadata-service.html
http://www.chenshake.com/http169-254-169-2542009-04-04meta-datainstance-id-failed-url-error-errno-111-connection-refused/
http://blog.iyunv.com/lynn_kong/article/details/9115033
http://blog.iyunv.com/lynn_kong/article/details/9146397
http://blog.iyunv.com/gtt116/article/details/17997053
https://bugs.launchpad.net/neutron/+bug/1174657
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com