Automation

 View Only
  • 1.  Recompose Horizon Desktop Pools via PowerCLI

    Posted Mar 10, 2017 03:58 PM

    I have been trying to find a way to recompose our VDI Pools via PowerCli and find only references to old deprecated PowerCli commands.

    Does anyone know how to kick off a recompose with the current version of PowerCli?



  • 2.  RE: Recompose Horizon Desktop Pools via PowerCLI
    Best Answer

    Posted Mar 10, 2017 07:33 PM

    You can use the Connect-HVServer cmdlet. See also Automating VMware Horizon 7 with VMware PowerCLI 6.5

    Once connected call the Desktop_Recompose method.

    There are several examples on the usage of the API in the HV.Helper module



  • 3.  RE: Recompose Horizon Desktop Pools via PowerCLI

    Posted Mar 14, 2017 12:59 PM

    Thanks for pointing me in the right direction.



  • 4.  RE: Recompose Horizon Desktop Pools via PowerCLI

    Posted Sep 14, 2022 08:42 AM

    What about recomposing a single vm?
    Here is my idea, I have a script running every 30 minutes, checking all pools for vms in error state (any known and unknown error state) and notify me by email.

    The script also send a restart command to that vm through vcenter which might fix the issue (in case of agent unreachable, just restarting the vm usually helps).

    What I manually do in case I found a vm in error state? Recompose to the (same) last snapshot! Works for 95% of the cases!
    So this want I want to do with the powercli: recompose that one vm using the same, last snapshot!

    Anyone can help with that?



  • 5.  RE: Recompose Horizon Desktop Pools via PowerCLI

    Posted Oct 30, 2017 08:21 PM

    In the HV.Helper module on GitHub, you will find many useful cmdlets not found in the built-in module for Horizon.  One of these is Start-HVPool -Recompose.  Check it out, and I can explain more if you need it.  Here is my example:

    Start-HVPool -Pool $pool -Recompose -StartTime "10-30-17 4:00PM" -LogoffSetting WAIT_FOR_LOGOFF -StopOnFirstError $true -ParentVM "vdi-parent" -SnapshotVM "10-30-17"



  • 6.  RE: Recompose Horizon Desktop Pools via PowerCLI

    Posted Mar 20, 2018 10:22 AM

    Hi - slightly off topic - can anyone tell me where to find the Last Recompose Date of a VM from the Get-HVPOOL ? 

    Can't seem find it.  Thanks.



  • 7.  RE: Recompose Horizon Desktop Pools via PowerCLI

    Posted Apr 23, 2018 11:55 AM

    Is it normal that using Connect-HVServer takes a long time to connect.  For me it takes at least 2 minutes.



  • 8.  RE: Recompose Horizon Desktop Pools via PowerCLI

    Posted Apr 23, 2018 12:06 PM

    No, not really.

    Perhaps a network trace (WireShark ?) can shed some light where the delay is happening?