Dim vmCenter As String = Me.tb_AVM_VIC.Text.ToUpper Dim client As New VMware.Vim.VimClient If ConnectToVirtualCentre(client, vmCenter) Then Else Exit Sub End If Dim filter As New NameValueCollection filter.Add("Runtime.PowerState", "PoweredOff") filter.Add("name", "^" & Me.cbx_GBM_PVM_DiskSize.SelectedItem.ToString & Me.cbx_GBM_PVM_GEOSVer.SelectedItem.ToString.Replace(".", "")) Dim ClusterList As IList(Of EntityViewBase) = client.FindEntityViews(GetType(ComputeResource), Nothing, Nothing, Nothing) If ClusterList Is Nothing Then Call DisconnectFromVirtualCentre(client) Exit Sub End If For Each ThisCluster As ClusterComputeResource In ClusterList Dim vmList As IList(Of EntityViewBase) = ThisCluster.Client.FindEntityViews(GetType(VirtualMachine), Nothing, filter, Nothing) If vmList Is Nothing Then Call DisconnectFromVirtualCentre(client) Exit Sub End If For Each vm As VirtualMachine In vmList Dim vmClusterName As String = "UNKNOWN"