Please provide your feedback in this short Flings' survey.
Nov 13, 2019

Arch, I can't reproduce that error, so might need you to test something out. If it makes it easier, you can email me: <first_initial><last_name> I need to see the resulting "hosts.csv" file that spits out from the following. I think there is a host returning a clusterID that cannot be searched on for some reason. I account for $null clusterID if a host is not in a cluster, but something else might be happening I haven't accounted for.

Connect to the vCenter(s) that you are getting errors with (connect-viserver), and run the following commands.
#start Code
$hostFilter = @{'Runtime.ConnectionState'='connected';'Runtime.PowerState'='poweredOn'}
$vmHosts = get-view -Filter $hostFilter -Property Name,Parent | select Name,@{n='vCenter';e={([uri]$_.Client.serviceurl).Host}},@{n="ClusterId"; e={$_.Parent | Where{$_.Type -eq "ClusterComputeResource"} | select -expand Value}}
$vmHosts | Export-Csv -Path "c:\temp\hosts.csv" -NoTypeInformation
#end code

You can change the Path on the last line to anywhere you want to write the output. You could either sanitize the results and post them here, or email me the csv file.

Thanks for your help, and please let me know if you have any questions!

Nov 03, 2019

The final report is blank. This is what I get when trying to run it:

VERBOSE: Retrieving VMs information - Skipping Disconnected, Powered Off, or Template VMs
VERBOSE: 11/3/2019 3:23:07 PM Get-View Finished execution
VERBOSE: Retrieving Host information. Skipping Disconnected or Powered Off Hosts
VERBOSE: 11/3/2019 3:23:08 PM Get-View Finished execution
VERBOSE: Retrieving Cluster information
Error generating VMCO report: Error retrieving Cluster information: Cannot validate argument on parameter 'Id'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again..Exception.Message
Analysis complete. Please check report at C:\temp\VM-optimizer\VMCO_Report.csv

Nov 05, 2019

Sorry for the slow reply Arch! I am attending VMworld in Barcelona. I saw you opened a bug on this. I will research and see what I can find, but I might need some additional information from you.

Sep 18, 2019

Hey Mark, great script!
Did you ever get around to finishing v2?

Oct 17, 2019

Proviant, v2.0.0 was just uploaded. Please let me know what you think!

Oct 21, 2019

Thanks Mark, looks good - I've noticed a few of the Clusters, ClusterMemory, ClusterMinSocket and ClusterMinCoresPerSocket reports only as "System.Object[]" in the CSV?

Oct 21, 2019

Hi Proviant. Thank you for the feedback! I haven't seen that issue in my test environments, so hoping you can give me a little more data. Is there anything unique about the hosts or clusters that are showing System.Object, and does it show that same info for any VM that is on that host or in that cluster? I accounted for hosts w/ no cluster to show blanks, but wondering if you have a situation I haven't seen and accounted for in my labs. Finally, are you running it from the "Virtual_Machine_Compute_Optimizer_v2.0.0.ps1" or using the stand alone function and piping it to Export-CSV?

Oct 21, 2019

Hi Mark, very strange indeed.
This is when I use the "Virtual_Machine_Compute_Optimizer_v2.0.0.ps1" If I run the stand alone function on a few of the VM's that reported the System.Object[] earlier, it reports correctly though?
The hosts in question aren't standalone (all in clusters), and the clusters are a mix of DMZ and Internal, spread between multiple sites, both 6.5 and 6.7. Hardware versions are a mix of 8,10,13,14 and host hardware also differs between clusters.
Let me know if I can provide more info.

Oct 22, 2019

I think I may know what's happening. The System.Object[] in exporting to CSV usually happens when it's trying to write an object rather than just a value to the CSV. If you could test this for me: on line 145 of "Get-OptimalvCPU.ps1", add " | Select -first 1" to the end of the line. So the entire line would be: "$cluster = $clusters | Where{($($_.Id) -eq $($vmHost.ClusterId)) -and ($($_.vCenter) -eq $($vmHost.vCenter))} | Select Name,MinMemoryGB,MinSockets,MinCoresPerSocket | select -first 1" . Re-run the original way and see if that has any effect on the results. if yes, verify the cluster info looks correct for the VM(s) that were originally giving you grief. Thank you for your help!

Oct 22, 2019

Hi Mark, that did the trick, all clusters reporting correctly! Thank you!

Sep 19, 2019

Proviant, it's almost ready to go! I need to clarify some behaviors between 6.0 and 6.5+, and it's ready. Hopefully by early next week!

Sep 19, 2019

Awesome, can't wait!

Sep 09, 2019

Just a suggestion, but I added a column to the output called "Crosses pNUMA" and did an IF statement that says, if VMMemoryGB is greater than (HostMemoryGB divded by HostSockets), print TRUE. I thought it might help to prioritize which VM's to fix first.

Oct 17, 2019

Warner, v2.0.0 was just uploaded, and it includes additional information, including details on the findings, and priority.

Sep 10, 2019

Hi Warner. I'm in the process of adding that to the 2.0 version to indicate priority based on crossing pNUMA (vCPUs or vMemory), as well as pNUMA not being exposed to the guest OS under certain circumstances.

Thank you for the feedback!