Executing the following cmdlet returns an empty collection (maybe $null) for the Hosts property initially.
Get-SCVMHostGroup -VMMServer "my_vmm_server" -Name "Production"
AllChildGroups : {}AllChildHosts : {}
AllowUnencryptedTransfers : False
ChildGroups : {}
CreationDate : 9/5/2014 5:56:08 PM
Creator : DOMAIN\user
Description :
Hosts : {}
ID : ea291d5d-b68f-416c-9c8e-d4c149112f8b
InheritNetworkSettings : True
IsFullyCached : True
IsRoot : False
MarkedForDeletion : False
ModificationDate : 9/5/2014 5:56:33 PM
ModifiedBy : DOMAIN\user
Name : Production
ParentHostGroup : All Hosts
Path : All Hosts\Production
ServerConnection : Microsoft.SystemCenter.VirtualMachineManager.Remoting.ServerConnection
But after some unknown time, without touching anything, if I rerun the same command, the property is suddenly populated. The elapsed time between the initial run and when it is populated can be anywhere from 3 to 7 minutes.
AllChildGroups : {}
AllChildHosts : {}
AllowUnencryptedTransfers : False
ChildGroups : {}
CreationDate : 9/5/2014 5:56:08 PM
Creator : DOMAIN\user
Description :
Hosts : {HV-01, HV-02}
ID : ea291d5d-b68f-416c-9c8e-d4c149112f8b
InheritNetworkSettings : True
IsFullyCached : True
IsRoot : False
MarkedForDeletion : False
ModificationDate : 9/5/2014 5:56:33 PM
ModifiedBy : DOMAIN\user
Name : Production
ParentHostGroup : All Hosts
Path : All Hosts\Production
ServerConnection : Microsoft.SystemCenter.VirtualMachineManager.Remoting.ServerConnection
Can somebody please explain this? Is there a way to get the property populated immediately? Is there a different command I can run to get the collection of hosts?
In my particular case, I ultimately need to find the host (under a particular host group) with the lowest number of virtual machines so I can use that for provisioning a new vm.
SCVMM 2012 R2 running on Windows 2012 R2- Edited by Jay-Callas Tuesday, February 17, 2015 8:08 PM
- Moved by BrianEhMVP, Moderator Tuesday, February 17, 2015 10:01 PM