简体   繁体   中英

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. 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.v2.instance_action.InstanceAction

but it shows me very little details and without the flavor id that I needed. 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.

Openstack does not keep a database record of what each request did, or a historic record of the instance states. So you would need to resort to trawling the logs for the request-id... which is OK for forensics, but does not scale. (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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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