VMware Horizon Community
padulka
Hot Shot
Hot Shot
Jump to solution

Powercli to create manual pool

I'm using 'VMware.Hv.Helper' module

when a I try to create a manual desktop pool I'm receving the following error:

Get-VcenterID : Multiple Vcenter servers found, please specify the vCenter Name
At C:\Program Files\WindowsPowerShell\Modules\VMware.Hv.Helper\VMware.HV.Helper.psm1:4719
char:32

the script is the following:

$path = c:\migration

$idlists = get-content -Path $path\idlists.txt

$HorizonServer='connsrv01.lab.local'

$hvServer1 = Connect-HVServer -Server $HorizonServer -User user -Password password -Domain lab.local

foreach ($id in $idlists) {

$Machine= xxxxx$id
$relativePath = Get-Item "$path\ManualSpec.json" | Resolve-Path -Relative
$js = Get-Content $relativePath -raw| ConvertFrom-Json
$js.Base.Name=$Machine
$js.Base.DisplayName=$Machine
$js.ManualDesktopSpec.Machines| ForEach{$_.Machine = $Machine}
$js.ManualDesktopSpec.VirtualCenter=$dstvCenter
$js|ConvertTo-Json -Depth 5|Out-file $relativePath

# --- Create the pool ---
New-HVPool -spec $relativePath
Start-Sleep -s 10

$pool = Get-HVPool -PoolName $Machine -HvServer $hvServer1
$GroupName = 'xxx'+$id+'@lab.local'
$pool | New-HVEntitlement -Type Group -User $GroupName -Confirm:$false

}

In attach the ManuelSpec.json converted in pdf.

Many thanks

Reply
0 Kudos
2 Solutions

Accepted Solutions
fabio1975
Commander
Commander
Jump to solution

Ciao 

when you define the vcenter in the json file try to use this syntax:


"Source": "VIRTUAL_CENTER",
"VirtualCenter": {
"Id": "my vcentre server name"
},

Fabio

Visit vmvirtual.blog
If you're satisfied give me a kudos

View solution in original post

padulka
Hot Shot
Hot Shot
Jump to solution

I have found depends to have registered different version (and also SSO domain) to Horizon, I never solved the issue but removing vCenter 7.0 the issue desappers.

View solution in original post

Reply
0 Kudos
5 Replies
fabio1975
Commander
Commander
Jump to solution

Ciao 

Have you connected multiple vCenters on your horizon servers? The error appears to be related to the presence of multiple connected vSphere infrastructures.
I would like to say that you have to specify the vCenter where the VMs are present

 

Fabio

Visit vmvirtual.blog
If you're satisfied give me a kudos

comahony
VMware Employee
VMware Employee
Jump to solution

Error to repliy

Reply
0 Kudos
padulka
Hot Shot
Hot Shot
Jump to solution

Hi Fabio yes correct but the script should have to populate the json file itself with vcenter settings.

Reply
0 Kudos
fabio1975
Commander
Commander
Jump to solution

Ciao 

when you define the vcenter in the json file try to use this syntax:


"Source": "VIRTUAL_CENTER",
"VirtualCenter": {
"Id": "my vcentre server name"
},

Fabio

Visit vmvirtual.blog
If you're satisfied give me a kudos

padulka
Hot Shot
Hot Shot
Jump to solution

I have found depends to have registered different version (and also SSO domain) to Horizon, I never solved the issue but removing vCenter 7.0 the issue desappers.

Reply
0 Kudos