On Fri, 2012-01-06 at 16:38 +0100, Jan Provazník wrote: > Hi, > vshpere driver computes max memory value from effective memory (see > http://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.ComputeResource.Summary.html#effectiveMemory), > > effectiveMemory value can change in time. > > Problem is that conductor fetches hw profiles only once when an account > is created and uses these cached profiles in future (IOW conductor > doesn't fetch hwprofile before each instance launch). > > see https://issues.apache.org/jira/browse/DTACLOUD-123 for more details. > > So I thought it would be... acceptable to compute max value in memory > range from totalMemory. I understand the argument that then this value > is incorrect too because if other instances are running, total memory > will not be available too. > > Other option is to extend DC API to return additional totalMemory but > this means more changes on conductor side (difficult for 1.0 release).
I think the current computation in the driver is wrong, and neither effectiveMem nor totalMem fit the bill, since they aggregate over all hosts in a cluster. Logically, the largest VM we can accomodate is the max available memory on any host; effectiveMem and totalMem seem to indicate sums of memory. Ultimately, the available HWP profiles for vSphere should be something the administrator can configure; they know their installation best, and know how they'd like to slice things up. The simplest way to achieve that would be to have the admin put a YAML file with HWP's somewhere, and have the driver read that file. Since we already store DC data in vSphere's dataStore, we might want to put the YAML file there, too, in a well-known location. (We could even allow writing and deleting HWP for vSphere through the API) That still leaves us with needing to define some sort of reasonable default. We could do something very simple: hardcode a HWP with 0..2GB of memory and 1..2 cpu's. David
