Mastering Windows Server 2016 Hyper-V

(Romina) #1

The virtualmachinemanager module has 672 cmdlets with SCVMM 2016! This is
where using the same commands to view all of the nouns available in the module is
useful. There is, however, an even better way to learn how to use the SCVMM
PowerShell cmdlets. Every action performed using the SCVMM graphical interface
translates to PowerShell. As each action is performed using SCVMM, there is an
option to view the PowerShell, as shown in Figure 5.19, by clicking the View Script
button. You can use the PowerShell that is displayed in your own scripts.


Figure 5.19 Viewing the PowerShell used by SCVMM


VM Groups


Using PowerShell, it is easy to perform actions on multiple VMs simultaneously by
either specifying multiple VM names or sending multiple VM names through the
PowerShell pipeline to another command. For example, Get-VM VM1, VM2 | Start-VM
would send the VM objects for VM1 and VM2 to the Start-VM cmdlet. It would also be
possible to parse a file or other input for VM names and send those objects along the
pipeline. In some instances, however, the Hyper-V fabric needs to understand when
certain VMs are grouped together for a common purpose or that share a common
resource.


Windows Server 2016 introduces VM Groups, which enable exactly this type of
grouping. In Windows Server 2016, VM Groups are required when using VHD Sets
and performing a host-level backup of the VHD Set or replicating with Hyper-V
Replica. All guest cluster member VMs are placed in a VM Group, which enables the
Hyper-V environment to perform actions across all guest cluster VMs in an
orchestrated manner to ensure the integrity of actions performed on VHD Sets.


There are two types of group:


VM  Collection  Group   A   collection  of  VMs
Free download pdf