通过 Nova 通知更新 DataModel¶
https://blueprints.launchpad.net/watcher/+spec/update-datamodel-by-nova-notifications
问题描述¶
Watcher 拥有一个计算数据模型 (CDM),其中包含关于实例和节点的所有信息。Nova 会在实例或节点更改状态时发出通知。因此 Watcher 可以消费 Nova 通知来更新其 CDM。目前 Watcher 仅考虑了几个通知,还有更多通知需要使用,例如实例的开机/关机。
用例¶
作为 Watcher 开发者,我希望消费 Nova 通知来更新 CDM。
提议的变更¶
我们定义一个功能字典来映射通知和 CDM。例如
def InstanceDelete(payload):
pass
def InstanceUpdate(payload):
pass
funcdict = {
'instance.delete.end': InstanceDelete,
'instance.update': InstanceUpdate,
}
def updateCDM(instancetype, payload):
func = funcdict.get(instancetype)
if func:
func(payload)
我们可以根据通知对 CDM 的影响对通知进行分类
在 CDM 中添加或更新实例
instance.create.end
instance.lock
instance.unlock
instance.pause.end
instance.power_off.end
instance.power_on.end
instance.resize_confirm.end
instance.restore.end
instance.resume.end
instance.shelve.end
instance.shutdown.end
instance.suspend.end
instance.unpause.end
instance.unrescue.end
instance.unshelve.end
instance.rebuild.end
instance.rescue.end
instance.update
instance.live_migration_force_complete.end
instance.live_migration_post_dest.end
从 CDM 中删除实例
instance.delete.end
instance.soft_delete.end
在 CDM 中添加或更新节点
service.create
service.update
从 CDM 中删除节点
service.delete
备选方案¶
无
数据模型影响¶
无
REST API 影响¶
无
安全影响¶
无
通知影响¶
Watcher 将开始消费更多来自 Nova 的通知。
其他最终用户影响¶
无
性能影响¶
无
其他部署者影响¶
无
开发人员影响¶
无
实现¶
负责人¶
- 主要负责人
<licanwei>
工作项¶
列出 Watcher 消费的用于更新 CDM 的 Nova 通知。
实现从通知负载更新 CDM 的代码。
依赖项¶
无
测试¶
应该添加单元测试。
文档影响¶
无
参考资料¶
历史¶
发布名称 |
描述 |
|---|---|
Stein |
引入 |