Org Quota Usage appears incorrect for a space in Apps Manager
search cancel

Org Quota Usage appears incorrect for a space in Apps Manager

book

Article ID: 298457

calendar_today

Updated On: 08-06-2024

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

This article provides awareness of what is using org memory and disk resources in VMware Tanzu Application Service for VMs (TAS). This article also provides methods and tools to locate the spaces and applications to which these processes and tasks belong.

The Apps Manager Org Quota Usage for a space appears to be incorrect.

For example, let's assume that you have an org with a memory quota of 380 GB and 15 applications running at 1 GB of memory each in a space. You might expect to see 15 GB / 380 GB (4%) on the org quota page for the space in question. However, you may see something like 205 GB / 380 GB (54%). This can happen when applications have multiple processes or tasks associated with them. It's difficult to see the resource usage from the Apps Manager UI org and space summary screens.

Environment

Product Version: Other

Resolution

To resolve this issue, use one of the following options:
 

  • Manually look through the applications within each space and find the ones that have tasks associated with them. The problem with this approach is that the UI doesn't show the memory and disk usage for tasks.
  • Use the following CAPI reporting tool: https://github.com/dbmathis/cf-hunter (it was created to uncover what is using the resources).
  • Use the following command to get a list of running task and memory used by each one:
​​cf curl "/v3/tasks?states=RUNNING&organization_guids=<org_guid>&space_guids=<space_guid>" 


E.g:

cf curl "/v3/tasks?states=RUNNING&organization_guids=cc4d8f3d-####-####-####-a968354dbc60&space_guids=92667838-####-####-####-f165ad1cf7ae"


You can get the guid's with cf org <org> --guid and cf space <space> --guid. If you use the CAPI reporting (hunter) tool, you will receive an output similar to the following:

MacBook-Pro-3 cf-hunter$ ./cf-hunter.sh -o dmathis
Hierarchy                                                    Disk         Memory
================================================================================
Org: dmathis                                              9216 MB        4539 MB
================================================================================
     Space: redis                                         5120 MB        1152 MB
--------------------------------------------------------------------------------
          App: cf-nodejs                                  1024 MB         128 MB
--------------------------------------------------------------------------------
               Process: web                               1024 MB         128 MB
--------------------------------------------------------------------------------
          App: test-app                                   1024 MB         256 MB
--------------------------------------------------------------------------------
               Process: web                               1024 MB         256 MB
--------------------------------------------------------------------------------
          App: redis-example-app                          3072 MB         768 MB
--------------------------------------------------------------------------------
               Task: 4f35e4df                             1024 MB         256 MB
               Task: 9355a23c                             1024 MB         256 MB
               Process: web                               1024 MB         256 MB
================================================================================
     Space: outerspace                                    4096 MB        3387 MB
--------------------------------------------------------------------------------
          App: redis-example-app-2                        4096 MB        3387 MB
--------------------------------------------------------------------------------
               Task: 56554a31                             1024 MB         150 MB
               Task: dcc22b5d                             1024 MB         150 MB
               Task: 70184abc                             1024 MB          15 MB
               Process: web                               1024 MB        3072 MB
================================================================================
     Space: myspace                                          0 MB           0 MB

If you sue the cf curl, you will receive an output similar to the following:
cf curl "/v3/tasks?states=RUNNING&organization_guids=cc4d8f3d-####-####-####-a968354dbc60&space_guids=92667838-####-####-####-f165ad1cf7ae"
{
   "pagination": {
      "total_results": 1,
      "total_pages": 1,
      "first": {
         "href": "https://api.run-35.slot-##.###.#####.com/v3/tasks?organization_guids=cc4d8f3d-e3d7-####-9e3c-a968354dbc60&page=1&per_page=50&space_guids=92667838-####-####-####-f165ad1cf7ae&states=RUNNING"
      },
      "last": {
         "href": "https://api.run-35.slot-##.###.#####.com/v3/tasks?organization_guids=cc4d8f3d-e3d7-####-9e3c-a968354dbc60&page=1&per_page=50&space_guids=92667838-####-####-####-f165ad1cf7ae&states=RUNNING"
      },
      "next": null,
      "previous": null
   },
   "resources": [
      {
         "guid": "ab445be7-fba3-####-####-ae9d5a936247",
         "sequence_id": 5,
         "name": "my-task2",
         "state": "RUNNING",
         "memory_in_mb": 1024,
         "disk_in_mb": 1024,
         "result": {
            "failure_reason": null
         },
         "created_at": "2021-02-02T11:19:20Z",
         "updated_at": "2021-02-02T11:19:20Z",
         "droplet_guid": "eabf2116-####-####-98c8-bdb76bb12b11",
         "relationships": {
            "app": {
               "data": {
                  "guid": "984d8bac-####-####-931d-e33f94f560fb"
               }
            }
         },
         "metadata": {
            "labels": {},
            "annotations": {}
         },
         "links": {
            "self": {
               "href": "https://api.run-35.slot-##.###.####.com/v3/tasks/ab445be7-fba3-####-a877-ae9d5a936247"
            },
            "app": {
               "href": "https://api.run-35.slot-##.###.####.com/v3/apps/984d8bac-####-4713-931d-e33f94f560fb"
            },
            "cancel": {
               "href": "https://api.run-35.slot-##.###.####.com/v3/tasks/ab445be7-fba3-####-a877-ae9d5a936247/actions/cancel",
               "method": "POST"
            },
            "droplet": {
               "href": "https://api.run-35.slot-##.###.####.com/v3/droplets/eabf2116-4aa0-####-98c8-bdb76bb12b11"
            }
         }
      }
   ]
}