How to collect logs in NSX for vSphere 6.x Guest Introspection
search cancel

How to collect logs in NSX for vSphere 6.x Guest Introspection

book

Article ID: 342489

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

This article provides information on how to collect GI-SVM logs through an API call. There is no User Interface (UI) component exposed to collect the VMware NSX for vSphere 6.x Guest Introspection Service Virtual Machine logs.

Environment

VMware NSX for vSphere 6.3.x
VMware NSX for vSphere 6.1.x
VMware NSX for vSphere 6.2.x
VMware NSX for vSphere 6.0.x

Resolution

To collect GI-SVM logs through an API call:

  1. Determine the Host MOID:
    1. Open a web browser and browse to https://<vcenter>/mob/.
    2. Log in to vCenter Server with admin credentials.
    3. Click group-d1.
    4. Click datacenter-## in childEntity for the datacenter where the ESXi host resides.
    5. Click group-h## in hostFolder.
    6. Click domain-c## in childEntity for the cluster where the ESXi host resides.

      All host MOIDs are listed in the Host section.

      Alternatively, you can run these commands in the NSX Manager to find the Host MOID:

      For example:

      > show cluster all

      No. Cluster Name Cluster Id Datacenter Name Firewall Status
      1 RegionA01-COMP01 domain-c26 RegionA01 Enabled
      2 RegionA01-MGMT01 domain-c71 RegionA01 Enabled

      > show cluster domain-c26

      Datacenter: RegionA01
      Cluster: RegionA01-COMP01
      No. Host Name Host Id Installation Status
      1 xxxx.xxxx host-29 Ready
      2 xxxx.xxxx host-31 Ready


      Note that, Host ID = MOID.
       
  2. To determine the current logging state, run API call:

    GET https://<nsx mgr>/api/1.0/usvmlogging/host-##/com.vmware.vshield.usvm
    GET https://<nsx mgr>/api/1.0/usvmlogging/host-##/root


  3. To change the current logging state, run API call:

    POST https://<nsx mgr>/api/1.0/usvmlogging/host-##/changelevel

    ## Example to change root logger ##

    <?xml version="1.0" encoding="UTF-8" ?>
    <logginglevel>
    <loggerName>root</loggerName>
    <level>DEBUG</level>
    </logginglevel>


    ## Example to change com.vmware.vshield.usvm ##

    <?xml version="1.0" encoding="UTF-8" ?>
    <logginglevel>
    <loggerName>com.vmware.vshield.usvm</loggerName>
    <level>DEBUG</level>
    </logginglevel>

  4. To generate logs, run this command:

    curl -k -u admin:<password> -L -X GET https://<nsx mgr>/api/1.0/hosts/host-##/techsupportlogs > techsupportlogs.log.gz

    Notes:

    • This command generates the GI-SVM logs and saves the file as techsupportlogs.log.gz file.
    • As an alternative, you can use Postman REST API client as the curl API call requires root access privileges to the NSX Manager.
       
      1. Run API call:

        GET https://<nsx mgr>/api/1.0/hosts/host-###/techsupportlogs
         
      2. Select Send and Download.