PowerCLI

 View Only
  • 1.  Remove-VMHost very slow on a Cluster versus other Clusters

    Posted Oct 25, 2024 05:29 AM

    Hello all,

    I'm facing a small problem regading Hosts removal from Clusters.

    On a particular Cluster, removing an Host will take 20 minutes, instead of 2-3 minutes on others Clusters.

    This Cluster have significantly  more VM than others Clusters, could it be the reason ?

    Cordiallly



  • 2.  RE: Remove-VMHost very slow on a Cluster versus other Clusters

    Posted Oct 25, 2024 05:41 AM

    Does the removal of an ESXi node from the cluster trigger a lot of vMotions?
    Are there any DRS rules defined that might trigger vMotions?



    ------------------------------


    Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference


    ------------------------------



  • 3.  RE: Remove-VMHost very slow on a Cluster versus other Clusters

    Posted Oct 25, 2024 09:30 AM

    Hello Luc,

    In fact there are few DRS rules in this Cluster.

    As It's dev environment, I'll try to disabling DRS Rules at first to see any change.

    Then I'll come back if still slow.

    By the way just saw a colleague doing it like below and it seems faster than my method and don't have the problem on the specific Cluster  :

    $FailedESX = $Cluster | Get-VMHost | ?{ $_.ConnectionState -eq 'NotResponding' } | Sort-Object Name

    ForEach ($ESX in $FailedESX) {  $ESX| Remove-VMHost -Confirm:$False }

    My Method :

    $FailedESX = $Cluster | Get-VMHost | ?{ $_.ConnectionState -eq 'NotResponding' } | Sort-Object Name

    ForEach ( $ESX in $FailedESX) {

    Try { Remove-VMHost -VMHost $ESX -Confirm:$False -EA Stop }

    Catch [VMware.VimAutomation.ViCore.Types.V1.ErrorHandling.ManagedObjectNotFound] { Write in log File }

    Catch [ System.Management.Automation.RuntimeException ] {Write in log File }

    }




  • 4.  RE: Remove-VMHost very slow on a Cluster versus other Clusters

    Posted Oct 25, 2024 11:26 AM

    I don't think that the Try-Catch construct explains the huge difference in execution time.


    Btw, that Sort-Object is not really necessary, it doesn't matter if the ESXi nodes are removed in alphabetical order.



    ------------------------------


    Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference


    ------------------------------



  • 5.  RE: Remove-VMHost very slow on a Cluster versus other Clusters

    Posted Oct 31, 2024 06:52 AM

    Hello Luc,

    I have tested by disabling all DRS Rules, no change, even by disabling HA & DRS on Cluster, no change. 

    Any idea ?




  • 6.  RE: Remove-VMHost very slow on a Cluster versus other Clusters

    Posted Oct 31, 2024 07:19 AM

    Not really.
    I would have a look at the vpxd logs to check if there any clues in there.



    ------------------------------


    Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference


    ------------------------------



  • 7.  RE: Remove-VMHost very slow on a Cluster versus other Clusters

    Posted Nov 12, 2024 07:52 AM

    Hello Luc,

    after some testing, it seems it's the step of VM removal that take a considerable amount of time.

    As it is uncompressible, for our need we'll go in another way.

    Thank you anyway