padulka
Hot Shot
Hot Shot

Powercli to create manual pool

Jump to solution

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

0 Kudos
2 Solutions

Accepted Solutions
fabio1975
Hot Shot
Hot Shot

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
BLOG: https://vmvirtual.blog

if satisfied give me a kudos

View solution in original post

padulka
Hot Shot
Hot Shot

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

0 Kudos
5 Replies
fabio1975
Hot Shot
Hot Shot

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
BLOG: https://vmvirtual.blog

if satisfied give me a kudos
comahony
VMware Employee
VMware Employee

Error to repliy

0 Kudos
padulka
Hot Shot
Hot Shot

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

0 Kudos
fabio1975
Hot Shot
Hot Shot

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
BLOG: https://vmvirtual.blog

if satisfied give me a kudos

View solution in original post

padulka
Hot Shot
Hot Shot

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

0 Kudos