这样还是无法启动nova-compute,报错:
2012-07-26 00:21:09 AUDIT nova.service [-] Starting compute node (version 2012.1-LOCALBRANCH:LOCALREVISION)
2012-07-26 00:21:10 CRITICAL nova [-] global name 'self' is not defined
打开文件 /usr/lib/python2.7/dist-packages/nova/virt/libvirt/connection.py作如下修改:
1699行开始的两行改为:
#@staticmethod #切记,一定呀注释这一行
def get_memory_mb_total(self):
#!/bin/bash
for a in libvirt-bin nova-compute nova-vncproxy nova-api; do service "$a" stop; done
for a in libvirt-bin nova-compute nova-vncproxy nova-api; do service "$a" start; done
执行脚本
查看服务是否正确运行
service nova-compute status
8.如果出现下列错误:
查看日志/var/log/nova/nova-compute.
ERROR unable to connect to ‘localhost:8000′: Connection refused
Traceback (most recent call last):
File “/usr/sbin/virt-install”, line 861, in ?
main()
File “/usr/sbin/virt-install”, line 636, in main
conn = cli.getConnection(options.connect)
File “/usr/lib/python2.4/site-packages/virtinst/cli.py”, line 126, in getConnection
conn = libvirt.open(connect)
File “/usr/lib/python2.4/site-packages/libvirt.py”, line 159, in open
if ret is None:raise libvirtError(‘virConnectOpen() failed’)
libvirtError: unable to connect to ‘localhost:8000′: Connection refused