[Pacemaker] A question and demand to a resource placement strategy function
Gao,Yan
ygao at novell.com
Tue Aug 23 10:19:25 CET 2011
On 08/22/11 22:09, Vladislav Bogdanov wrote:
> Hi Yan,
>
> 27.04.2011 08:14, Yan Gao wrote:
> [snip]
>>> Do priorities work for "utilization" strategy?
>> Yes, the improvement works for "utilization", "minimal" and "balanced"
>> strategy:
>>
>> - The nodes that are more healthy and have more capacities get consumed
>> first (globally preferred nodes).
>
> Does this still valid for current tip?
Yes.
> I tried to use utilization to place resources (virtual machines) to
> nodes based on four parameters, cpu usage, ram usage and storage I/O
> usage (for two storages). While I see almost perfect balancing on first
> two parameters, other two (storage I/O) are not considered at all for
> resource placement.
> Here are excerpts from ptest -LUs output:
>
> Original: v03-a capacity: vds-ok-pool-0-usage=99999999
> vds-ok-pool-1-usage=99999999 cpu-decipct=11000 ram-hugepages-mb=44360
> Original: v03-b capacity: vds-ok-pool-0-usage=99999999
> vds-ok-pool-1-usage=99999999 cpu-decipct=11000 ram-hugepages-mb=44360
> ...
> native_color: vptest1.vds-ok.com-vm allocation score on v03-a: 0
> native_color: vptest1.vds-ok.com-vm allocation score on v03-b: 0
> calculate_utilization: vptest1.vds-ok.com-vm utilization on v03-b:
> vds-ok-pool-1-usage=100 cpu-decipct=330 ram-hugepages-mb=1024
> native_color: vptest2.vds-ok.com-vm allocation score on v03-a: 0
> native_color: vptest2.vds-ok.com-vm allocation score on v03-b: 0
> calculate_utilization: vptest2.vds-ok.com-vm utilization on v03-a:
> vds-ok-pool-0-usage=100 cpu-decipct=330 ram-hugepages-mb=1024
> ...
> Remaining: v03-a capacity: vds-ok-pool-0-usage=99996799
> vds-ok-pool-1-usage=99999999 cpu-decipct=110 ram-hugepages-mb=10568
> Remaining: v03-b capacity: vds-ok-pool-0-usage=99999899
> vds-ok-pool-1-usage=99996899 cpu-decipct=980 ram-hugepages-mb=10568
>
> After that virtual machines placed such way so one node uses only first
> storage, other uses almost only second one.
>
> Am I missing something?
When allocating every resource, we compare the capacity of the nodes.
The node has more remaining capacity is preferred. This would be quite
clear if we only define one kind of "capacity". While if we define
multiple kinds of "capacity", for example:
If nodeA has more cpus remaining, while nodeB has more ram and storage
remaining -- nodeB has more capacity.
If nodeA has more cpus and storage1 remaining, nodeB has more ram and
storage2 remaining -- They have the equal capacity. Then the first
listed node is preferred.
>
> Also could you please describe algorithm used for placement in little
> bit more details, so I would ask less stupid questions. Does it have
> something related to linear programming (f.e.
> http://en.wikipedia.org/wiki/Simplex_method)?
An optimal solution definitely requires some mathematical optimization
method. Though we don't use one so far. It's somewhat complicated to be
introduced and combined with the current allocation factors.
The policy for choosing a preferred node is just like above.
The order for choosing resources to allocate is:
1. The resource with higher priority gets allocated first.
2. If their priorities are equal, check if they are already running. The
resource has higher score on the node where it's running gets allocated
first. (-- which was recently improved by the work of Andrew and Yuusuke
to prevent resource shuffling.)
3. The resource has higher score on the preferred node gets allocated first.
Regards,
Gaoyan
--
Gao,Yan <ygao at suse.com>
Software Engineer
China Server Team, SUSE.
More information about the Pacemaker
mailing list