Ask Your Question

Search nova instance by custom property

asked 2015-02-04 12:22:46 -0500

Saif gravatar image

I use below command on my nova instance

nova meta d2312dc6-0a47-4bea-b7de-52d7da506f70 set foo=bar

Now I would like to search my instance by foo, how to do that? I couldnt find any good way to do that.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-02-04 22:57:55 -0500

larsks gravatar image

I don't think there is a good way to do that. Using the Nova API, you would pull down a list of all servers visible to your tenant and iterate over them, looking for the appropriate metadata key, but I don't believe the API has support for any sort of server-side filtering, nor is this available in the command-line client.

edit flag offensive delete link more


Thanks for the response. It would be too much of an overhead to iterate all the servers. I will have to device another mechanism to search the instance by list of IDs. I hope that will be possible. I am actually trying to create a group of instance, volumes, images that form an application.

Saif gravatar imageSaif ( 2015-02-05 11:49:01 -0500 )edit

If you were to deploy your instance using Heat, then Heat would keep track of the resources that make up your application. I don't know if this would work for your use case; it's just a thought.

larsks gravatar imagelarsks ( 2015-02-06 10:09:33 -0500 )edit

I am not sure what it means when you say "Heat would keep track of resources", but it sounds interesting to me. Could you please send me some links/literature on this? In my use-case I want to capture changes that are made to the application by end-user in terms of metadata. Basically auditing.

Saif gravatar imageSaif ( 2015-02-06 16:39:38 -0500 )edit

I was referring to Heat, the OpenStack orchestration service. You provide it a template that describes the OpenStack resources required by your application, and Heat creates them for you. (Continued...)

larsks gravatar imagelarsks ( 2015-02-07 08:30:43 -0500 )edit

Given your latest comment, though, I don't think this is the solution you're looking for. It's a great way of grouping together nova servers, networks, routers, floating ips, storage, etc, but isn't really designed to track post-deployment changes or anything.

larsks gravatar imagelarsks ( 2015-02-07 08:31:41 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-02-04 12:22:46 -0500

Seen: 159 times

Last updated: Feb 04 '15