openstacknovaclientopenstacksdk

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.

enter image description here


Solution

  • 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.