Latest Posts



Translate

Total Pageviews

Tuesday, 4 December 2012

Increasing vCenter Server and ESX/ESXi logging levels



Purpose

The Management agent (hostd), VirtualCenter Agent Service (vpxa), and VirtualCenter (vpxd) logs are automatically rotated and maintained to manage their growth. Information in the logs can be lost if the logs are rotated too quickly.

Note: Rotation means the turn over of files. For example, if you set the maximum number of log files to 10, after every 10 log files, the numbering restarts at 0.
 
This article provides steps to increase the size and number of the hostd, vpxa, and vpxd logs so that additional data is saved. This data may be useful for troubleshooting purposes. 

Each logs are found at these locations:
  • hostd logs in ESX/ESXi 4.x hosts are located at /var/log/vmware/
    hostd logs in ESXi 5.0 hosts are located at /var/log/
  • vpxa logs in ESX/ESXi 4.x hosts are located at /var/log/vmware/vpx/vpxa logs in ESXi 5.0 hosts are located at /var/log/
  • vpxd logs are located in %ALLUSERSPROFILE%\Application Data\VMware\VMware VirtualCenter\Logs, which translates to C:\Documents and Settings\All Users\Application Data\VMware\VirtualCenter\logs in Windows 2003 and C:\ProgramData\VMware\VMware VirtualCenter\Logs in Windows 2008.

Resolution

Before you increase the size and number of logs:
Note: VMware does not recommend decreasing the number or size of logs from the default settings.
 
This article contains three sections, one for each log. Skip to the log you want to change.
 
hostd
To increase the logging for hostd:
  1. Log in to your ESX host as root from either an SSH session or directly from the console. For more details, see KBs listed in See Also section.
  2. Open the configuration file for hostd in a text editor.

    Note: The configuration file for hostd is found at /etc/vmware/hostd/config.xml. 

    ESXi 5.x only: To redirect logs to local disk instead of syslog for troubleshooting puposes, first change this line in the config.xml (/etc/vmware/hostd/config.xml) to be true.

    <!-- If true, log to files on disk -->
    <outputToFiles>false</outputToFiles>
    The file looks similar to:
    <config>
    :
    <log>
    <directory>/var/log/vmware/</directory> -- Logging path
    <level>verbose</level> -- Log Level (The default level is info. You can increase it by changing it to "verbose" or "trivia". Note: In ESXi/ESX 4.0 and later the default log level is verbose.)
    <name>hostd</name> -- Prefix<outputToConsole>false</outputToConsole> -- Console out
    <maxFileSize>5242880</maxFileSize> -- Maximum size of each log file, in bytes. By default, the maximum file size is 5243904 bytes.<maxFileNum>50</maxFileNum> -- Maximum number of log files</log>
    :
    </config>

    Note: The <directory> entry can also be updated with a full path to a VMFS datastore, for example<directory>/vmfs/volumes/<datastore name>/<log directory></directory>. This may be useful on ESXi hosts where space is limited.
  3. Increase the <maxFileSize> parameter to change the maximum size of the logs.
  4. Increase the <maxFileNum> parameter to change the maximum number of logs.
  5. Restart the hostd management agent (mgmt-vmware) for the change to take effect. For more information, seeRestarting the Management agents on an ESX or ESXi Server (1003490).
For ESXi 5.0 the hostd logging can be increased from the vSphere Client:
  1. Connect the vSphere Client to the vCenter Server 5.0
  2. Select the ESXi 5.0 host > Configuration
  3. Under Software, select Advanced Settings
  4. In the Advanced Settings, select  Config HostAgent > log
  5. Update the config.HostAgent.log.level setting with preferable logging level.

vpxa

To increase the logging for vpxa:
  1. Log in to your ESX host as root from either an SSH session or directly from the console. For more details, see KBs listed in See Also section.
  2. Open the configuration file for vpxa in a text editor.
    Note: The configuration file for vpxa is found at /etc/vmware/vpxa.cfg. In ESX 3.5 and higher, the file is found at /etc/opt/vmware/vpxa/vpxa.cfg In ESXi 5.0, the vpxa.cfg is set to read-only.
    The file looks similar to:
    <config>
    :
    <log>
    :
    <maxFileNum>50</maxFileNum> -- Maximum number of log files
    <maxFileSize>5242880</maxFileSize> -- Maximum size of each log file, in bytes. By default, the maximum file size is 5243904 bytes.<level>verbose</level> -- Log Level (The default level is "verbose". To increase it, change it to "trivia".)
    </log>
    :
    </config> 


    NoteThe <directory> entry can be added under the <log> heading, and can be updated with a full path to a VMFS datastore, for example <directory>/vmfs/volumes/<datastore name>/<log directory></directory>. This may be useful on ESXi hosts where space is limited. 
  3. Increase the <maxFileSize> parameter to change the maximum size of the logs.
  4. Increase the <maxFileNum> parameter to change the maximum number of logs.
  5. Restart the vpxa management agent (vmware-vpxa) for the change to take effect. For more information, seeRestarting the Management agents on an ESX or ESXi Server (1003490).
 For ESXi 5.0 the vpxa logging can now be increased from the vSphere Client:
  1. Connect the vSphere Client to the vCenter Server 5.0
  2. Select the ESXi 5.0 host > Configuration
  3. Under Software, select Advanced Settings
  4. In Advanced Settings, select  Vpx Vpxa config log
  5. Update the Vpx.Vpxa.config.log.level setting with preferable logging level

 

vpxd (vCenter Server)


To increase the logging for vpxd, on the VMware vCenter Server, see Enabling trivia logging in VMware vCenter and VirtualCenter (1001584).
If the VMware vCenter Server does not start, you have to enable trivia logging manually.

To manually enable trivia logging:
  1. Log into the vCenter Server as an administrator.
  2. Open the configuration file for vpxd in a text editor.

    Note: The configuration file for vpxd is found at %ALLUSERSPROFILE%\Application Data\VMware\VMware VirtualCenter\vpxd.cfg . For Windows 2008, see Common vCenter Server and vSphere Client Windows paths (1028185).
    The file looks similar to:

    <
     config>
    :
    <log>
    <level>trivia</level> -- Log Level 
    (The default level is info. To increase it, change it to verbose or trivia.)
    <maxFileNum>50</maxFileNum> -- Number of log files, approx. 5MB each
    <maxFileSize>5242880</maxFileSize> -- Maximum size of each log file, in bytes. By default, the maximum file size is 5243904 bytes.<directory>C:\vpxlog\</directory> -- Logging path
    <name>vpxd</name> -- Prefix
    </log>
    :
    </config>
  3. Increase the <maxFileSize> parameter to change the maximum size of the logs.
  4. Increase the <maxFileNum> parameter to change the maximum number of logs.
  5. Restart the VMware VirtualCenter Server service for the change to take effect. For more information, see Stopping, starting, or restarting vCenter services (1003895).
Notes:
  • After editing the vpxd.cfg file, the characters <!-- and --> must to be removed for the changes inside <log>to take effect.
  • You can also the set command in the Windows command line to view a list of operating systems. For more information, see Common vCenter Server and vSphere Client Windows paths (1028185)
Note: The vCenter Logging level can also be increased using the vSphere Client.
  1. Connect the vSphere Client to the vCenter Server.
  2. Select Administration vCenter Server Settings > Logging options
  3. Select the preferable logging option from the drop down menu.

Source:-
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1004795