From 06fd2363578b21726636cd189c7ab1ce0db632ba Mon Sep 17 00:00:00 2001 From: Chris Behrens Date: Thu, 5 Aug 2010 10:30:06 -0500 Subject: [PATCH] added bin/nova-listinstances, which is mostly just a duplication of euca-describe-instances but doesn't go through the API. --- bin/nova-listinstances | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 bin/nova-listinstances diff --git a/bin/nova-listinstances b/bin/nova-listinstances new file mode 100755 index 00000000..2f8ff28f --- /dev/null +++ b/bin/nova-listinstances @@ -0,0 +1,19 @@ +#!/usr/bin/python + +# +# Duplicates the functionality of euca-describe-instances, but doesn't require +# going through the API. Does a direct query to the datastore. This is +# mostly a test program written for the scheduler +# + +from nova.compute import model + +data_needed = ['image_id', 'memory_kb', 'local_gb', 'node_name', 'vcpus'] + +instances = model.InstanceDirectory().all + +for instance in instances: + print 'Instance: %s' % instance['instance_id'] + for x in data_needed: + print ' %s: %s' % (x, instance[x]) +