Ask Your Question

List servers - Instance's json

asked 2018-08-07 09:57:29 -0500

Darth-OpenStack gravatar image

updated 2018-08-07 10:58:35 -0500

Hello to everyone , as we know Openstack's Compute API only supports JSON request and response formats and in my network topology i have 2 instances beta_vm1 and beta_vm2. My goal here is to list(find) their specs or some of their info in json format, i dont want just to see the result of the search :

 openstack server list

The thing that i want is the json file of each vm , or at least the path to the json files cause i want to use their information for my python script.

Thank you in advance !

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2018-08-07 10:18:34 -0500

updated 2018-08-07 10:22:17 -0500

Try openstack server show beta_vm1 -f json. Or for all instances:

for s in $(openstack server list -c ID -f value)
    openstack server show $s -f json

Or use the OpenStack SDK or the API.

I am not aware of any filesystem file that stores server details.

edit flag offensive delete link more


Really thank you Bernd, one more question cause im a little new with python utilization for openstack. The code lines for all instances need to be in a .py file without importing something?

Darth-OpenStack gravatar imageDarth-OpenStack ( 2018-08-07 12:53:53 -0500 )edit

I already have source the credentials from the rc file and create a python env as the link say ( ( but gives me error all the time.

Darth-OpenStack gravatar imageDarth-OpenStack ( 2018-08-07 12:55:26 -0500 )edit

One or more .py files, and you canimport modules. A primer for writing application code based on OpenStack:

You could share your code and error messages on this site.

Bernd Bausch gravatar imageBernd Bausch ( 2018-08-07 17:01:12 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2018-08-07 09:57:29 -0500

Seen: 622 times

Last updated: Aug 07 '18