How to query Transfer Server Storage Monitoring through the Cloud Director API
search cancel

How to query Transfer Server Storage Monitoring through the Cloud Director API

book

Article ID: 381085

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

/opt/vmware/vcloud-director/bin/cell-management-tool manage-config -n MONITOR_TRANSFER_FOLDER_ENABLED -v true

  • How to monitor the transfer folder metrics with the Cloud Director API endpoint:

https://<VCD_URL>/metrics?filter=name==disk_free_percent;dirname==transfer

Environment

  • VMware Cloud Director 10.6.x
  • VMware Cloud Director 10.5.x

Resolution

To monitor the transfer folder metrics, use the following API endpoint:

GET https://<VCD_URL>/metrics?filter=name==disk_free_percent;dirname==transfer

No Accept header is required but a valid Authorization header is required.

Example steps would be as follows:

  1. Log into the Cloud Director API as a System Administrator to retrieve an Authorization token as per the KB here:

    How to establish an API connection VMware Cloud Director

  2. Construct the API call to query the transfer folder metrics:

    Request
    GET https://<VCD_URL>/metrics?filter=name==disk_free_percent;dirname==transfer

    Request Headers
    "Authorization: Bearer ####"

  3. Make the API request using an API client, for example with Curl:

    curl -k -X GET "https://<VCD_URL>/metrics?filter=name==disk_free_percent;dirname==transfer" -H "Authorization: Bearer ####"

  4. The expected response is 200 OK with a response body similar to the following format:

    # HELP disk_free_percent Usable space percentage for path
    # TYPE disk_free_percent gauge
    disk_free_percent{dirname="transfer",path="/opt/vmware/vcloud-director/data/transfer",vcloud_cell_ip_primary="#.#.#.#",vcloud_cell_uuid="########-####-####-####-############",} 99.0

    NOTE:
    The values for "vcloud_cell_ip_primary" and "vcloud_cell_uuid" will correspond to the specific Cloud Director Cell server that responded to the API call.
    Which cell that responds will depend on the configuration of the Cloud Director public address, for example if there is a load balancer in front of the Cloud Director Cells.
    The IP and UUID returned could change depending on where the load balancer routes the request, but this has no functional impact as all Cells share the same NFS server and will report the same value for "disk_free_percent".
    To receive a response from a particular Cloud Director Cell, send the request to that Cell's primary IP instead of the public address.

Additional Information