|
Objective 6.2 - Configure Service Console Log Behavior |
|
|
|
Written by Matthijs van den Berg
|
|
Monday, 06 April 2009 21:01 |
KNOWLEDGE
- Describe Service Console log consolidation
ESX 3.x uses the syslogd for logging configuration. The settings file can be found here:
etc/syslog.conf
Identify location of Service Console related log files There are several files for different VMware server services. They are all located under the directory /var/log. A little explanation:
| Log File |
Service |
Purpose |
| /var/log/vmkernel |
Vmkernel |
records activities related to the virtual machines and ESX server |
| /var/log/vmkwarning |
Vmkernel Warnings |
records activities with the virtual machines |
| /var/log/vmksummary |
Vmkernel Summary |
Used to determine uptime and availability statistics for ESX Server; human-readable summary found in /var/log/vmksummary.txt |
| /var/log/vmware/hostd.log |
ESX Server host agent log
|
Contains information on the agent that manages and configures the ESX Server host and its virtual machines (Search the file date/time stamps to find the log file it is currently outputting to) |
| /var/log/ |
Service Console |
Contain all general log messages used to troubleshoot virtual machines on ESX Server. |
| /var/log/vmware/webAccess |
Web Access messages |
Records information on Web-based access to ESX Server |
| /var/log/secure |
Authentication log |
Contains records of connections that require authentication, such as VMware daemons and actions initiated by the xinetd daemon |
| /var/log/vmware/vpx |
VirtualCenter agent |
Contains information on the agent that communicates with VirtualCenter |
| /vmfs/volumes/<VM Storage>/<VM name> |
Virtual Machines |
Contain information when a virtual machine crashes or ends abnormally |
Describe options for customizing Service Console log behavior
More info: http://www.vmware.com/
There are four options you can use to change virtual machine logging and log rotation behaviors. Edd these option via the GUI as described below under Skills and Abilities.
- logging
The logging option allows you to turn logging on or off. To turn logging off, enter logging="false" in the virtual machine's .vmx file. To turn logging back on, change
logging="false" to logging="true"
log.rotateSize By default, the virtual machine log file ( vmware.log) is rotated as a result of the virtual machine's Power On or Power Off operation. To configure log rotation based on file size, include the following option in the .vmx file of the virtual machine: log.rotateSize=<maximum size in bytes the file can grow to> The following example specifies the vmware.log file to be rotated when its size reaches 100 kilobytes:
log.rotateSize=100000
log.keepOld By default, ESX Server 3.0 keeps six rotations of the vmware.log file ( vmware.log, vmware-1.log, vmware-2.log... ). To change the level of rotation, use the log.keepOld option. The following example specifies the level of rotation to be 10:
log.keepOld=10
log.fileName To specify an alternative location or filename for virtual machine logging, use the log.fileName option. The following example specifies "myVMlog" as the new file for logs instead of the default "vmware.log":
log.fileName="myVMlog"
The next example directs logs to be written to an alternate directory called "myVM" in a different VMFS volume, "vol1":
log.fileName="/vmfs/volumes/vol1/myVM/myVM.log"
Explain default log file characteristics Default log files are:
- Log files are kept for 36 versions
- Log files are max 200 KB (then a new file is generated, = max 7,2 MB)
- Log files are rotated each month (= max 3 year log files)
- Log files are created with user rights 0600 root root
Understand log file collection methods You can download the log files from the ESX server using SFTP (there are several free tools for Windows to open a SFTP connection to an ESX host like WINSCP). Another option is to use 3th party tools for log file collection. It is also possible to use syslog to collect the log files.
Define additional third-party log files located on the Service Console This depends on the 3th party tools installed on the system. Most common are log files generated by hardware tools as HP RDP. The log file location varies per application.
SKILLS AND ABILITIES
/etc/logrotate.conf
The default directory is:
/etc/logrotate.d/
You can find the following VMware reated files here:
These file determine the log rotaion setting on a per service / server level. Example of the vmkernel logrotaion:
/var/log/vmkernel { create 0600 root root missingok nocompress # keep a history over 3 years. monthly rotate 36 # max log size of 200k (thus limiting total disk usage to under 8megs) size 200k sharedscripts postrotate /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true endscript }
GUI ESX Server does not rotate the log file until it reaches the size limit, even if you power on the virtual machine. By default, ESX Server maintains six log files. You can enable and configure size-based log file rotation by performing the following steps:
- Log on to the Virtual Infrastructure Client and select the virtual machine from the inventory panel. The configuration page for this virtual machine appears with the Summary tab displayed.
- Click Edit Settings.
- Click Options > Advanced > Configuration Parameters to open the Configuration Parameters dialog box.
- Click the Add Row button and type the following:
Name field: log.rotateSize Value field: <maximum size in bytes of log file> This implicitly turns on size-based log file rotation.
- Click the Add Row button again and type the following:
Name field: log.keepOld Value field: <number of log files to keep> A log file size of 500KB is recommended in order to provide enough information for reasonabledebugging.
Modify VC Server log configuration Double in the guide, explained this in Objective 6.1.
Modify VC Agent log configuratiom Double in the guide, explained this in Objective 6.1.
Export VC logs Double in the guide, explained this in Objective 6.1.
TOOLS
|