Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 232631

Set-HVPool to disable a dynamic linked clone pool doesn't work

$
0
0

Hi,

 

we are using Horizon 7.3.2 and PowerCLI 10.0.0.0 (before 6.5.4 but with same results).

 

I just want to disable several pools and don't want to go through the admin console, because this will take a lot of time.

 

So I used the command "Set-HVPool -PoolName "1531-28" -Disable", but I got the following error:

 

Exception calling "Desktop_Update" with "3" argument(s): "ExceptionType : VMware.Hv.InvalidArgument

ErrorMessage : Invalid value for member

ParameterName : automatedDesktopData.vmNamingSettings.patternNamingSettings.namingPattern"

At C:\Program Files\WindowsPowerShell\Modules\VMware.Hv.helper\VMware.HV.Helper.psm1:6171 char:8

+        $desktop_helper.Desktop_Update($services,$item,$updates)

+        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : VimException

 

Maybe the hv.helper has an issue, so I tried the same with the direct API approach, with the more or less same result:

 

Script (without the Connect-HV and other basic stuff):

 

function Get-MapEntry {

  param(

    [Parameter(Mandatory = $true)]

    $Key,

    [Parameter(Mandatory = $true)]

    $Value

  )

  $update = New-Object VMware.Hv.MapEntry

  $update.key = $key

  $update.value = $value

  return $update

}

 

$Pools = Get-HVQueryResult -EntityType DesktopSummaryView

 

foreach($desktop in $Pools)

{

    if($desktop.DesktopSummaryData.Source -eq "VIEW_COMPOSER" -and $desktop.DesktopSummaryData.Name -eq '1531-28')

    {

        $updates = Get-MapEntry -Key "desktopSettings.enabled" -Value $false

        $disablePool = $viewapi.Desktop.Desktop_Update($desktop.Id, $updates)

     }

}

 

Result:

 

Exception calling "Desktop_Update" with "2" argument(s): "ExceptionType : VMware.Hv.InvalidArgument

ErrorMessage : Invalid value for member

ParameterName : automatedDesktopData.vmNamingSettings.patternNamingSettings.namingPattern"

At C:\Scripte\powershell\VMware_View\View732\DisablePools.ps1:63 char:9

+         $disablePool = $viewapi.Desktop.Desktop_Update($desktop.Id, $ ...

+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : VimException

 

Can someone help me here?


Viewing all articles
Browse latest Browse all 232631


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