使用Kolla部署OpenStack 2024.2集群时nova调度器缓存刷新失败求助
使用Kolla部署2节点OpenStack 2024.2(Caracal)集群,涉及组件包含chrony、cinder、cron、elasticsearch、fluentd、glance、grafana、haproxy、heat、horizon、influxdb、iscsi、kafka、keepalived、keystone、kibana、kolla-toolbox、logstash、magnum、manila、mariadb、memcached、ceilometer、neutron、nova、octavia、placement、openvswitch、ovsdpdk、rabbitmq、senlin、storm、tgtd、zookeeper、proxysql、prometheus、redis、gnocchi。部署过程卡在nova组件的cell缓存刷新任务:
TASK [nova : Refresh cell cache in nova scheduler]
fatal: [ravenclaw]: FAILED! => {"changed": false, "module_stderr": "Hangup\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 129}
查看nova-scheduler容器日志,发现核心错误:
[...] Running command: 'nova-scheduler'
3 RLock(s) were not greened, to fix this error make sure you run eventlet.monkey_patch() before importing any other modules
Kolla的bootstrap和预检查阶段无失败记录,已尝试多次销毁重建集群、重新构建镜像,问题未解决。
1. 修复nova-scheduler启动脚本的eventlet补丁
Kolla构建的nova-scheduler镜像可能在启动时未正确执行eventlet.monkey_patch(),需验证并修复:
- 进入运行中的nova-scheduler容器:
docker exec -it nova_scheduler bash - 找到启动脚本(通常为
/usr/local/bin/kolla_start),在脚本开头添加以下Python代码片段,确保在导入任何Nova模块前执行:import eventlet eventlet.monkey_patch() - 重启nova-scheduler容器:
docker restart nova_scheduler
2. 自定义Kolla镜像构建逻辑
如果是自行构建Kolla镜像,需修改Nova组件的启动脚本模板:
- 定位到Kolla项目中nova-scheduler的模板目录(如
kolla/docker/nova/nova-scheduler/) - 修改启动脚本模板,在最顶部加入eventlet monkey patch代码
- 重新构建nova-scheduler镜像并重新部署集群
3. 验证eventlet版本兼容性
OpenStack Caracal对eventlet版本有明确依赖要求,检查容器内的eventlet版本是否符合要求:
docker exec nova_scheduler pip show eventlet
确保版本满足>=0.35.1(具体参考OpenStack Caracal官方依赖),若版本不符,可在Kolla镜像构建时指定正确版本,修改对应组件的requirements文件或构建参数。
4. 检查Nova配置中的eventlet开关
确认nova配置文件(/etc/nova/nova.conf)中未禁用eventlet monkey patch:
[DEFAULT] eventlet_monkey_patch = True
若该参数被设置为False,修改后重启nova-scheduler服务。
5. 手动执行cell缓存刷新
临时绕过部署任务失败,手动执行cell缓存刷新命令后继续部署:
docker exec -it nova_scheduler nova-manage cell_v2 discover_hosts --verbose
执行成功后,重新运行Kolla部署命令即可。
内容的提问来源于stack exchange,提问作者joyfantastic

