Introducing
IntroducingWindowsServer2016_ebook
IntroducingWindowsServer2016_ebook
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Figure 2-4: Single management group containing multiple VM Groups<br />
Creating management groups is nearly identical to creating VM groups using the management tools<br />
previously outlined. The following Windows PowerShell script creates a new management group and<br />
adds both of the existing VM groups to it:<br />
#Create new Management Group<br />
New-VMGroup -Name TestVMGM1 -GroupType ManagementCollectionType<br />
#Setup Management Group variable<br />
$TestVMGM1 = Get-VMGroup -Name TestVMGM1<br />
#Add VM Groups to the Management Group<br />
Add-VMGroupMember -VMGroup $TestVMGM1 -VMGroupMember $TestVMG1<br />
Add-VMGroupMember -VMGroup $TestVMGM1 -VMGroupMember $TestVMG2<br />
An interesting difference between VM groups and management groups is that management groups<br />
can contain both VM groups and other management groups. Put simply, this means that you can nest<br />
management groups.<br />
The following Windows PowerShell script creates a new management group named Outside and adds<br />
our first management group, TestVMGM1, to its membership:<br />
#Create new Management Group<br />
New-VMGroup -Name OutsideGroup -GroupType ManagementCollectionType<br />
#Setup Management Group variable<br />
$OutsideGroup = Get-VMGroup -Name OutsideGroup<br />
#Add VM groups to the Management Group<br />
Add-VMGroupMember -VMGroup $OutsideGroup -VMGroupMember $TestVMGM1<br />
The management group (OutsideGroup) contains another management group (TestVMGM1), which<br />
contains the two VM groups (TestVMG1 and TestVMG2), which contain different groupings of three<br />
VMs (VM1, VM2, and VM3), as demonstrated in Figure 2-5.<br />
16 CHAPTER 2 | Software-defined datacenter