vmware / PowerCLI-Example-Scripts

http://blogs.vmware.com/powercli
Other
765 stars 608 forks source link

Get-HVPoolSpec of manual pool does not include machine info #603

Open JohnnyHenver opened 1 year ago

JohnnyHenver commented 1 year ago

Describe the bug

Get-HVPoolSpec cmdlet run against manual pool returns no machines even though the pool contains machines.

[...]
"ManualDesktopSpec": {
    "virtualCenterManagedCommonSettings": {
      "TransparentPageSharingScope": "VM"
    },
    "userAssignment": {
      "UserAssignment": "DEDICATED",
      "AutomaticAssignment": true,
      "AllowMultipleAssignments": false
    },
    "viewStorageAcceleratorSettings": {
      "UseViewStorageAccelerator": false,
      "ViewComposerDiskTypes": "OS_DISKS",
      "RegenerateViewStorageAcceleratorDays": 7,
      "BlackoutTimes": null
    },
    "source": "VIRTUAL_CENTER",
    "virtualCenter": "anon.domain.com",
    "machines": null                                    <<<<<<<<<<<<<<<<<<
  },
[...]

Reproduction steps

  1. Connect to HV-Server
  2. Run Get-HVPoolSpec against a manual pool that contains one or more machines.
  3. Inspect the "machines"-dictionary inside the spec returned by Get-HVPoolSpec

Expected behavior

The spec returned by Get-HVPoolSpec should contain information about the machines of the target pool.

The spec returned by Get-HVPoolSpec should be valid to use with New-HVPool -spec

Additional context

I understand that Get-HVPoolSpec should return a spec file that can be used with New-HVPool using the parameter -spec

The fact that the machines are not included in the spec file complicates migrations or easy recovery of desktop pool configurations using spec files.

New-HVPool accepts a spec file when the "machines"-dictionary is filled with information pulled with Get-HVMachineSummary.

I see no reason as to why the machines dictionary is empty when requesting a pool spec.