StepBee commented on issue #6717:
URL: https://github.com/apache/cloudstack/issues/6717#issuecomment-1884994736

   @DaanHoogland sure, this is the usage output of one day for usagetype 6 
(volumes) from a domain, using only 1 volume since a long time already:
   
   ```
   (cloudstack) 🐱 > list usagerecords 
domainid=16644085-7eff-46dd-8eb0-ef27b0b1621e type=6 startdate=2024-01-08 
enddate=2024-01-08
   {
     "count": 4,
     "usagerecord": [
       {
         "account": "XXX_Admins",
         "accountid": "72c17fd1-da79-46cf-a45d-d3ba1b5ad6d7",
         "description": "Volume usage for ROOT-26854 
(06ceea59-c8f8-4acd-902e-414d4bd60a5a) and template Ubuntu Server 22.04 LTS 
Cloud-Init (4e67bcd1-6ecf-4d0d-99ff-ee3775cfc6b6) and size 53687091200",
         "domain": "XXXXX",
         "domainid": "16644085-7eff-46dd-8eb0-ef27b0b1621e",
         "enddate": "2024-01-08'T'23:59:59+00:00",
         "rawusage": "24",
         "size": 53687091200,
         "startdate": "2024-01-08'T'00:00:00+00:00",
         "tags": [],
         "templateid": "4e67bcd1-6ecf-4d0d-99ff-ee3775cfc6b6",
         "usage": "24 Hrs",
         "usageid": "06ceea59-c8f8-4acd-902e-414d4bd60a5a",
         "usagetype": 6,
         "zoneid": "f2665eef-1073-4c50-8d3a-076d44036fcc"
       },
       {
         "account": "XXX_Admins",
         "accountid": "72c17fd1-da79-46cf-a45d-d3ba1b5ad6d7",
         "description": "Volume usage for ROOT-26840 
(f9f7daa6-3d98-496b-8fb2-698fae3b0c96) and template Ubuntu Server 22.04 LTS 
Cloud-Init (4e67bcd1-6ecf-4d0d-99ff-ee3775cfc6b6) and size 53687091200",
         "domain": "XXXXX",
         "domainid": "16644085-7eff-46dd-8eb0-ef27b0b1621e",
         "enddate": "2024-01-08'T'23:59:59+00:00",
         "rawusage": "24",
         "size": 53687091200,
         "startdate": "2024-01-08'T'00:00:00+00:00",
         "tags": [],
         "templateid": "4e67bcd1-6ecf-4d0d-99ff-ee3775cfc6b6",
         "usage": "24 Hrs",
         "usageid": "f9f7daa6-3d98-496b-8fb2-698fae3b0c96",
         "usagetype": 6,
         "zoneid": "f2665eef-1073-4c50-8d3a-076d44036fcc"
       },
       {
         "account": "XXX_Admins",
         "accountid": "72c17fd1-da79-46cf-a45d-d3ba1b5ad6d7",
         "description": "Volume usage for ROOT-26842 
(d8fb2834-f217-44dd-b5df-8a8573432668) and template Ubuntu Server 22.04 LTS 
Cloud-Init (4e67bcd1-6ecf-4d0d-99ff-ee3775cfc6b6) and size 53687091200",
         "domain": "XXXXX",
         "domainid": "16644085-7eff-46dd-8eb0-ef27b0b1621e",
         "enddate": "2024-01-08'T'23:59:59+00:00",
         "rawusage": "24",
         "size": 53687091200,
         "startdate": "2024-01-08'T'00:00:00+00:00",
         "tags": [],
         "templateid": "4e67bcd1-6ecf-4d0d-99ff-ee3775cfc6b6",
         "usage": "24 Hrs",
         "usageid": "d8fb2834-f217-44dd-b5df-8a8573432668",
         "usagetype": 6,
         "zoneid": "f2665eef-1073-4c50-8d3a-076d44036fcc"
       },
       {
         "account": "XXX_Admins",
         "accountid": "72c17fd1-da79-46cf-a45d-d3ba1b5ad6d7",
         "description": "Volume usage for ROOT-26856 
(14265d5a-d8fb-4136-af73-8ad0945a10a8) and template Ubuntu Server 22.04 LTS 
Cloud-Init (4e67bcd1-6ecf-4d0d-99ff-ee3775cfc6b6) and size 53687091200",
         "domain": "XXXXX",
         "domainid": "16644085-7eff-46dd-8eb0-ef27b0b1621e",
         "enddate": "2024-01-08'T'23:59:59+00:00",
         "rawusage": "24",
         "size": 53687091200,
         "startdate": "2024-01-08'T'00:00:00+00:00",
         "tags": [],
         "templateid": "4e67bcd1-6ecf-4d0d-99ff-ee3775cfc6b6",
         "usage": "24 Hrs",
         "usageid": "14265d5a-d8fb-4136-af73-8ad0945a10a8",
         "usagetype": 6,
         "zoneid": "f2665eef-1073-4c50-8d3a-076d44036fcc"
       }
     ]
   }
   ```
   
   In the usage output, usage for the following volumes are listed:
   Volume usage for ROOT-26854
   Volume usage for ROOT-26840
   Volume usage for ROOT-26842
   Volume usage for ROOT-26856
   
   The output of listing volumes from the same domain is listing only the last 
volume, ROOT-26856:
   ```
   (cloudstack) 🐱 > list volumes domainid=16644085-7eff-46dd-8eb0-ef27b0b1621e 
listall=true
   {
     "count": 1,
     "volume": [
       {
         "account": "XXX_Admins",
         "created": "2023-01-27T14:34:31+0000",
         "destroyed": false,
         "deviceid": 0,
         "diskioread": 17158,
         "diskiowrite": 4018086,
         "diskkbsread": 1198132,
         "diskkbswrite": 42926744,
         "displayvolume": true,
         "domain": "XXXXX",
         "domainid": "16644085-7eff-46dd-8eb0-ef27b0b1621e",
         "hasannotations": false,
         "hypervisor": "KVM",
         "id": "14265d5a-d8fb-4136-af73-8ad0945a10a8",
         "isextractable": false,
         "name": "ROOT-26856",
         "path": "14265d5a-d8fb-4136-af73-8ad0945a10a8",
         "physicalsize": 53687091200,
         "provisioningtype": "thin",
         "quiescevm": false,
         "serviceofferingdisplaytext": "Custom Instance",
         "serviceofferingid": "64",
         "serviceofferingname": "Custom",
         "size": 53687091200,
         "state": "Ready",
         "storage": "ceph-performance",
         "storageid": "d658f775-1c36-3f7f-afbe-c77991fec3f1",
         "storagetype": "shared",
         "supportsstoragesnapshot": false,
         "tags": [],
         "templatedisplaytext": "Ubuntu Server 22.04 LTS Cloud-Init",
         "templateid": "4e67bcd1-6ecf-4d0d-99ff-ee3775cfc6b6",
         "templatename": "Ubuntu Server 22.04 LTS Cloud-Init",
         "type": "ROOT",
         "utilization": "100.0%",
         "virtualmachineid": "df71e1fd-e5c3-41b3-992e-20b9c067a4cd",
         "virtualsize": 53687091200,
         "vmdisplayname": "XXXXXX",
         "vmname": "XXXXXX",
         "vmstate": "Running",
         "vmtype": "User",
         "zoneid": "f2665eef-1073-4c50-8d3a-076d44036fcc",
         "zonename": "Berlin-01"
       }
     ]
   }
   ```
   
   Looking at the database reveals the other three volumes, mentioned in the 
usage output, are already expunged since a very long time in the past and only 
one volume (the last one) is ready and should be part of the usage output:
   ```
   id   name            uuid                                    created         
updated         removed         state           size
   26888        ROOT-26840      f9f7daa6-3d98-496b-8fb2-698fae3b0c96    
27.01.23 13:06  27.01.23 13:09  27.01.23 13:09  Expunged        53687091200
   26890        ROOT-26842      d8fb2834-f217-44dd-b5df-8a8573432668    
27.01.23 13:12  27.01.23 14:27  27.01.23 14:27  Expunged        53687091200
   26902        ROOT-26854      06ceea59-c8f8-4acd-902e-414d4bd60a5a    
27.01.23 14:30  27.01.23 14:33  27.01.23 14:33  Expunged        53687091200
   26904        ROOT-26856      14265d5a-d8fb-4136-af73-8ad0945a10a8    
27.01.23 14:34  19.12.23 12:49  \N              Ready           53687091200
   ```
   
   This is from our production environment, i am going to check for 
reproducibility on our test environment.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to