Jump to content
  • [7.0.0-beta.2] Negative memory value shown in VM usage


    thecode
    • Minor

    image.png.1e54f2c1d86a9dce5b3ebc891501de6a.png

     

    image.thumb.png.02270621486db917a597b999d4eff169.png

     

    1. A negative value is displayed in the used memory for the Home Assistant VM

    2. Minor display issue, the "MB/s" from the first VM box doesn't have any space from the "Disk" on the second VM box

    sam-diagnostics-20240718-0113.zip




    User Feedback

    Recommended Comments

    Thanks for the report, would you be able to create the script and run, then send me the result?

     

    i.e. nano /tmp/vmstats paste code below. Save

    chmod +x /tmp/vmstats

    /tmp/vmstats

     

    #!/usr/bin/php
    <?php
    $docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
    require_once "$docroot/webGui/include/Helpers.php";
    require_once "$docroot/webGui/include/Custom.php";
    require_once "$docroot/plugins/dynamix.vm.manager/include/libvirt_helpers.php";
    require_once "/usr/local/emhttp/plugins/dynamix.vm.manager/include/libvirt.php";
    $allstats=$lv->domain_get_all_domain_stats();
    var_dump($allstats);
    ?>

    You should get a list for your VMs similar to this.

     

      ["Linux777"]=>
      array(15) {
        ["state.state"]=>
        int(5)
        ["state.reason"]=>
        int(0)
        ["cpu.time"]=>
        string(12) "401050000000"
        ["cpu.user"]=>
        string(12) "131810000000"
        ["cpu.system"]=>
        string(12) "269240000000"
        ["balloon.current"]=>
        string(10) "1145569280"
        ["balloon.maximum"]=>
        string(10) "1145569280"
        ["vcpu.current"]=>
        int(1)
        ["vcpu.maximum"]=>
        int(1)
        ["block.count"]=>
        int(1)
        ["block.0.name"]=>
        string(3) "hdc"
        ["block.0.path"]=>
        string(37) "/mnt/user/domains/Linux777/vdisk1.img"
        ["block.0.allocation"]=>
        string(7) "1057792"
        ["block.0.capacity"]=>
        string(7) "1048576"
        ["block.0.physical"]=>
        string(7) "1048576"
      }
    }

    Link to comment
    6 hours ago, thecode said:

    I attached the result as a file since it is a little bit long.

    Thanks for looking into it.

    vmstats.txt

    Thanks will look into it. For the HA I dont know why Unused is so high. Current calculation is current - unused hence the negative.

        ["balloon.current"]=>
        string(7) "3145728"
        ["balloon.maximum"]=>
        string(7) "4194304"
        ["balloon.swap_in"]=>
        string(1) "0"
        ["balloon.swap_out"]=>
        string(1) "0"
        ["balloon.major_fault"]=>
        string(2) "97"
        ["balloon.minor_fault"]=>
        string(5) "25461"
        ["balloon.unused"]=>
        string(7) "3898308"
        ["balloon.available"]=>
        string(7) "4009840"
        ["balloon.usable"]=>
        string(7) "3886724"

     

    Is your memory in the VM initial and max different? Could you include your xml for HA.

    • Like 1
    Link to comment
    1 hour ago, SimonF said:

    Is your memory in the VM initial and max different? Could you include your xml for HA.

    Yes they are different

    image.png.71e2210d59b835972cdc3f41cb890dee.png

    xml attached

    HA.xml

    Link to comment
    2 hours ago, thecode said:

    Yes they are different

    image.png.71e2210d59b835972cdc3f41cb890dee.png

    xml attached

    HA.xml

    Would you be able to change this line.

     

    https://github.com/unraid/webgui/blob/84b5baf402202a0c90368d5118c389b973542ba4/emhttp/plugins/dynamix.vm.manager/include/libvirt_helpers.php#L2663

     

    to replace current with maximum to see if that fixes the - issue? 

            $currentmem = $data["balloon.maximum"];

     

    I may add detail of inuse/current/max as there may be a difference if using ballooning.

    Link to comment
    25 minutes ago, SimonF said:

    Would you be able to change this line.

    to replace current with maximum to see if that fixes the - issue? 

            $currentmem = $data["balloon.maximum"];

     

    After the change the VM maximum size is correct but I think the used memory is incorrect:

    image.png.2aafe2ca13e0a1e6359c0262c8e315ed.png

    This is the memory use report from the VM:

    image.png.6ef5644f6c48f2baaeb971db12f527a7.png

    Which makes sense according to services it is running.

    vmstats1

    Link to comment
    1 minute ago, thecode said:

     

    After the change the VM maximum size is correct but I think the used memory is incorrect:

    image.png.2aafe2ca13e0a1e6359c0262c8e315ed.png

    This is the memory use report from the VM:

    image.png.6ef5644f6c48f2baaeb971db12f527a7.png

    Which makes sense according to services it is running.

    vmstats1

    This is my system, added inuse/cur/max also added spaceing.

     

    image.png

     

    Will need to check when different values are in the return data. This is for my HA curently

      ["balloon.current"]=>
      string(7) "4194304"
      ["balloon.maximum"]=>
      string(7) "4194304"
      ["balloon.last-update"]=>
      string(1) "0"
      ["balloon.rss"]=>
      string(7) "1800796"

    • Like 1
    Link to comment
    44 minutes ago, SimonF said:

    Does virsh dommemstat HA

     

    Report the same values

    image.png.bd3306f7d0e250655d3f8ff26cbc8ff1.pngimage.png.49b358271ee3584e65d1b97b7464ac0e.png

     

     

    Link to comment
    38 minutes ago, thecode said:

    image.png.bd3306f7d0e250655d3f8ff26cbc8ff1.pngimage.png.49b358271ee3584e65d1b97b7464ac0e.png

     

     

    Thats for you help the rss is the actual mem in use.

    Link to comment

    Thanks for the quick fix, values are now correct:

    image.png.82f6556dca228ac2bf37b520620b7274.png

     

    Is it possible to increase the space between two stats boxes?

    Link to comment
    2 hours ago, thecode said:

    Thanks for the quick fix, values are now correct:

    image.png.82f6556dca228ac2bf37b520620b7274.png

     

    Is it possible to increase the space between two stats boxes?

    I have put spaces in which seem to work on my system. I have also made it only show two values if max and current are equal

     

    what font size do you have set?Tried different font size, add some HTML spaces.

    Link to comment


    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.
    Note: Your post will require moderator approval before it will be visible.

    Guest
    Add a comment...

    ×   Pasted as rich text.   Restore formatting

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


  • Status Definitions

     

    Open = Under consideration.

     

    Solved = The issue has been resolved.

     

    Solved version = The issue has been resolved in the indicated release version.

     

    Closed = Feedback or opinion better posted on our forum for discussion. Also for reports we cannot reproduce or need more information. In this case just add a comment and we will review it again.

     

    Retest = Please retest in latest release.


    Priority Definitions

     

    Minor = Something not working correctly.

     

    Urgent = Server crash, data loss, or other showstopper.

     

    Annoyance = Doesn't affect functionality but should be fixed.

     

    Other = Announcement or other non-issue.

×
×
  • Create New...