The Math Behind the DRS Stars

by bunchc on June 1, 2010

@vRobM and I were discussing an unrelated topic when DRS and the mysterious stars came up.  (**)?  Our first instinct was this was the “special sauce” between the two all beef patties.  However after some creative KB searching we came across a formula that describes it quite well:

DRS Recommendations

To understand the stars, you need to understand where to find them and what they mean. The following is taken from the VI3 docs:

Priority for this recommendation, as a number of stars.  Five stars, the maximum, indicate a mandatory move because of a host entering maintenance mode or affinity rule violations. Other ratings denote how much the recommendation would improve the cluster’s performance; from four stars (significant improvement) to one star (slight).

So that explains what the stars indicate as far as recommendations go.  But what makes a 3 star and what makes a 4 star recommendation?

Calculating the Priority

Turns out that this isn’t exactly the special sauce we thought it was. Rather, there is some carefully reasoned out math that goes into this.  This KB article spells it out in detail, but we’ll hit the high points.  First the formula:

6 – ceil(LoadImbalanceMetric / 0.1 * sqrt(NumberOfHostsInCluster)).

There are two variables in there and only one of which is obvious, “LoadImbalanceMetric” however can be interesting:

LoadImbalanceMetric is the current host load standard deviation shown on the cluster’s Summary page of the vSphere Client.
For each host, compute the load on the host as sum(expected VM loads)) / (capacity of host). Then compute the standard deviation of the host load metric across all hosts to determine LoadImbalanceMetric.

So where does one find this standard deviation? Select your cluster, then summary and look for the following section:

image

In our particular case, not much to look at, as well, she is seemingly a well balanced cluster. However let’s work through the formula with the assumption that we have a 2 node cluster and a standard deviation of 0.282 (the “target” from above):

6 – ceil(0.282 / 0.1 * sqrt(2)).

What is Ceilias brother Ceil doing with my numbers?

Turns out, it is not a family of mathematicians busily flicking their abacus’.  ‘Ceil’ here, represents the Ceiling function, which I’m sure you’ve heard of before.

According to Wikipedia the Ceiling function is:

In mathematics and computer science, the floor and ceiling functions map a real number to the largest previous or the smallest following integer, respectively. More precisely, floor(x) = ⌊x⌋ is the largest integer not greater than x and ceiling(x) = ⌈x⌉ is the smallest integer not less than x.

So that works out as:
image

or:

6 – the smallest number not less than (0.282 / .1 * sqrt(2)) which equals 2, hence, a 2 star recommendation. (**)!

More info: Duncan Epping @ Yellow-Bricks has put together an excellent Deep-dive page for DRS, where you can get into much greater detail.

WolframAlpha to the Rescue

While this can easily be done in any random calculator (or in the heads of some folk) I used WolframAlpha to good avail.  It’s quick and gives you a graphical breakdown of the formula. Just plug in new values and go!

Summary

The recommendations and mathematical bits take place behind the scenes seamlessly.  After all, that is the magic of DRS.  However, it helps to have an understanding of the actual logic and math that goes into those recommendations so you can better understand your cluster, and better plan for new hosts and workloads.  As always drop a line in the comments or tweet to either @vRobM or myself on Twitter.

Update: Thanks for the excellent deep-dive page Duncan!

{ 3 trackbacks }

Tweets that mention The Math Behind the DRS Stars -- Topsy.com
June 1, 2010 at 9:53 am
All things virtual XI « TheSaffaGeek
June 4, 2010 at 5:19 am
Technology Short Takes #1 - blog.scottlowe.org - The weblog of an IT pro specializing in virtualization, storage, and servers
August 18, 2010 at 12:37 am

{ 4 comments }

Duncan Epping June 1, 2010 at 2:30 pm

Wrote a couple of words around that bit as well in my deepdive.
http://www.yellow-bricks.com/drs-deepdive/

professionalvmware June 5, 2010 at 12:26 am

Excellent page. Not sure how I missed it the first time around. I've updated
my post to include a link. Thanks!

Ramesh. Geddam June 7, 2010 at 1:09 pm

Perfect punch!

moncler outlet store June 9, 2010 at 1:50 am

Hhe article’s content rich variety which make us move for our mood after reading this article. surprise, here http://music-ofthesun.com/ ” >wslmart.net you will find what you want! Recently, I found some wedsites which commodity is colorful of fashion. Such as xxxxxxxx that worth you to see. Believe me these websites won’t let you down.

Comments on this entry are closed.

blog comments powered by Disqus

Previous post:

Next post: