Reader small image

You're reading from  Mastering PowerCLI

Product typeBook
Published inOct 2015
Reading LevelIntermediate
PublisherPackt
ISBN-139781785286858
Edition1st Edition
Languages
Right arrow
Author (1)
Sajal Debnath
Sajal Debnath
author image
Sajal Debnath

Sajal Debnath is a highly certified Cloud computing technocrat with more than 12 years of experience in virtualized data center design, Cloud computing, and BC/DR solutions. He is an EMCISA, VCAP-DCD/DCA, VCAP-CID/CIA, RHCE 4/5/6, RHCVA, Openstack, and ITIL certified person. He is presently associated with VMware Software India Pvt. Ltd. as a senior system engineer. Previously, he worked with France Telecom, Hewlett Packard, and many more in multiple roles. He is involved in prestigious Indian government projects, such as National Cloud, Digital Locker, and so on.
Read more about Sajal Debnath

Right arrow

Using the DRS affinity and anti-affinity rules


In this section, we will discuss the advanced settings of a cluster. We can use the following cmdlets for this section:

  • Get-DrsRule

  • New-DrsRule

  • Remove-DrsRule

  • Set-DrsRule

First, we will create a new anti-affinity rule with the two Test1 and Test2 VMs that we created for this purpose. We want to always keep them separate in such a way that they will not run on a single host at any point of time. For this, we will use the New-DrsRule cmdlet to create a rule. We will use the following command for this:

PS C:\> New-DrsRule –Cluster 'Lab Cluster' –Name `  antiAffinityTest1 -KeepTogether $false –VM Test1, Test2

The result of the preceding command is shown in the following screenshot:

Note the warning about the Cluster parameter. This warning is displayed to show you that this parameter is obsolete and should be avoided. We can check the details of the rule using the Get-DrsRule cmdlet.

We can change a rule using the Set-DrsRule cmdlet. In the...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Mastering PowerCLI
Published in: Oct 2015Publisher: PacktISBN-13: 9781785286858

Author (1)

author image
Sajal Debnath

Sajal Debnath is a highly certified Cloud computing technocrat with more than 12 years of experience in virtualized data center design, Cloud computing, and BC/DR solutions. He is an EMCISA, VCAP-DCD/DCA, VCAP-CID/CIA, RHCE 4/5/6, RHCVA, Openstack, and ITIL certified person. He is presently associated with VMware Software India Pvt. Ltd. as a senior system engineer. Previously, he worked with France Telecom, Hewlett Packard, and many more in multiple roles. He is involved in prestigious Indian government projects, such as National Cloud, Digital Locker, and so on.
Read more about Sajal Debnath