Quantcast
Viewing all articles
Browse latest Browse all 3691

SRM Reporting using PowerCLI

So, I'm back to this old Chesnutt of trying to get accurate SRM Reports using PowerCLI.

 

I've the following setup

  • Protection Group Name = MyTestPG
  • Protection Group Protection Status in Web Client = Not Configured(this is deliberate for testing, I've attached a .iso)
  • Recovery Plan Name = MyTestRP
  • Recovery Plan Recovery Status in Web Client = Ready

 

Using PowerCLI, I have the following

Connect-VIServer -Server $vcenter -Credential $cred | Out-Null
Connect-SrmServer -Credential $cred -RemoteCredential $cred -OutVariable srm

 

$srmApi = $srm.ExtensionData
$protectionGroups = $srmApi.Protection.ListProtectionGroups()

$testPgName = MyTestPG

 

# To Test 1 PG
$test = $protectionGroups | where {$_.getinfo().name -like $testPgName} | Get-Unique

 

foreach ($item in $test) {
      $item = $_
      $protectionGroupName = $item.GetInfo().name
     $protectionGroupState = $item.GetProtectionState()
      $recoveryPlanName = $item.ListRecoveryPlans().GetInfo().Name
      $recoveryPlanState = $item.ListRecoveryPlans().GetInfo().state
}

 

My issue is that at this point, $ProtectionGroupStatereturns a value of Ready.

This is not what's seen in the Web Client. Why does the Web Client show Not Configured but, the PowerCLI output shows Ready ?

 

Before continuing with the script,, including VM Names, VM Status, outputting results to either .csv / .html. I'd like to correct this issue first.


Viewing all articles
Browse latest Browse all 3691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>