vmware / PowerCLI-Example-Scripts

http://blogs.vmware.com/powercli
Other
757 stars 603 forks source link

[VMware.Hv.Helper] New-HVPool -Spec /path/to/spec.json does not honor minNumberOfMachines parameter from json file #524

Closed cadegenn closed 2 years ago

cadegenn commented 2 years ago

Describe the bug

Calling New-HVPool -Spec /path/to/spec.json ignore value set for minNumberOfMachines when using provisionningTime: ON_DEMAND

Reproduction steps

1. create a json file using the template provided here https://github.com/vmware/PowerCLI-Example-Scripts/blob/master/Modules/VMware.Hv.Helper/Json/Pool/InstantClone.json
2. take care to update following values:
- "ProvisioningTime":  "ON_DEMAND",
- "MinNumberOfMachines":  2
or any integer > 0
3. create the pool using command
$pool = New-HVPool -Spec /path/to/spec.json

The newly created pool will have MinNumberOfMachines set to 0. It can be verified with

$pool = Get-HVPool -Poolname "<the name of the pool from spec.json>"
$pool.AutomatedDesktopData.VmNamingSettings.PatternNamingSettings

Expected behavior

The expected behavior is (from the example above) to get MinNumberOfMachines set to 2.

Additional context

tested with latest version of the module VMware.HV.Helper Thank you

kamennikolov commented 2 years ago

Fixed with https://github.com/vmware/PowerCLI-Example-Scripts/pull/525