polling/diffing instances in openstack
March 27, 2013
I’m trying to produce a simple list of instances on the fedora
openstack instance. I want to produce a list every 10m or so and diff
it against the last copy of that list and output the changes.
Here’s what I came up with:
it is based originally on nova-manage. It runs as root on the head system in our cloud and just dumps out json, then diffs the json.
Everything works but I’m trying to figure out if this is the ‘right’
way of going about this.
I thought about doing it via nova instead of using the nova-manage
direct-to-db api but I had 2 problems:
1. I would need to save the plaintext admin pw somewhere on disk to
poll for that info
2. or get a token which I would have to renew every 24 hours
We’re using the above the script as a simple cron job that lets us know
what things are changing in our cloud (who is bringing up new
instances, how many, what ips they are attaching to them, etc)
Additionally, is there a way in the db api to easily query the tenant and user info from keystone? I’d like to expand out the user uuid into username/project name.