deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Lutterkort <lut...@redhat.com>
Subject Re: [PATCH] repair memory & storage unit at vsphere driver
Date Wed, 23 Nov 2011 23:47:22 GMT
On Sun, 2011-11-20 at 22:58 +0900, dai.ikd123@gmail.com wrote:
> 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)

Is this really right ? The docs[1] state that this is already in MB

> @@ -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),

Yes, according to docs this is in bytes, and needs to be converted to
GB.

David

[1] http://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/index.html


Mime
View raw message