Labels

Sunday, June 19, 2011

DRS & Resource Pool

Distributed resource scheduling: This is only for load balancing- when all the resources of the host is used then it migrates some VM to another Host in the cluster
- it verifies the slot size availability
- blocks the slot size before it moves
- uses vmotion technique to move VM
What DRS do
  • When you power on a VM – o/p is recommended host list (prioritized list)
  • Mgnt of all cluster resources
  • Scheduling levels
              - local ( within host)
              - Global – within cluster
  • Every 5 minutes DRS will calculate the sum of the resource entitlements of all virtual machines on a single host and divides that number by the capacity of the host:
 
sum(expected VM loads) / (capacity of host)
 
There are three major elements here:
  1. Migration Threshold
  2. Target host load standard deviation
  3. Current host load standard deviation
Keep in mind that when you change the “Migration Threshold” the value of the “Target host load standard deviation” will also change 
If the environment is imbalanced and the Current host load standard deviation exceeds the value of the “Target host load standard deviation” DRS will either recommend migrations or perform migrations depending on the chosen setting.
how does DRS decide which VM or set of VMs it will VMotion…
The following procedure is used to form a set of recommendations to correct the imbalanced cluster:
While (load imbalance metric > threshold) {
move = GetBestMove();
  If no good migration is found:
    stop;
  Else:
    Add move to the list of recommendations;
    Update cluster to the state after the move is added;
}
Means:
While the cluster is imbalanced (Current host load standard deviation > Target host load standard deviation) select a VM to migrate based on specific criteria and simulate a move and recompute the “Current host load standard deviation” and add to the migration recommendation list. If the cluster is still imbalanced(Current host load standard deviation > Target host load standard deviation) repeat procedure.

how does DRS select the best VM to move?
DRS uses the following procedure:
GetBestMove() {
  For each VM v:
    For each host h that is not Source Host:
      If h is lightly loaded compared to Source Host:
      If Cost Benefit and Risk Analysis accepted
      simulate move v to h
      measure new cluster-wide load imbalance metric as g
  Return move v that gives least cluster-wide imbalance g.
}
Means:
For each VM check if a VMotion to each of the hosts which are less utilized than source host would result in a less imbalanced cluster and meets the Cost Benefit and Risk Analysis criteria. Compare the outcome of all tried combinations(VM<->Host) and return the VMotion that results in the least cluster imbalance.
This should result in a migration which gives the most improvement in terms of cluster balance, This is the reason why usually the larger VMs are moved as they will most likely decrease “Current host load standard deviation” the most. If it’s not enough to balance the cluster within the given threshold the “GetBestMove” gets executed again by the procedure which is used to form a set of recommendations.

 what does “Cost Benefit” and “Risk Analysis” consist of and why are we doing this?
First of all we want to avoid a constant stream of VMotions and this will be done by weighing costs vs benefits vs risks. These consists of:
  • Cost benefit
    Cost: CPU reserved during migration on t he target host
    Cost: Memory consumed by shadow VM during VMotion on the target host
    Cost: VM “downtime” during the VMotion
    Benefit: More resources available on source host due to migration
    Benefit: More resources for migrated VM as it moves to a less utilized host
    Benefit: Cluster Balance
  • Risk Analysis
    Stable vs unstable workload of the VM (historic info used)
Based on these consideration a cost-benefit-risk metric will be calculated and if this has an acceptable value the VM will be consider for migration.
Every migration recommendation will get a priority rating. This priority rating is based on the Current host load standard deviation

For each Migration
recommendation, the priority level is limited to the integral range
priority 2 to priority 5 (inclusive) and is calculated according to the
following formula:


ceil(LoadImbalanceMetric / 0.1 * sqrt(NumberOfHostsInCluster)).
Eg:  ceil(0.022 / 0.1 * sqrt(5)) 
 
Here, ceil (x) is the smallest integral value not less than x.
LoadImbalanceMetric is the current host load standard 

VM Placement
The placement of a VM when being powered on is as you know part of DRS. DRS analyzes the cluster based on the algorithm described in “Load Balancing”. The question of course is for the VM which is being powered on what kind of values does DRS work with? Here’s the catch, DRS assumes that 100% of the provisioned resources for this VM will be used. DRS does not take limits or reservations into account. Just like HA, DRS has got “admission control” If DRS can’t guarantee the full 100% of the resources provisioned for this VM , it will VMotion VMs away so that it can power on this single VM. If however there are not enough resources available it will not power on this VM

DRS module 

  • invoked by VC server
  • each instance manages cluster of hosts
  • invoked –
               - regularly (default 5 min
               - upon event (host addition /; removal)
               - o/p is recommended action
  • Initial placement 
  • Starting the vm in DRS
Procedure 
Automation level
  • (manual /partial / fully)
  • migration thresold [conservative------aggressive]
Power management
[Off / manual / automatic] 
DPM threshold [conservative -----aggressive] 
EVC
Swap file location
Choose the cluster >> DRS <tab> >>Recommendations >> Edit >> wizard opens
1. automation level
2. Affinity Rules
3. virtual machine options [ vm and it’s drs level ]
4. power management
     4.1 host options [host – and pwr mgnt]
5. EVC - migration based on the hardware compatability ( Eg: if one Vm is in Intel host wanna migrates to  other host. The target host must also in Intel. If not migration won't happen).
6. swap



Resource pool
  • limit
  • reservation
  • assigning to the group
Shares:
Shares are typically specified as high, normal, or low, using a 4:2:1 ratio. When you assign shares to a virtual machine, you always specify the relative priority for that virtual machine.
Reservation
Default =0
it guarantees the reserves amount to theVM
Limit 
The upper limit for CPU or memory for a virtual machine. That is, more resources can be allocated to a virtual machine than the reservation amount,

No comments:

Post a Comment