Hi Edison,

after some further investigation, i found it is non-trivial to put this logic 
in findSuitablePoolsForVolumes.

method findSuitablePoolsForVolumes is essentially used for listing all storage 
pools for one individual volume.(it even gets a parameter 'returnUpTo'). if it 
has to deal with more then one volumes, the computation there will be 
exponential, it is basically a tree recursive search for all possible volume 
allocation on storagepools, think about following example.

volA 20G , volB 30G  
SP1 40G, sp2 60G 

there are three possible allocation:
volA->SP1 volB->SP2
volA->SP2 volB->SP2
volA->SP2 volB->SP1

this seems not very efficient and the return signature may need a change.

back to this multiple volumes capacity check issue, i would like to suggest 
following two approaches:
1) put special check logic in findSuitablePoolsForVolumes, but, instead of 
recursive exploring, return immediately when the first possible allocation is 
found.
2) or keep it in findPotentialDeploymentResources, while 
findSuitablePoolsForVolumes is responsbile for providing pools for single 
volume, findPotentialDeploymentResources will check them as a whole and it will 
return immediately after find a proper allocation.

please adivce, thanks

Regards
Mice



Reply via email to