openstacksdk conn.list_server() result doesn't have "hostname" attribute

asked 2019-04-13 12:59:20 -0500

legochen gravatar image

Hi, I’m encountering an openstacksdk issue. The .list_server result doesn’t include hostname attribute.

# Import the OpenStack connection class from the SDK
from openstack import connection

# Create a connection object by calling the constructor and pass the security information
conn = connection.Connection(auth_url="XXXX",

# Iterate through the list of VMs and print them
for server in conn.list_servers():

I have made some tests, looks like it missed to determine hostname in the Server class.

I have tried the add one line hostname = resource.Body('hostname') after the following line, then I can see hostname showed in list_server()result. (

Not sure is there any reason SDK doesn’t determine hostname in the Server class or just missed.

I’m just new to OpenStack, please help to guide me how to solve this issue. I think hostname is one of necessary attributes of compute server information.

edit retag flag offensive close merge delete