Translate

Total Pageviews

My YouTube Channel

Tuesday 8 July 2014

Increasing VMware vCenter Server and VMware ESX/ESXi logging levels (1004795)

Purpose

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. 

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.

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

Resolution

Caution: Enabling trivia or verbose logging for a longer duration might cause performance degradation on vCenter Server. Only enable trivia or verbose logging for troubleshooting purposes. VMware highly recommends reverting to default logging (info level) immediately after the troubleshooting is complete. VMware does not recommend enabling trivia/verbose logging in a production environment. Perform the steps in this article only after consulting VMware technical support.

Before you increase the size and number of logs:
Caution: VMware does not recommend decreasing the number or size of logs from the default settings.

This article contains three sections:

hostd

To increase logging for hostd:
  1. Log in to your host as root from either an SSH session or directly from the console. For more information, see Using Tech Support Mode in ESXi 4.1 and ESXi 5.x (1017910) or Enabling root SSH login on an ESX host (8375637).
  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 purposes, first change this line in the config.xmlfile (located at /etc/vmware/hostd/config.xml) to true.

    <!-- If true, log to files on disk -->
    <outputToFiles>false</outputToFiles>


    The file looks similar to:

    <config>
    :
    <log>
    <directory>/var/log/vmware/</directory>
    <level>verbose</level>
    <name>hostd</name>
    <outputToConsole>false</outputToConsole>
    <maxFileSize>5242880</maxFileSize>
    <maxFileNum>50</maxFileNum>
    </log>
    :
    </config>


    Description of each entry:

    • <directory>/var/log/vmware/</directory>

      Logging path

      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.
    • <level>verbose</level>

      Log Level. For ESXi/ESX 4.0 and later, the default log level is verbose. For ESXi/ESX 3.5 and earlier, the default level is info. Change it to the preferred logging level. For information on the different logging levels, see the Additional Information section.
    • <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
  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, see Restarting the Management agents on an ESXi or ESX host (1003490).
Note: In 5.x, hostd log output is set by default to output to syslog. In this case, the advanced settingsSyslog.loggers.hostd.rotate and Syslog.loggers.hostd.size take precedence over the settings on the/etc/vmware/hostd/config.xml file.
To change the settings:
  1. Connect to the ESXi host with the vSphere Client.
  2. Under the Configuration tab, in the Software section, click Advanced Settings
  3. Click Syslog to expand.
  4. Click loggers, to expand.
  5. Click hostd.
  6. Locate Syslog.loggers.hostd.rotate and Syslog.loggers.hostd.size.
  7. Use the text boxes to the right of the variable to adjust the setting.
Note: The default for 5.0.x is rotate 10 files with a size of 5120 KiB each, the default for 5.1.x and 5.5.x is rotate 10 files with a size of 10240 KiBeach. When making changes here do not need to restart hostd because values are dynamically set on the host.
For ESXi 5.x, you can increase hostd logging from the vSphere Client:
  1. Using the vSphere Client, connect to the vCenter Server.
  2. Click the ESXi 5.x host, then click Configuration.
  3. Under Software, click Advanced Settings.
  4. In the Advanced Settings, click Config > HostAgent > log.
  5. Update the config.HostAgent.log.level setting with the preferred logging level. For information on the different logging levels, see theAdditional Information section.

    Note: The default logging level for config.HostAgent.log.level is verbose.

vpxa

To increase logging for vpxa:
  1. Log in to your ESXi/ESX host as root from either an SSH session or directly from the console. For more information, see Using Tech Support Mode in ESXi 4.1 and ESXi 5.x (1017910) or Enabling root SSH login on an ESX host (8375637).
  2. Open the configuration file for vpxa in a text editor.

    Note: For ESX 3.5 through ESXi/ESX 4.1, the file is found at /etc/opt/vmware/vpxa/vpxa.cfg. For ESXi 5.x, the vpxa.cfg file is located at/etc/vmware/vpxa. In ESXi 5.0, the vpxa.cfg file is set to read-only.

    The file looks similar to:

    <config>
    :
    <log>
    :
    <maxFileNum>50</maxFileNum>
    <maxFileSize>5242880</maxFileSize>
    <level>verbose</level>
    </log>
    :
    </config>


    Description of each entry:

    • <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. Change it to the preferred logging level. For information on the different logging levels, see the Additional Information section.
    Note: The <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, see Restarting the Management agents on an ESXi or ESX host (1003490).
Note: In 5.x, vpxa log output is set by default to output to syslog. In that case, the advanced settings Syslog.loggers.vpxa.rotateand Syslog.loggers.vpxa.size take precedence over the settings on the vpxa.cfg file.
To change those settings:
  1. Connect to the ESXi host in question with the vSphere Client.
  2. Select the Configuration tab and click on Advanced Settings in the Software section.
  3. Expand Syslog then expand loggers, and then select vpxa.
  4. Locate Syslog.loggers.vpxa.rotate and Syslog.loggers.vpxa.size.
  5. Use the text boxes to the right of the variable to adjust the setting.
Note: The default for 5.0.x is rotate 10 files with a size of 5120 KiB each, the default for 5.1.x and 5.5.x is rotate 20 files with a size of 5120 KiBeach. When making changes here do not need to restart vpxa because values are dynamically set on the host.
For ESXi 5.x, you can increase vpxa logging from the vSphere Client:
  1. Using the vSphere Client, connect to the vCenter Server.
  2. Click the ESXi 5.x host, then click Configuration.
  3. Under Software, click Advanced Settings.
  4. In Advanced Settings, click Vpx > Vpxa > config > log.
  5. Update the Vpx.Vpxa.config.log.level setting with the preferred logging level. For information on the different logging levels, see theAdditional Information section.

vpxd

To increase logging for vpxd on the vCenter Server, see Enabling trivia logging in vCenter Server 4.0.x/4.1.x/5.0.x/5.1.x (1001584).

If the vCenter Server does not start, you must 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

    In the vCenter Server Appliance, the vpxd.cfg file is located at: /etc/vmware-vpx/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>
    <maxFileNum>50</maxFileNum>
    <maxFileSize>5242880</maxFileSize>
    <directory>C:\vpxlog\</directory>
    <name>vpxd</name>
    </log>
    :
    </config>


    Description of each entry:

    • <level>trivia</level>

      Log Level. The default level is info. Change it to the preferred logging level. For information on the different logging levels, see the Additional Information section.
    • <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.
    • <directory>C:\vpxlog\</directory>

      Logging path
    • <name>vpxd</name>

      Prefix
  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 use the set command on the Windows command line to view a list of operating systems. For more information, seeCommon vCenter Server and vSphere Client Windows paths (1028185).
The vCenter Server logging level can also be increased using the vSphere Client.

To change the logging level using the vSphere Client:
  1. Connect the vSphere Client to the vCenter Server.
  2. Click Administration > vCenter Server Settings > Logging options.
  3. Select the preferable logging option from the dropdown. For information on the different logging levels, see the Additional Informationsection.
Note: Changes done to the logging level via the vSphere Client or vSphere Web Client do not persist after a reboot and are overwritten by the default values in the vpxd.cfg file. To make permanent log level modifications, you must edit the vpxd.cfg file.

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

No comments:

Post a Comment