DRS-Distributed Resource Scheduler is used to load balance our Vmware cluster/s.
To enable DRS, just go to the settings of the cluster and we can enable vSphere DRS.
There are three modes in DRS
Manual- In this case vCenter server will not trigger any vm migration, but it will give the vm load balancing recommendation.
Partially Automated-During the power on of virtual machines, vms will be placed onto hosts & it will give the recommendation as manual mode.
Fully automated-With full automation mode vCenter will automatically load balance the cluster. We can set the aggressive level.
Affinity & Anti-affinity rules
With below example we have two application servers which are running same soffware.
We need to prevent running these two vms in same host. Then anti-affiniy rull will help us.
We have created two anti-affiny rules.
When both vms are powered off, we can move it a same host. But when we are power on one vm , one vm will automatically move to the different host in the cluster.
If we have only two nodes cluster , and we want to do some maintenance work on one node. Yes in this case we can move both virtual machine to one host.
VM to Host rule
Using VM/host groups, we can create vm or host groups.
With below example, we are creating vm group called App-vm and we have added appvm01 to this group.
Same way we can crete esx host group
Here we have created one host group and added only one host(esx05). My requirement is to run appvm01 only in the esx05.
Now we can create “Virtual Machine to Hosts” rule as below mentioned.
Rule name-“Run appvm on esx05”
We have to enable this rule
There are four options.
- Must run on hosts in group-Mentioned virtual machine must run on this host group.
- Should run on host in group-Mentioned virtual machine/s should run on this host group, but not required.
- Must not run on host group-Mentioend virtual machine must not run on this host group
- Should not run on host group-Mentioned virtual machine/s should not run on this host group, but not required
If we use must rule, we can’t even the vMotion. It will give the error massage saying we are violate virtual affinity rule
Even in the host failure scenario with must rule should not power on vm.
*with below example, we have created must rule(appvm01 must run on esx05).Now esx05 goes down, but appvm01 will not power on esx06
Same as host cluster we can configure datastores as cluster
Its very easy
Just right click on the datacenter from storage view > Select Storage > Select New Datastore cluster > Assign datastore cluster name
Datastore cluster we can select the DRS mode(Either “Fully Automated” or “No automation”(Manual Mode”)
Other than that there are few options.
Set the required thresholds
- If you’re only considering space, we can remove “Enable I/O metric for SDRS recommendations” options.
We can configure some advanced configuration.
“No recommendations until utilization difference between source & destination is”
We can explain this using example- We have two datastores(DatastoreA & Datastore B) and both are 100GB.
Usage of DatastoreA is 81GB(84%) and DatastoreB is 78GB(78%).According to our SDRS policy is should move some virtual machine from DatastoreA to DatastoreB, but we have set the above option to 5% and difference between our two datastores is 3%. Which means any virtual machines will not move vms from DatastoreA to DatastoreB.
From here we can select the host clusters for this datastore
Select the datastores for datastore cluster
Click on “Finish”
Same as host cluster, we can configure affinity rules in storage cluster/s.
With SDRS we can only configure anti-affinity rules as bellows.
*VMDK anti-affinity- once we configure this rule, mentioned VMDK files will keep in two different datastaores
*VM anti-affinity-once we configure this rule, given VM s will be store in two different datastores
Once we complete this & when we are trying to move two vms(antiaffinity rule configured) to single datastore, it will give this error.
Because of this reason we cannot put these datastores to the maintenance mode. To resolve this problem, we can add one advanced configuration to the SDRS settings.