[ 
https://issues.apache.org/jira/browse/DTACLOUD-123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13189745#comment-13189745
 ] 

Michal Fojtik commented on DTACLOUD-123:
----------------------------------------

I vote for short-term solution now :-)

diff --git a/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb 
b/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
index 69cfd13..581500a 100644
--- a/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
+++ b/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
@@ -42,13 +42,17 @@ module Deltacloud::Drivers::VSphere
       safely do
         service = vsphere.serviceInstance.content
         max_memory, max_cpu_cores = [], []
+        #
+        # Note: Memory is being hardcoded now to range 512MB to 2GB
+        #       JIRA: DTACLOUD-123
+        #
         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
           max_cpu_cores << dc.hostFolder.childEntity.first.summary.numCpuCores
         end
         [Deltacloud::HardwareProfile::new('default') do
           cpu (1..max_cpu_cores.min)
-          memory (128..max_memory.min)
+          memory (512..2048)
           architecture ['x86_64', 'i386']
         end]
       end
                
> vsphere - incorrect hwp memory range
> ------------------------------------
>
>                 Key: DTACLOUD-123
>                 URL: https://issues.apache.org/jira/browse/DTACLOUD-123
>             Project: DeltaCloud
>          Issue Type: Bug
>         Environment: deltacloud-core-vsphere-0.4.1-8.el6.noarch
> deltacloud-core-0.4.1-8.el6.noarch
>            Reporter: Jan Provaznik
>            Assignee: David Lutterkort
>
> When counting hwp memory for vsphere driver, max value is computed from 
> effectiveMemory (which is actual value - it can change in time). Minimum 
> value is hardcoded 128. There are 2 problems:
> 1) effectiveMemory can be lower then 128, then dc api returns invalid range, 
> I got this:
> #<DeltaCloud::HWP::Property:0x7fde69094af8 @value="128", @range={:to=>"0", 
> :from=>"128"}, @kind=:range, @   name="memory", @unit="MB">
> 2) conductor fetches hw profiles only once when a provider account is added, 
> so conductor uses this  effectiveMemory (which was actual at the moment when 
> the account was added) all the time.
> I think most easiest way is to use total memory for computing memory range on 
> DC API side, though then max memory can be unavailable sometimes. 
> On the other side, for other drivers min/max memory values are hardcoded too, 
> so using total memory doesn't break things more (in compare to other drivers).
> Alternatively there could be some api call how to get total memory.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to