- How to use VMware vSAN ReadyNode Configurator - Fri, Dec 17 2021
- VMware Tanzu Kubernetes Toolkit version 1.3 new features - Fri, Dec 10 2021
- Disaster recovery strategies for vCenter Server appliance VM - Fri, Nov 26 2021
Basically, it flags a VM as "TRUE" when the VM does not need any optimization of cores and sockets. If a VM has configured more cores and sockets than necessary, it flags the VM as "FALSE."
This gives you insight into your environment because, as you know, VMs that are not optimized basically cause the whole host to perform poorly if they're configured with too many cores or sockets.
On the other hand, when a VM struggles with performance, you feel it in your application. The application performs poorly. The best balance of performance and configuration can be achieved using this utility.
However, the script only gives you static suggestions, as it will not be able to analyze the dynamic live performance of your VMs and provide you with suggestions. For this to happen, you'll need to use some more sophisticated software, such as VMware vRealize Operations Manager (vROPS) or such.
The VMCO is distributed as a PowerShell script and needs a Windows machine to run from. Any Windows workstation, laptop, or server that has PowerShell v5 or higher installed will do.
The machine also needs internet connectivity, as the script seeks the latest updates to the required modules.
The third requirement is a user account with read-only rights assigned at the vCenter Server level, with the "propagate to children" option enabled.
Running the script
I have chosen to run the script via PowerShell ISE, where I have more flexibility. At the first run, the script asks for a directory where it will generate the report.
Simply hit Enter if you want to save the report to the same directory as the script. After that, the script connects to the internet and installs all the necessary modules if they're not already installed.
If the modules are installed but not up-to-date, the script automatically updates the VMware VimAutomation.core module to the latest release.
If your modules are up to date, the script will pause and wait until you enter the fully qualified domain name (FQDN) of your vCenter Server. Once you do that, you'll get a pop-up window asking for credentials to connect to your vCenter Server.
Once done, the system will work a bit, check for all the VMs that are located within your vSphere environment, and then generate the output as a CSV file.
In my smallish nested vSphere lab with two VMs, the screen looks like this. When you have more VMs, you'll find it more useful.
Note that the script skips template VMs and VMs that are powered OFF. It verifies the number of hosts within your cluster and their configuration.
We're done. As you can see, there is no need to be a scripting expert. The script is preconfigured with all the necessary information and asks only about the location of your vCenter Server.
We can head to our temp folder to read the CSV. As I said, the only two VMs I have in the lab are not enough to make any assumptions, so the report is just an example of what you can expect.
There are many columns within the CSV, but I have selected the most interesting ones. Here is an extract of the fields that are interesting.
The report also gives you all the details about your vSphere cluster, such as the amount of RAM, number of sockets, your ESXi versions, whether DRS is enabled, host power policy (recommended to be set as "High Performance"), the CPU socket count, or whether hyperthreading is active. This is really useful information, which might also include information about possible misconfiguration or version differences.
The VMs section gives you detail about the virtual hardware version, whether CPU hot add is enabled, number of sockets/core count, and whether the VM is optimized.
In our example above, you can see that one of my VMs is not optimized; the system also gives you a recommendation for changing the configuration within the OptimalSockets section. As for the recommendation, the "Details" column gives you more details on what can be done to improve your system's performance.
Example: VM memory and CPU spans pNUMA nodes and should be distributed evenly across as few as possible VM spans pNUMA nodes, but pNUMA is not exposed to the guest OS: (CpuHotAddEnabled = TRUE) (vCPUs < 9). Consider modifying the advanced setting.
I recommend reading the documentation of the VMCO, which gives you further details and examples. Here is one of them:
The VMCO free script is really useful when you don't have access to more complex paid tools from VMware, such as vRealize Operations (vROPS). I think that this script can be used hand-in-hand with other free tools and should be part of the toolbox of all vSphere administrators.
The only requirements are that you basically need a Windows machine with an internet connection. But if you're an IT consultant and have a Windows laptop, nothing else is needed—just the vCenter Server address and credentials for a connection.
Subscribe to 4sysops newsletter!
You can download the VMCO Optimizer from the VMware Fling site here.
Want to write for 4sysops? We are looking for new authors.