There are times with your virtual infrastructure running on top of VMware vSphere that you need to gather information about the physical servers you are running on. Have you ever wanted to know the details about CPU, memory, or other physical hardware? From time to time it is very handy to be able to gather some of these details from the VMware ESXi command line. Let’s take a look at VMware ESXi commandline get CPU and Memory Information.
Use Cases of ESXi Commandline Tools for Physical Hardware Info
You might wonder, when would I ever want to query physical hardware information about an ESXi host when I can get a lot of information from the vSphere Client?
Let’s think about a couple of use cases for that. What if you are remotely accessing the ESXi server and are unable to log into the web interface of the ESXi host for one reason or another and you need to know what type of CPU the host is configured with?
What about memory information? If you have been tasked with gathering information or inventory of CPU types, memory configurations and other physical hardware present in the ESXi host, having the ability to get this information from the commandline becomes essential.
Have you ever been in a situation where you could not remember the memory layout found in the ESXi host for memory upgrade purposes? You know you have 256 GB of memory, but you don’t know if it was configured with 8×32 GB DIMMs or 16×16 GB DIMMs.
This type of information becomes difficult to obtain without having a way to query the physical hardware information outside of the vSphere Client.
VMware ESXi Commandline Tools Get CPU and Memory Information
Let’s take a look at a few commandline tools that you can take advantage of to get the hardware information like CPU and Memory statistics from your physical ESXi host.
Get the VMware Version Quickly
To get the version of VMware that is running on your ESXi host very quickly, the very “Linux” like -v works with the vmware command like so:
Get the Manufacturer and Model of your ESXi Host
Now, on to the even more exciting info you can query from the commandline of your ESXi host, there is an interesting command called vim-cmd hostsvc/hosthardware that will yield really useful information about your physical server. This includes the Vendor and Model.
Get the Number of CPU Cores and Type
This same vim-cmd hostsvc/hosthardware command will allow you to see information about the CPU. This includes the number of CPUs installed, cores, and threads. Additionally in the description field you will see the Type of CPU installed. As you can see below, it details the Intel Xeon CPU D-1541 running at 2.10 GHz installed in my home lab host.
The smbiosdump command is another extremely useful command that presents information about your BIOS and other low level hardware information.
Back to one of the very handy use cases for being able to query physical hardware information from the command line is when you are trying to remember or figure out the memory layout in your ESXi host. Using the smbiosdump utility, you can see detailed information regarding the memory configuration of your host. This includes:
- Maximum memory size you can install in the system
- Location of memory slot, if it is populated
Using this command you can easily buzz through your slots and see what size, type, and manufacturer you have installed in each slot which can be extremely handy if you don’t have the liberty of shutting down your host and checking out the memory installed.
It is great to know that you can use VMware ESXi Commandline Get CPU and Memory Information if needed from your physical ESXi hosts in your environment.
There are many great use cases for having this ability when you either physical can’t get the information from your host or you don’t have the ability to hit the host with the web interface or using the vSphere client.
Using the tools presented here you can quickly and easily get CPU and Memory information from your ESXi hosts.