VMware PowerCLI

The Best User Interface for your VMware Datacenter!

PowerCLI to understand SRM placeholder VM information

Get VM PowerCLI command prints the information about the 2 VMs - production VM and SRM placeholder VM on the secondary site. Is there a way to show in this output that one of the VMs is the placeholder? Right now we can only determine this by seeing one of the VMs is powered off (the placeholder). But when we use automation, we want to be able PowerCLI to understand it is SRM placeholder VM and make it visible.

  • Guest
  • Apr 12 2022
  • Looking for Feedback
  • Attach files
  • Admin
    Kamen Nikolov commented
    5 May, 2022 01:43pm

    You can filter out placeholder VMs like this:
    Get-VM | where {$_.ExtensionData.config.managedby.type -ne "placeholderVm"}

    We could consider in the future to extract such a property at the top level, but in the meantime you can add it yourself using New-VIProperty like this:
    New-VIProperty -ObjectType VirtualMachine -Value { $args[0].ExtensionData.config.managedby.type -eq "placeholderVM" } -Name IsPlaceholderVM