VMware Horizon Community
SyenceLabb
Contributor
Contributor

I can't automate full clone desktop pool deployment for Horizon View Connection Server 7.2

I have a connection server with a vCenter connection in place and now would like to automate deploying a full clone desktop pool using PowerCLI/Hv.Helper and nothing seems to work. Here is the New-HVPool command I am attempting to run:

 

$datastore = @('datastore')
$host_or_cluster = "cluster"
$resource_pool = "cluster"
$parent_folder = "/Datacenter/vm"
$template = "template"
$global_entitlement = "DOMAIN\Domain Users"
$user_assignment = "FLOATING"
$enable = $false
$enable_provisioning = $false
$stop_provisioning_on_error = $false
$naming_method = "PATTERN"
$maximum_count = 2
$cust_type = "NONE"
$pool_name = "jumpbox"
$pool_display_name = "jumpbox"
$naming_pattern = "vm{n:fixed=3}"
 
Connect-HVServer -server cs.domain.local -User user@domain.local -Domain domain.local -Password password
 
New-HVPool -FullClone `
           -PoolName $pool_name `
           -PoolDisplayName $pool_display_name `
           -UserAssignment $user_assignment `
           -Enable $enable `
           -Template $template `
           -VmFolder $parent_folder `
           -HostOrCluster $host_or_cluster `
           -ResourcePool $resource_pool `
           -Datastores $datastore `
           -EnableProvisioning $enable_provisioning `
           -StopProvisioningOnError $stop_provisioning_on_error `
           -NamingMethod $naming_method `
           -NamingPattern $naming_pattern `
           -MaximumCount $maximum_count `
           -CustType SYS_PREP `
           -SysPrepName "sysprep-spec"
New-HVEntitlement -ResourceName $pool_name -Type Group -User "DOMAIN\Domain Users"
Set-HVPool -PoolName $pool_display_name -key "desktopSettings.displayProtocolSettings.defaultDisplayProtocol" -Value "BLAST"
Set-HVPool -PoolName $pool_name -Key 'automatedDesktopData.customizationSettings.reusePreExistingAccounts' -Value $true
Set-HVPool -PoolName $pool_name -Key 'automatedDesktopData.customizationSettings.reusePreExistingAccounts' -Value $true
Set-HVPool -PoolName $pool_name -Enable -Key 'automatedDesktopData.virtualCenterProvisioningSettings.enableProvisioning' -Value $true
Disconnect-HVserver -server cs.domain.local -force -confirm:$false -erroraction:silentlycontinue
 
 

 

And I get the following output/error:

 

ServiceUri    : https://cs.domain.local/view-vlsi/sdk
RefCount      : 4
User          : administrator
Domain        : domain.local
Id            : /ViewServer=administrator@cs.domain.local/
SessionSecret : fb61757f-5266-4f21-aa5d-0c4b03022a9a
IsConnected   : True
ExtensionData : VMware.Hv.Services
Name          : cs.domain.local
Uid           : /ViewServer=administrator@cs.domain.local/
Client        : VMware.VimAutomation.HorizonView.Impl.V1.ViewServerClientImpl

Exception calling "Desktop_Create" with "2" argument(s): "ExceptionType : VMware.Hv.InvalidRequest
ErrorMessage : VmTemplate has an unsupported OS"
At C:\windows\system32\windowspowershell\v1.0\Modules\VMware.Hv.Helper\VMware.HV.Helper.psm1:4983 char:7
+       $id = $desktop_helper.Desktop_create($services,$desktopSpecObj)
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : VimException

 

I must note that I can manually create the full clone desktop pool with the exact configuration from GUI, which led me to try to first manually create the desktop pool, export the json file, then point to the same json file using New-HVPool, but then I receive another error when exporting seen below:

 

S C:\Windows\system32> get-hvpool | Get-HVPoolSpec | out-file C:\json2.json
Exception calling "VmTemplate_List" with "1" argument(s): "There is an error in the XML document."
At C:\windows\system32\windowspowershell\v1.0\Modules\VMware.Hv.Helper\VMware.HV.Helper.psm1:8112 char:10
+          $info = $services.VmTemplate.VmTemplate_List($VcId) | Where-Object { $_ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : InvalidOperationException

 

I'm basically at a hard stop with no clue what I should try next. Here are my versions for my environment:

 

vCenter:                                         6.7.0.47000
Horizon View Connection Server:                  7.2.0 build-5735293
Connection Server OS:                            Windows Server 2012 R2
Template:                                        CentOS 7/VM version 13 compatibility
Powershell version:                              4.0
VMware.Hv.Helper                      Manifest   1.3.1      
VMware.PowerCLI                       Manifest   12.2.0.... 
VMware.Vim                            Script     7.0.1.1... 
VMware.VimAutomation.Cis.Core         Script     12.2.0.... 
VMware.VimAutomation.Cloud            Script     12.0.0.... 
VMware.VimAutomation.Common           Script     12.2.0.... 
VMware.VimAutomation.Core             Script     12.2.0.... 
VMware.VimAutomation.Hcx              Script     12.2.0.... 
VMware.VimAutomation.HorizonView      Script     12.2.0.... 
VMware.VimAutomation.License          Script     12.0.0.... 
VMware.VimAutomation.Nsxt             Script     12.2.0.... 
VMware.VimAutomation.Sdk              Script     12.2.0.... 
VMware.VimAutomation.Security         Script     12.1.0.... 
VMware.VimAutomation.Srm              Script     12.2.0.... 
VMware.VimAutomation.Storage          Script     12.2.0.... 
VMware.VimAutomation.StorageUtility   Script     1.6.0.0    
VMware.VimAutomation.Vds              Script     12.2.0.... 
VMware.VimAutomation.Vmc              Script     12.2.0.... 
VMware.VimAutomation.vROps            Script     12.2.0.... 
VMware.VimAutomation.WorkloadMan...   Script     12.2.0....

 

Do I have any other options on automating this outside of using a newer version of Horizon View? I see some issues being noted about -FullClone problems here; 

https://github.com/vmware/PowerCLI-Example-Scripts/issues

 

But none of them seem to touch on my exact issue.

 

Any assistance greatly appreciated.

 

Labels (3)
0 Kudos
0 Replies