Skip to content

Instance network metrics calculation with API #9967

Closed

Description

@meisammaleki
ISSUE TYPE
  • Other
COMPONENT NAME

CLOUDSTACK VERSION 4.17.2

CONFIGURATION
OS / ENVIRONMENT
SUMMARY

I need to calculate the amount of downloaded and uploaded traffic on each instance for accounting purpose
For example if Download value for an instance reach 20 GB in a week (Download a 1GB file for 20 times)

STEPS TO REPRODUCE

EXPECTED RESULTS

I have downloaded this file with "wget" which it is approximately 2 GB with an instance and I except that the API show me a same value but was not same acctually. here is the like for download file

https://github.com/szalony9szymek/large/releases/download/free/large

this is returned values form api :
"networkread": "41.20 MiB",
"networkwrite": "0.91 MiB",


ACTUAL RESULTS

Activity

  1. DaanHoogland commented on Nov 25, 2024

    @DaanHoogland
    Contributor

    @meisammaleki can you try your scenario with a newer version?

  2. meisammaleki commented on Nov 25, 2024

    @meisammaleki
    Author

    The only way for check newer version is to use ACS simulator which I'm not sure about its functionality, also I cannot upgrade the current environment to newer one

  3. DaanHoogland commented on Nov 27, 2024

    @DaanHoogland
    Contributor

    no @meisammaleki , in a simulator this functionality can not be verified.

    The only way for check newer version is to use ACS simulator which I'm not sure about its functionality, also I cannot upgrade the current environment to newer one

    I'll try and find the time to verify it in a newer version.

  4. added this to the 4.19.2 milestone on Nov 28, 2024
  5. modified the milestones: 4.19.2, 4.19.3 on Feb 13, 2025
  6. modified the milestones: 4.19.3, 4.19.4 on Jun 5, 2025
  7. weizhouapache commented on Jul 16, 2025

    @weizhouapache
    Member

    What type of zone and network ?

    ACS can collect traffic for

    • isolated network and vpc. No traffic collection for individual vm
    • vm on shared netwoek
  8. 4 remaining items

  9. added theissue type on Jan 6, 2026
  10. Pearl1594 commented on Jan 13, 2026

    @Pearl1594
    Contributor

    @meisammaleki Could you also please let us know which API are you referring to where you see the discrepancy? If you are referring to the listVirtualMachineMetrics API response, please pass the accumulate parameter and set it to true, to see the correct value. When you call the API without accumulate=true, the networkread value (e.g., "41.20 MiB") represents only the inbound traffic in the last 60 seconds - essentially the current download rate, not the cumulative total. This is why it appears much lower than expected. To see the correct total inbound traffic that your VM has received, you must add accumulate=true to your API call: cloudmonkey list virtualmachinemetrics id= accumulate=true. This will return the sum of all network traffic across the stats retention period.

  11. modified the milestones: 4.20.3, 4.20.4 on Feb 16, 2026
  12. modified the milestones: 4.20.4, unplanned on Mar 2, 2026
  13. DaanHoogland commented on Mar 2, 2026

    @DaanHoogland
    Contributor

    this sounds like a functional discussion...

  14. pinned this issue on Mar 2, 2026
  15. unpinned this issue on Mar 2, 2026
  16. locked and limited conversation to collaborators on Mar 2, 2026
  17. converted this issue into a discussion #12727 on Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions