summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Santa Barbara <justin@fathomdb.com>2011-03-14 15:37:04 -0700
committerJustin Santa Barbara <justin@fathomdb.com>2011-03-14 15:37:04 -0700
commit9f135cc4d6069a0b882c8e848d3b6cb292002d10 (patch)
tree290f137aa034bbbe7b2a4e1ef9f4f99e759d63e6
parent738653b6b4ac744519a050fe50e7c795a7c63579 (diff)
downloadnova-9f135cc4d6069a0b882c8e848d3b6cb292002d10.tar.gz
nova-9f135cc4d6069a0b882c8e848d3b6cb292002d10.tar.xz
nova-9f135cc4d6069a0b882c8e848d3b6cb292002d10.zip
Implemented Hyper-V list_instances_detail function. Needs a cleanup
by someone that knows the Hyper-V code
-rw-r--r--nova/virt/hyperv.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/nova/virt/hyperv.py b/nova/virt/hyperv.py
index aea7413c6..435272109 100644
--- a/nova/virt/hyperv.py
+++ b/nova/virt/hyperv.py
@@ -126,6 +126,19 @@ class HyperVConnection(driver.ComputeDriver):
for v in self._conn.Msvm_ComputerSystem(['ElementName'])]
return vms
+ def list_instances_detail(self):
+ #TODO(justinsb): This is a terrible implementation (1+N)
+ instance_infos = []
+ for instance_name in self.list_instances():
+ info = self.get_info(instance_name)
+
+ state = info['state']
+
+ instance_info = driver.InstanceInfo(instance_name, state)
+ instance_infos.append(instance_info)
+
+ return instance_infos
+
def spawn(self, instance):
""" Create a new VM and start it."""
vm = self._lookup(instance.name)
@@ -347,7 +360,7 @@ class HyperVConnection(driver.ComputeDriver):
newinst = cl.new()
#Copy the properties from the original.
for prop in wmi_obj._properties:
- newinst.Properties_.Item(prop).Value =\
+ newinst.Properties_.Item(prop).Value = \
wmi_obj.Properties_.Item(prop).Value
return newinst