7

This is a server that is running on Vmware ESXi:

SERVER:/root # cat /etc/SuSE\-release                         
SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11               
PATCHLEVEL = 2             
SERVER:/root # rpm -qa|grep -i vmware                         
vmware-open-vm-tools-common-8.0.3-258828.sles11sp1
vmware-open-vm-tools-nox-8.0.3-258828.sles11sp1
vmware-tools-nox-8.0.3-258828.sles11sp1
vmware-tools-common-8.0.3-258828.sles11sp1
SERVER:/root # 

How can I figure out how many physical CPUs are assigned to the vmware guest? I only have access to the guest, not the host

1
  • 1
    You need to specify your VMware platform if you want a straighter answer. ESXi? Workstation? Fusion? ESXi assigns CPU's as sockets and cores, not sure what 1.2 would equate to? Maybe you are looking for the resource pool?
    – Tim
    Aug 2, 2012 at 14:09

7 Answers 7

6

The lscpu, if installed, synthesize somehow the information given by cat /proc/cpuinfo. In particular you can take a look at the fields CPU(s), Core(s) per socket and Socket(s).

1
  • +1, far better than cpuinfo
    – Amit
    May 22, 2014 at 19:38
2

Try this one

cat /proc/cpuinfo
2
  • I checked it, but it doesn't provides the info regarding vmware, that how many cpu's did the vmware host give to the vmware guest, it's a number like: 1 or 1.2, etc. Aug 2, 2012 at 12:27
  • 1
    Actually it usually DOES show the number of processors. You should see a line with "processor" in it for each accessible CPU. i.e. cat /proc/cpuinfo | grep processor should return two lines. Aug 2, 2012 at 21:13
2

Assuming you are running VMware ESXi platform.

First you can try dmidecode -t processor from the guest.

If that doesn't provide what you need, go grab the Viper toolkit or the ViJava toolkit so you can automate queries against the ESXi server to obtain the information you need.

2
  • No problem. I use the ViJava TK extensively. Check out this example of how powerful the TK is for building apps/scripts: zeroex.co.cc:89/ypvms/vz (Note: Ajax takes about 10 to load after the page loads, be patient)
    – Tim
    Aug 2, 2012 at 15:25
  • +1 dmidecode is awesome. Of course the problem is that it's up to the hypervisor what kind of BIOS information it wants to export to its guests.
    – rsaw
    Aug 2, 2012 at 23:54
1

after you have the vmware tool installed try running the commands listed below which can give you the desired details

[root@abc ~]# vmware-toolbox-cmd stat speed
2597 MHz
[root@abc ~]# vmware-toolbox-cmd stat sessionid
0xe3544b3227f59800
[root@abc ~]# vmware-toolbox-cmd stat balloon
0 MB
[root@abc ~]# vmware-toolbox-cmd stat swap
15 MB
[root@abc ~]# vmware-toolbox-cmd stat memlimit
4294967295 MB
[root@abc ~]# vmware-toolbox-cmd stat memres
0 MB
[root@abc ~]# vmware-toolbox-cmd stat cpures
0 MHz
[root@abc ~]# vmware-toolbox-cmd stat cpulimit
4294967295 MHz
[root@abc ~]#
1

You can also try

nproc

which prints the number of processing units available. This prints the number of processing units available to the current process, which may be less than the number of online processors

0

You can get this info only from the vSphere Client.. :\ (but fixme, if there is a way.. I just asked many people, and the conclusion was this..)

p.s.: maybe:

vmware-toolbox-cmd

can do this, but I can't see it on the servers:

http://www.virtuallyghetto.com/2011/01/how-to-extract-host-information-from.html

where does vmware-toolbox-cmd get's its information? isn't there any alternatives for it?

1
  • It would only be available if you installed VMware Tools in the guest. Aug 6, 2012 at 7:12
0

The problem is when you move your VM form one ESX to another, the information is not up-to-date, only vmware-toolbox-cmd stat speed is updated. /proc/cpuinfo and dmidecode are obsolete/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .