Johnny Zhang
esxtop is a great tool to monitor your host resource. What about if you want more information on the VM itself?
Connect to ESX server via ssh --> "esxtop" --> "c" (to switch to the CPU screen) Now you will see somthing like this:
Now what about if I want to see the VM named "bs-bcs-vc01"?
I can type "e" --> now it will ask me about the GID which is 20 in this case. so I type in "20" hit enter.
You now can see the CPU
usage on all virtual CPU and the monitor processes (VMM), remote connections (MKS)
Johnny Zhang
There are times you need to get a quick report on the server uptime. There is a quick way to do this

vmkuptime.pl --text

The script will read through your existing vmkernel log files and figure out the servers total up time, total down time, longest up and down time. Number of unscheduled downtimes.

You can use this to show your boss how good you know your server with some hard work! (one command)
Johnny Zhang
I remember some customers were asking if there is a way to find out how many vmotions in total the vCenter kicked off.

You might able to find this out by query from the SQL database (Yes, you need to have access to the DB)

I test this on vCenter 2.5 (There maybe some modification on vCenter 4.0 which I will get a follow up later when I test it myself)

Log into SQL managment studio --> New query --> type in:

USE Your_DB_Name
GO

SELECT
Entity_name,
complete_state,
queue_time,
start_time,
complete_time,
event_chain_id,
username

FROM vpx_task

WHERE name='vim.VirtualMachine.migrate'

GO

You should get the information you are looking for. If you want more details you can use

SELECT *

FROM vpx_task

WHERE name='vim.VirtualMachine.migrate'

GO
Johnny Zhang
There are times you want to change your service console memory from the service console itself... So what you need to do?

There are two parts you need to change
  1. /etc/vmware/esx.conf -- you are looking for /boot/memSize = "272" (ESX 3.x set default 272MB and for ESX 4.0 the default is 300)
  2. /boot/grub/grub.conf -- There are two section you need to change
  • uppermem 277504
  • kernel --no-mem-option /vmlinuz-2.4.21-57.ELvmnix ro root=UUID=1da98f06-aa98-4c1e-b4c1-73ffa2c536f2 mem=272M
To change to 800MB you can make the change like this:
  1. /etc/vmware/esx.conf -- /boot/memSize = "800"
  2. /boot/grub/grub.conf
  • uppermem 818176
  • kernel --no-mem-option /vmlinuz-2.4.21-57.ELvmnix ro root=UUID=1da98f06-aa98-4c1e-b4c1-73ffa2c536f2 mem=800M
Or you can script it

#!/bin/sh

/bin/sed -i -e 's/300/800/' /etc/vmware/esx.conf

/bin/sed -i -e 's/300M/800M/' /boot/grub/grub.conf

/bin/sed -i -e 's/307200/818176/' /boot/grub/grub.conf

Please keep in mind this is not the recommended method to change the service console memory. We always recommend you to change that via VIclient. I test this on my lab server and works for both ESX 3.5 and ESX 4.0. Please only use this on a test machine
Johnny Zhang
Both ESXi 3.5 and ESXi 4.0 allow you to access the virtual machines logs and configurations through a browser.
Open your broswer --> point it to https://host_ip_address/folder
The first page is the data-center information.
(Since this is raw information, you will not see the data center name that you familiar with.) The second page is the data-stores (Again you will see datastore1, 2, 3). The next page will list virtual machines. when you click on the virtual machines you will see something like this:

Johnny Zhang
There are times when we need quick access to ESXi log files, and don't know where to begin. A really quick way to access the host log files (hostd.log, vpxa.log, messages) and some of the configuration files (esx.conf, vpxa.cfg). All you need is your browser. Open your browser --> point it to https://host_ip_address/host
After you log in as root you should see:

You can click on them to view it or download it for later use.
There was an error in this gadget