Repository: libcloud
Updated Branches:
  refs/heads/trunk 9af583c98 -> ff05bdbae


Include more attributes in the extra dict of vSphere Node object.


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/ff05bdba
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/ff05bdba
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/ff05bdba

Branch: refs/heads/trunk
Commit: ff05bdbaecf6e7fc129b55dcebf6dd93e70ebcd0
Parents: 9af583c
Author: Tomaz Muraus <[email protected]>
Authored: Tue Jul 29 22:52:40 2014 +0200
Committer: Tomaz Muraus <[email protected]>
Committed: Tue Jul 29 22:52:40 2014 +0200

----------------------------------------------------------------------
 libcloud/compute/drivers/vsphere.py | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/ff05bdba/libcloud/compute/drivers/vsphere.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/vsphere.py 
b/libcloud/compute/drivers/vsphere.py
index 9db15cb..31086e5 100644
--- a/libcloud/compute/drivers/vsphere.py
+++ b/libcloud/compute/drivers/vsphere.py
@@ -359,7 +359,10 @@ class VSphereNodeDriver(NodeDriver):
         properties = vm.get_properties()
         status = vm.get_status()
 
-        id = vm.properties.config.uuid
+        uuid = vm.properties.config.uuid
+        instance_uuid = vm.properties.config.instanceUuid
+
+        id = uuid
         name = properties['name']
         public_ips = []
         private_ips = []
@@ -369,16 +372,27 @@ class VSphereNodeDriver(NodeDriver):
         net = properties.get('net', [])
         resource_pool_id = vm.properties.resourcePool._obj
 
+        try:
+            operating_system = vm.properties.summary.guest.guestFullName,
+        except Exception:
+            operating_system = 'unknown'
+
         extra = {
-            'uuid': id,
+            'uuid': uuid,
+            'instance_uuid': instance_uuid,
             'path': properties['path'],
+            'resource_pool_id': resource_pool_id,
             'hostname': properties.get('hostname', None),
             'guest_id': properties['guest_id'],
             'devices': properties.get('devices', {}),
             'disks': properties.get('disks', []),
             'net': net,
 
-            'resource_pool_id': resource_pool_id
+            'overall_status': vm.properties.overallStatus,
+            'operating_system': operating_system,
+
+            'cpus': vm.properties.config.hardware.numCPU,
+            'memory_mb': vm.properties.config.hardware.memoryMB
         }
 
         # Add primary IP

Reply via email to