Hi,
When importing a pool with powershell in json format, this error appears :
Exception lors de l'appel de « Desktop_Create » avec « 2 » argument(s) : « ExceptionType : VMware.Hv.InvalidArgument
ErrorMessage : A null value is invalid.
ParameterName : automatedDesktopSpec.virtualCenterProvisioningSettings.virtualCenterStorageSettings.viewStorageAcceleratorSettings.viewComposerDiskTypes »
C:\Program Files\WindowsPowerShell\Modules\VMware.Hv.Helper\VMware.Hv.Helper.psm1:5008 : 7
+ $id = $desktop_helper.Desktop_create($services,$desktopSpecObj)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : VimException
This seems related to a null value in the json file ?
The property automatedDesktopSpec.virtualCenterProvisioningSettings.virtualCenterStorageSettings.viewStorageAcceleratorSettings.viewComposerDiskTypes is not null for this pool.
that's annoying, did you also ask on the github page as thats where the people are who work on the module.
You mean here ? https://github.com/vmware/PowerCLI-Example-Scripts/issues
Yes I did. Still no reply yet.
there indeed, I stopped supporting the module years ago but there are some folks that still keep improving it. Imho the best way is to switch completely to the rest api's
What do you mean by switching to the rest api's ?
I'm looking for a way to export pools from a connection server then import them in another one. Hence the use of the hv.helper module. That could be done with that rest api ?
absolutely it's what I did here: https://www.retouw.nl/2021/12/08/creating-desktop-pools-using-the-horizon-rest-api-with-powershell/
You might need to play a bit with things but this is how I created my example.
When executing get command on the desktop pools inventory, this gives the error :
401 | Error: Unauthorized |
{ "status": "UNAUTHORIZED", "timestamp": 1693848140815, "error_message": "Authentication token not found" }
There is no log in section on that page
there is a way to do that by using the api call (top most section) but I made a short script that logs in for you and puts a login token on your clipboard https://www.retouw.nl/2020/08/26/using-the-horizon-8-swagger-page/
Thanks.
I got the export of the desktop pools in a json file from the get command, when using POST to import it in another connection server, this gives this error.
Error 400 : bad request.
400 | Error: Bad Request Response bodyDownload |
{ "timestamp": "2023-09-04T16:08:17.734+00:00", "status": 400, "error": "Bad Request", "path": "/rest/inventory/v1/desktop-pools" }
access-control-allow-credentials: true access-control-allow-origin: https://********** cache-control: no-cache,no-store,max-age=0,must-revalidate content-security-policy: default-src 'self';connect-src 'self' https:;font-src 'self' data:;img-src 'self' data:;script-src 'self';style-src 'self' 'unsafe-inline';frame-ancestors 'none' content-type: application/json expires: 0 pragma: no-cache strict-transport-security: max-age=31536000 ; includeSubDomains transfer-encoding: chunked vary: Origin x-content-type-options: nosniff x-frame-options: DENY x-xss-protection: 1; mode=block
So by default, when using the get command from the web page, there is only minimal information that is extracted from the pools ?
it has all the info from the pool in the json but some parts you will need to remove as they are unneeded. In my blog post I only went for the bare essentials for my pools but you have to play with what is required in your environment.