Ask Your Question

Adding Attribute to Nova Hosts

asked 2013-12-05 13:42:28 -0600

AZBob gravatar image

updated 2013-12-05 13:44:50 -0600

I have a need to add attributes to nova hosts to pull data from other, internal systems to display to users in Horizon. Think of the attribute sort of like a foreign key. I was wondering what is the best way to go about doing this? I looked at the compute_nodes table in the nova database and thought I'd add the required column there (or a meta_data column and possibly push the change to the project for use by others in case anyone else needs to relate arbitrary data to a host), but then I saw the compute_node_stats table and how it's a key/value table and thought to add it there, instead, which would be way less invasive. Does this seem like a reasonable approach? Is there some other way of getting this accomplished that I haven't thought of?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-12-14 00:06:57 -0600

jtopjian gravatar image

I think adding data to the compute_node_stats table would be pretty uninvasive, but since you would be manually entering data into that table, you'd have to watch out for migration updates. I don't believe that data manually added to this table would automatically be returned in API requests, though, so you would have to both manually add and manually retrieve the data. It might be easier to just make your own table or secondary database.

Host Aggregates allow arbitrary metadata to be applied to an aggregate. You could create one aggregate per compute node and then set your data that way. It's a bit of a round-about approach, though.

While looking around for other options, I came across the nova host-meta command. I thought this was just what you'd be looking for, but it turns out that this command applies a key=value to all instances on a host -- not on the host itself...

edit flag offensive delete link more

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: 2013-12-05 13:42:28 -0600

Seen: 100 times

Last updated: Dec 14 '13