deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dai.ikd...@gmail.com
Subject [PATCH] repair memory & storage unit at vsphere driver
Date Sun, 20 Nov 2011 13:58:40 GMT
From: ike-dai <daisuke.25@hotmail.co.jp>

---
 .../deltacloud/drivers/vsphere/vsphere_driver.rb   |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb b/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
index 96db242..e725d24 100644
--- a/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
+++ b/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
@@ -43,7 +43,7 @@ module Deltacloud::Drivers::VSphere
         service = vsphere.serviceInstance.content
         max_memory, max_cpu_cores = [], []
         service.rootFolder.childEntity.grep(RbVmomi::VIM::Datacenter).each do |dc|
-          max_memory << dc.hostFolder.childEntity.first.summary.effectiveMemory
+          max_memory << dc.hostFolder.childEntity.first.summary.effectiveMemory)/(1024*1024)
           max_cpu_cores << dc.hostFolder.childEntity.first.summary.numCpuCores
         end
         [Deltacloud::HardwareProfile::new('default') do
@@ -162,7 +162,7 @@ module Deltacloud::Drivers::VSphere
           properties = {
             :memory => config[:memorySizeMB],
             :cpus => config[:numCpu],
-            :storage => vm.summary.storage[:unshared],
+            :storage => vm.summary.storage[:unshared]/(1024*1024*1024),
             :name => config[:name],
             :full_name => config[:guestFullName],
           }
-- 
1.7.5.4


Mime
View raw message