简体   繁体   English

获取实例的所有操作日志及其附加的风味

[英]Get all the action log of an instance and the flavor attached to it

I was wondering if anyone can tell me how to get the action log of the instance using openstacksdk, novaclient.我想知道是否有人可以告诉我如何使用 openstacksdk、novaclient 获取实例的操作日志。 And while getting the action log, I also want to get the flavor attached to it.在获取操作日志的同时,我还想获得附加的味道。 See the attached picture please.请看附图。

I actually got the action log using this novaclient module:我实际上使用这个 novaclient 模块得到了动作日志:

    novaclient.v2.instance_action.InstanceAction

but it shows me very little details and without the flavor id that I needed.但它向我展示了非常少的细节,并且没有我需要的风味 ID。 The following fields it shows me are the following:它向我显示的以下字段如下:

    action, instance_uuid, message, project_id, request_id, start_time and user_id

I hope anyone can tell me how to get it.我希望任何人都可以告诉我如何获得它。

在此处输入图像描述

I don't think it is possible to get the flavor id from the action list / server event list.我认为不可能从操作列表/服务器事件列表中获取风味 ID。

Openstack does not keep a database record of what each request did, or a historic record of the instance states. Openstack 不保留每个请求所做的数据库记录,或实例状态的历史记录。 So you would need to resort to trawling the logs for the request-id... which is OK for forensics, but does not scale.因此,您需要求助于搜索请求 ID 的日志......这对于取证来说是可以的,但不能扩展。 (And I don't know if the flavor is in the log messages.) (而且我不知道日志消息中是否有味道。)

Of course, you could use the APIs (novaclient, openstacksdk) to get the current flavor for the instance, given its instance id.当然,您可以使用 API(novaclient、openstacksdk)来获取实例的当前风格,给定它的实例 ID。 But that isn't exactly what you want.但这并不是你想要的。


It is possible record historical information using Gnochi + Ceilometer or similar, but you would need to have set this up already.可以使用 Gnochi + Ceilometer 或类似工具记录历史信息,但您需要已经进行设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM