PowerCLI

 View Only
  • 1.  Get SRM Placeholder Virtual Machines with PowerCLI

    Posted Dec 29, 2010 10:24 AM

    Hi all,

    We are currently implementing VMware Site Recovery Manger 4.1 (SRM).

    With the creation of SRM Protection Groups, placeholder VMs are created at the recovery site vCenter.

    These VMs cannot be powered on, but show up as normal, Powered Off, VMs in the inventory.

    Is there any way to get all placeholder VMs through PowerCLI?

    As normal reports on Virtual Machines would report these VMs double (one at each site vCenter server), we would like to exclude the placeholder vms.

    Anyone?

    Thanks and kind regards,

    Harold



  • 2.  RE: Get SRM Placeholder Virtual Machines with PowerCLI

    Posted Dec 29, 2010 10:33 AM

    Hi hharold

    I have the same problem in my SRM Activ-Activ concept. I solved this with a Workarround....

    Each Site have a Datastore which is used for the Placeholder-VM's. Site A: Placeholder_Disk_RZ / Site B: Placeholder_Disk_Delta.

    Now when i execute a get-vm statement i excluede all VMguests where resides on the Placeholder Disk...

    Like this:

    Get-VM | sort | where { $_.Harddisks -ne "Placeholder"}

    If you like to get all VMguets from both vCenter:

    $VC = "vCenterA"
    Connect-VIServer $VC
    Get-VM | sort | where  { $_.Harddisks -ne "Placeholder"}

    Disconnect-VIServer -confirm:$false

    $VC = "vCenterB"
    Connect-VIServer $VC
    Get-VM | sort | where  { $_.Harddisks -ne "Placeholder"}

    Disconnect-VIServer -confirm:$false

    I know it's not realy fast... but it works for me.

    Let me know if you find a better way.

    Greetings

    Hoschi



  • 3.  RE: Get SRM Placeholder Virtual Machines with PowerCLI

    Posted Dec 29, 2010 10:52 AM

    Hello Hoschi,

    That would be a good workaround indeed!

    Hopefully someone can point us to the attribute that declares a vm to be a placeholder.

    This to speed things up.

    Thanks for your help.



  • 4.  RE: Get SRM Placeholder Virtual Machines with PowerCLI

    Posted Feb 14, 2012 02:15 PM

    Did you ever get your answer?

    Does anyone know the attribute that would show that the VM is a placeholder?



  • 5.  RE: Get SRM Placeholder Virtual Machines with PowerCLI

    Posted Feb 15, 2012 12:56 AM

    Unless something has changed recently there is no attribute.

    It would be great to have one.  It does cause issues with PowerCLI, Orchestrator and other management software.

    You could log a call with VMware to confirm there is no attribute and if so get a feature request in.



  • 6.  RE: Get SRM Placeholder Virtual Machines with PowerCLI

    Posted May 20, 2015 03:13 PM

    This link goes over how to do it. I used it and it works well. thanks RvdNieuwendijk

    Get-VM | Where-Object {$_.ExtensionData.Config.ManagedBy.ExtensionKey -ne 'com.vmware.vcDr'}

    PowerCLI - How to distinguish real vm from SRM placeholder