Retrieving protected virtual machines

You can use the Get-SrmProtectedVM function in the Meadowcroft.SRM module to retrieve the virtual machines protected by SRM. The syntax of the Get-SrmProtectedVM function is as follows:

Get-SrmProtectedVM [[-Name] <String>] [-State {Ready |
    FailedOver | PartiallyRecovered | Recovering | Recovered | 
    Testing | Shadowing}] [-PeerState {Ready | FailedOver | 
    PartiallyRecovered | Recovering | Recovered | Testing | 
    Shadowing}] [-ConfiguredOnly] [-UnconfiguredOnly] 
    [-ProtectionGroup <SrmProtectionGroup[]>] [-RecoveryPlan
    <SrmRecoveryPlan[]>] [-ProtectionGroupName <String>] 
    [-SrmServer <SrmServer>] [<CommonParameters>]

The Get-SrmProtectedVM function has no required parameters. You can use the parameters of the Get-SrmProtectedVM function to filter for specific virtual machines by name, state, configuration, protection group, recovery plan, or SRM server.

In the following example, we will retrieve all of the protected virtual machines using the Get-SrmProtectedVM function:

PowerCLI C:> Get-SrmProtectedVM

The output of the preceding command is as follows:

Vm                 : VMware.Vim.VirtualMachine
ProtectedVm        : protected-vm-3240
PeerProtectedVm    : protected-vm-3358
State              : Ready
PeerState          : Shadowing
NeedsConfiguration : True
Faults             : {VMware.Vim.LocalizedMethodFault}

The preceding output does not give you the names of the protected virtual machines. You can use the following command to retrieve these names:

PowerCLI C:> Get-SrmProtectedVM | Select-Object 
    -Property @{Name='VM';Expression={$_.VM.Name}}

The output of the preceding command is as follows:

VM
--
VM1
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.218.230