VMware

VCP 6 – DCV Study Guide: Section 9 – Objective 9.2

Section 9: Configure and Administer vSphere Availability Solutions

Objective 9.2: Configure Advanced vSphere DRS Features. In this objective we should be covering these topics:
  • Identify Distributed Resource Scheduler (DRS) affinity rules
  • Enable/Disable Distributed Resource Scheduler (DRS) affinity rules
  • Identify Distributed Resource Scheduler (DRS) Automation levels
  • Configure Distributed Resource Scheduler (DRS) Automation levels

Create a DRS Cluster
When you add a host to a DRS cluster, the host’s resources become part of the cluster’s resources. In addition to this aggregation of resources, with a DRS cluster you can support cluster-wide resource pools and enforce cluster-level resource allocation policies.

The following cluster-level resource management capabilities are also available.

Load Balancing
The distribution and usage of CPU and memory resources for all hosts and virtual machines in the cluster are continuously monitored. DRS compares these metrics to an ideal resource utilization given the attributes of the cluster’s resource pools and virtual machines, the current demand, and the imbalance target. It then performs (or recommends) virtual machine migrations accordingly. See Virtual Machine Migration. When you first power on a virtual machine in the cluster, DRS attempts to maintain proper load balancing by either placing the virtual machine on an appropriate host or making a recommendation. See Admission Control and Initial Placement.
Power management
When the vSphere Distributed Power Management (DPM) feature is enabled, DRS compares cluster- and host-level capacity to the demands of the cluster’s virtual machines, including recent historical demand. It places (or recommends placing) hosts in standby power mode if sufficient excess capacity is found or powering on hosts if capacity is needed. Depending on the resulting host power state recommendations, virtual machines might need to be migrated to and from the hosts as well. See Managing Power Resources.
Affinity Rules
You can control the placement of virtual machines on hosts within a cluster, by assigning affinity rules. See Using DRS Affinity Rules.
Prerequisites
You can create a cluster without a special license, but you must have a license to enable a cluster for vSphere DRS (or vSphere HA).
Procedure
1. Right-click a data center in the vSphere Web Client and select New Cluster.
2. Name the cluster in the Name text box. This name appears in the vSphere Web Client navigator.
3. Select the DRS Turn ON check box.
4. Select a default automation level for DRS.

auto

5. Set the migration threshold for DRS.
6. (Optional) Select the vSphere HA Turn ON check box to enable vSphere HA.

vSphere HA allows you to:

■ Enable host monitoring.
■ Enable admission control.
■ Specify the type of policy that admission control should enforce.
■ Adjust the monitoring sensitivity of virtual machine monitoring.
7. If appropriate, enable Enhanced vMotion Compatibility (EVC) and select the mode it should operate in.
8. Click OK to complete cluster creation.
A new cluster does not include any hosts or virtual machines.

Set a Custom Automation Level for a Virtual Machine
After you create a DRS cluster, you can customize the automation level for individual virtual machines to override the cluster’s default automation level.

For example, you can select Manual for specific virtual machines in a cluster with full automation, or Partially Automated for specific virtual machines in a manual cluster.

If a virtual machine is set to Disabled, vCenter Server does not migrate that virtual machine or provide migration recommendations for it. This is known as pinning the virtual machine to its registered host.

Note
If you have not enabled Enhanced vMotion Compatibility (EVC) for the cluster, fault tolerant virtual machines are set to DRS disabled. They appear on this screen, but you cannot assign an automation mode to them.

Procedure
1. Browse to the cluster in the vSphere Web Client navigator.
2. Click the Manage tab and click Settings.
3. Under Services, select vSphere DRS and click Edit. Expand DRS Automation.
4. Select the Enable individual virtual machine automation levels check box.
5. To temporarily disable any individual virtual machine overrides, deselect the Enable individual virtual machine automation levels check box. Virtual machine settings are restored when the check box is selected again.
6. To temporarily suspend all vMotion activity in a cluster, put the cluster in manual mode and deselect the Enable individual virtual machine automation levels check box.
7. Select one or more virtual machines.
8. Click the Automation Level column and select an automation level from the drop-down menu.

levels

Note
Other VMware products or features, such as vSphere vApp and vSphere Fault Tolerance, might override the automation levels of virtual machines in a DRS cluster. Refer to the product-specific documentation for details.

Using DRS Affinity Rules
You can control the placement of virtual machines on hosts within a cluster by using affinity rules.

You can create two types of rules.

■  VM-Host Affinity Rules
A VM-Host affinity rule specifies whether or not the members of a selected virtual machine DRS group can run on the members of a specific host DRS group.

Unlike a VM-VM affinity rule, which specifies affinity (or anti-affinity) between individual virtual machines, a VM-Host affinity rule specifies an affinity relationship between a group of virtual machines and a group of hosts. There are ‘required’ rules (designated by “must”) and ‘preferential’ rules (designated by “should”.)

A VM-Host affinity rule includes the following components.

■ One virtual machine DRS group.
■ One host DRS group.
■ A designation of whether the rule is a requirement (“must”) or a preference (“should”) and whether it is affinity (“run on”) or anti-affinity (“not run on”).

Because VM-Host affinity rules are cluster-based, the virtual machines and hosts that are included in a rule must all reside in the same cluster. If a virtual machine is removed from the cluster, it loses its DRS group affiliation, even if it is later returned to the cluster.

Create a VM-Host Affinity Rule
You can create VM-Host affinity rules to specify whether or not the members of a selected virtual machine DRS group can run on the members of a specific host DRS group.

Prerequisites
Create the virtual machine and host DRS groups to which the VM-Host affinity rule applies.
Procedure
1. Browse to the cluster in the vSphere Web Client navigator.
2. Click the Manage tab.
3. Click Settings and click DRS Rules.
4. Click Add.
5. In the Create DRS Rule dialog box, type a name for the rule.
6. From the Type drop down menu, select Virtual Machines to Hosts.
7. Select the virtual machine DRS group and the host DRS group to which the rule applies.
8. Select a specification for the rule.

Must run on hosts in group. Virtual machines in VM Group 1 must run on hosts in Host Group A.
Should run on hosts in group. Virtual machines in VM Group 1 should, but are not required, to run on hosts in Host Group A.
Must not run on hosts in group. Virtual machines in VM Group 1 must never run on host in Host Group A.
Should not run on hosts in group. Virtual machines in VM Group 1 should not, but might, run on hosts in Host Group A.
9. Click OK.

Using VM-Host Affinity Rules
You use a VM-Host affinity rule to specify an affinity relationship between a group of virtual machines and a group of hosts. When using VM-Host affinity rules, you should be aware of when they could be most useful, how conflicts between rules are resolved, and the importance of caution when setting required affinity rules.

One use case where VM-Host affinity rules are helpful is when the software you are running in your virtual machines has licensing restrictions. You can place such virtual machines into a DRS group and then create a rule that requires them to run on a host DRS group that contains only host machines that have the required licenses.

Note
When you create a VM-Host affinity rule that is based on the licensing or hardware requirements of the software running in your virtual machines, you are responsible for ensuring that the groups are properly set up. The rule does not monitor the software running in the virtual machines nor does it know what non-VMware licenses are in place on which ESXi hosts.

If you create more than one VM-Host affinity rule, the rules are not ranked, but are applied equally. Be aware that this has implications for how the rules interact. For example, a virtual machine that belongs to two DRS groups, each of which belongs to a different required rule, can run only on hosts that belong to both of the host DRS groups represented in the rules.

When you create a VM-Host affinity rule, its ability to function in relation to other rules is not checked. So it is possible for you to create a rule that conflicts with the other rules you are using. When two VM-Host affinity rules conflict, the older one takes precedence and the newer rule is disabled. DRS only tries to satisfy enabled rules and disabled rules are ignored.

DRS, vSphere HA, and vSphere DPM never take any action that results in the violation of required affinity rules (those where the virtual machine DRS group ‘must run on’ or ‘must not run on’ the host DRS group). Accordingly, you should exercise caution when using this type of rule because of its potential to adversely affect the functioning of the cluster. If improperly used, required VM-Host affinity rules can fragment the cluster and inhibit the proper functioning of DRS, vSphere HA, and vSphere DPM.

A number of cluster functions are not performed if doing so would violate a required affinity rule.

■ DRS does not evacuate virtual machines to place a host in maintenance mode.
■ DRS does not place virtual machines for power-on or load balance virtual machines.
■ vSphere HA does not perform failovers.
■ vSphere DPM does not optimize power management by placing hosts into standby mode.

To avoid these situations, exercise caution when creating more than one required affinity rule or consider using VM-Host affinity rules that are preferential only (those where the virtual machine DRS group ‘should run on’ or ‘should not run on’ the host DRS group). Ensure that the number of hosts in the cluster with which each virtual machine is affined is large enough that losing a host does not result in a lack of hosts on which the virtual machine can run. Preferential rules can be violated to allow the proper functioning of DRS, vSphere HA, and vSphere DPM.

Note
You can create an event-based alarm that is triggered when a virtual machine violates a VM-Host affinity rule. In the vSphere Web Client, add a new alarm for the virtual machine and select VM is violating VM-Host Affinity Rule as the event trigger. For more information about creating and editing alarms, see the vSphere Monitoring and Performance documentation.

■ VM-VM Affinity Rules

A VM-VM affinity rule specifies whether selected individual virtual machines should run on the same host or be kept on separate hosts. This type of rule is used to create affinity or anti-affinity between individual virtual machines that you select.

When an affinity rule is created, DRS tries to keep the specified virtual machines together on the same host. You might want to do this, for example, for performance reasons.

With an anti-affinity rule, DRS tries to keep the specified virtual machines apart. You could use such a rule if you want to guarantee that certain virtual machines are always on different physical hosts. In that case, if a problem occurs with one host, not all virtual machines would be placed at risk.

When you add or edit an affinity rule, and the cluster’s current state is in violation of the rule, the system continues to operate and tries to correct the violation. For manual and partially automated DRS clusters, migration recommendations based on rule fulfillment and load balancing are presented for approval. You are not required to fulfill the rules, but the corresponding recommendations remain until the rules are fulfilled.

To check whether any enabled affinity rules are being violated and cannot be corrected by DRS, select the cluster’s DRS tab and click Faults. Any rule currently being violated has a corresponding fault on this page. Read the fault to determine why DRS is not able to satisfy the particular rule. Rules violations also produce a log event.

Note
VM-VM and VM-Host affinity rules are different from an individual host’s CPU affinity rules.

Create a VM-VM Affinity Rule
You can create VM-VM affinity rules to specify whether selected individual virtual machines should run on the same host or be kept on separate hosts.

Note
 If you use the vSphere HA Specify Failover Hosts admission control policy and designate multiple failover hosts, VM-VM affinity rules are not supported.

Procedure
1. Browse to the cluster in the vSphere Web Client navigator.
2. Click the Manage tab.
3. Click Settings and click DRS Rules.
4. Click Add.
5. In the Create DRS Rule dialog box, type a name for the rule.
6. From the Type drop-down menu, select either Keep Virtual Machines Together or Separate Virtual Machines.
7. Click Add.
8. Select at least two virtual machines to which the rule will apply and click OK.
9. Click OK.

VM-VM Affinity Rule Conflicts
You can create and use multiple VM-VM affinity rules, however, this might lead to situations where the rules conflict with one another.

If two VM-VM affinity rules are in conflict, you cannot enable both. For example, if one rule keeps two virtual machines together and another rule keeps the same two virtual machines apart, you cannot enable both rules. Select one of the rules to apply and disable or remove the conflicting rule.

When two VM-VM affinity rules conflict, the older one takes precedence and the newer rule is disabled. DRS only tries to satisfy enabled rules and disabled rules are ignored. DRS gives higher precedence to preventing violations of anti-affinity rules than violations of affinity rules.

Create a Host DRS Group
A VM-Host affinity rule establishes an affinity (or anti-affinity) relationship between a virtual machine DRS group with a host DRS group. You must create both of these groups before you can create a rule that links them.

Procedure
1. Browse to the cluster in the vSphere Web Client navigator.
2. Click the Manage tab.
3. Click Settings, and click DRS Groups.
4. In the DRS Groups section, click Add.
5. In the Create DRS Group dialog box, type a name for the group.
6. Select Host DRS Group from the Type drop down box and click Add.
7. Click the check box next to a host to add it. Continue this process until all desired hosts have been added.
8. Click OK.
What to do next
Using this host DRS group, you can create a VM-Host affinity rule that establishes an affinity (or anti-affinity) relationship with an appropriate virtual machine DRS group.

Create a Virtual Machine DRS Group
Affinity rules establish an affinity (or anti-affinity) relationship between DRS groups. You must create DRS groups before you can create a rule that links them.

Procedure
1. Browse to the cluster in the vSphere Web Client navigator.
2. Click the Manage tab.
3. Click Settings, and click DRS Groups.
4. In the DRS Groups section, click Add.
5. In the Create DRS Group dialog box, type a name for the group.
6. Select VM DRS Group from the Type drop down box and click Add.
7. Click the check box next to a virtual machine to add it. Continue this process until all desired virtual machines have been added.
8. Click OK.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s