[sdk]: Check instance error message

tjoen tjoen at dds.nl
Thu Nov 18 07:08:34 UTC 2021


On 11/17/21 23:20, melanie witt wrote:
> On Tue Nov 16 2021 09:55:32 GMT-0800 (Pacific Standard Time), dmeng 
> <dmeng at uvic.ca> wrote:
>> I'm wondering if there is any method that could check the error 
>> message of an instance whose status is "ERROR"? Like from openstack 
>> cli, "openstack server show server_name", if the server is in "ERROR" 
>> status, this will return a field "fault" with a message shows the 
>> error. I tried the compute service get_server and find_server, but 
>> neither of them show the error messages of an instance.
> 
> This can be hacked around by, for example:
> 
> import openstack
> from openstack.compute.v2 import server
> from openstack import resource
> 
> 
> class MyServer(server.Server):
>      fault = resource.Body('fault', type=dict)
> 
> 
> conn = openstack.connect(cloud='devstack')
> s = conn.compute._get(MyServer, '9282db95-801f-4f43-90fb-e86d9bfb6785')
> s.fault
> {'code': 500, 'created': '2021-09-17T02:23:16Z', 'message': 'No valid 
> host was found. '}

In my (not OP) case the problems were mostly python or sudo errors
So journalctl still needed



More information about the openstack-discuss mailing list