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
Ciao
when you define the vcenter in the json file try to use this syntax:
"Source": "VIRTUAL_CENTER",
"VirtualCenter": {
"Id": "my vcentre server name"
},
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.
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
Error to repliy
Hi Fabio yes correct but the script should have to populate the json file itself with vcenter settings.
Ciao
when you define the vcenter in the json file try to use this syntax:
"Source": "VIRTUAL_CENTER",
"VirtualCenter": {
"Id": "my vcentre server name"
},
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.