Protecting virtual machines
The Protect-SrmVm
function of the Meadowcroft.SRM
module will protect a virtual machine and put the virtual machine in an SRM protection group. The syntax of the Protect-SrmVm
function is as follows:
Protect-SrmVM [-ProtectionGroup] <SrmProtectionGroup>
[[-Vm] <VirtualMachineImpl>] [[-VmView] <VirtualMachine>]
[<CommonParameters>]
The -ProtectionGroup
parameter is required.
In the following example, we will add virtual machine VM1
to the protection group Protected VMs Protection Group
. First, we will retrieve the Protected VMs Protection Group
and save it in the variable $SrmProtectionGroup
:
PowerCLI C:\> $SrmProtectionGroup = Get-SrmProtectionGroup
-Name 'Protected VMs Protection Group'
Next, we will retrieve the view of virtual machine VM1
and save it in variable $VMView
:
PowerCLI C:\> $VMView = (Get-VM -Name VM1).ExtensionData
Finally, VM1
is added to the Protected VMs Protection Group
with the following...