Eric Monjoin
Staff Consulting Architect but also pilot, spending time in front of my computer or flying in the air...

PowerCLI and VMware Horizon.. error BaseImageVM_List

PowerShell and more specifically VMware PowerCLI (who are the PowerShell commands to manage VMware Infrastructure with around 800 cmdlets) are incredible tools who extremely facilitate administrators day to day life…

Now sometime it happens, after an upgrade, that didn’t work any more as expected.

In order to manage Horizon deployment using PowerShell scripts, using PowerCLI is not enough and you need to add the VMware.HV.Helper modules who contains many commands and more especially the New-HVPool one in order to create Horizon pools.

Basically, if you want to manage VMware stuff you only need to run the following command :

Install-Module VMware.PowerCLI -AllowClober -Scope {CurrentUser | AllUsers}

CurrentUser will install in :
$home\Documents\WindowsPowerShell\Modules
When
AllUsers will install PowerCLI in :
C:\ProgramFiles\WindowsPowerShell\Modules

Now, unfortunately, if you install the latest version of the VMware PowerCLI (12.2.0) and try to deploy an Horizon Pool with the New-HVPool command, it will fail with the following error :

“New-HVPool : Failed to create Pool with error: Cannot find an overload for “BaseImageVm_List” and the argument count: “2””

This issue is being investigated as show in this thread on GitHub but until it’s fixed we need to have a workaround to make it works… and this workaround it to use PowerCLI 12.0.0, so, if you have already installed PowerCLI 12.2.0, the first thing to do is to remove it by deleting all folders starting by VMware.* in the installation directory but not VMware.Hv.Helper (you need to keep it).

And the second thing is to download and install PoweCLI 12.0.0 from the .ZIP file. You can download it here.

Once extracted copy all files and folders to PowerShell’s module directory and run the following command to let PowerShell the ability to use them by unblocking files downloaded from Internet:

Get-ChildItem -Path 'C:\Program Files\WindowsPowerShell\Modules\' -Recurse | Unblock-File

You can check that all modules are here by using this command :

Get-Module -ListAvailable VMware*

You should have the following results :

You can now deploy Instant Clone VM using PowerShell…

References:
Create Horizon Desktop Pool using PowerCLI by RODERIK DE BLOCK
VMware PowerCLI 12.0.0 Download
PowerCLI-Example-Scripts on GitHub

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *