VM Monitoring Information missing in `onevm list`

Hello Community,

Following my LXCoNe quest I have hit another ‘wall’. The monitoring information pertaining to VMs doesn’t show up in onevm list output.

The VMs have the information available in their template and /var/log/one/oned.log shows that VMs are successfully monitored.

~# onevm list
    ID USER     GROUP    NAME            STAT UCPU    UMEM HOST             TIME
    37 oneadmin oneadmin djx             runn    0      0K yoda        13d 18h47
    38 oneadmin oneadmin djn             runn    0      0K yoda        10d 03h25


~# onevm show 38
VIRTUAL MACHINE 38 INFORMATION
ID                  : 38
NAME                : djn
USER                : oneadmin
GROUP               : oneadmin
STATE               : ACTIVE
LCM_STATE           : RUNNING
RESCHED             : No
HOST                : yoda
CLUSTER ID          : -1
CLUSTER             : default
START TIME          : 12/04 08:57:20
END TIME            : -
DEPLOY ID           : /dev/loop3

VIRTUAL MACHINE MONITORING
NETTX               : 197K
NETRX               : 197K
USEDCPU             : 0.0
USEDMEMORY          : 9226.24

PERMISSIONS
OWNER               : um-
GROUP               : ---
OTHER               : ---
...
...

 ~# date
 Mon Dec 14 12:24:26 UTC 2015


~# cat /var/log/one/oned.log | grep "VM 38"
Mon Dec 14 12:21:48 2015 [Z0][VMM][D]: VM 38 successfully monitored: STATE=a USEDMEMORY=9328.64 USEDCPU=2.0 NETTX=193455 NETRX=193455
Mon Dec 14 12:23:02 2015 [Z0][VMM][D]: VM 38 successfully monitored: STATE=a USEDMEMORY=9226.24 USEDCPU=0.0 NETTX=201988 NETRX=201988
Mon Dec 14 12:24:15 2015 [Z0][VMM][D]: VM 38 successfully monitored: STATE=a USEDMEMORY=9226.24 USEDCPU=0.0 NETTX=211740 NETRX=211740

Running the monitoring scripts by hand also works, as expected.

~# /var/tmp/one/im/lxc.d/poll.sh
VM_POLL=YES
VM=[
 ID=37,
 DEPLOY_ID=one-37,
 POLL="STATE=a USEDMEMORY=10076.16 USEDCPU=0.0 NETTX=279276 NETRX=279276" ]
VM=[
 ID=38,
 DEPLOY_ID=one-38,
 POLL="STATE=a USEDMEMORY=9236.48 USEDCPU=0.0 NETTX=232463 NETRX=232463" ]
VM=[
 ID=42,
 DEPLOY_ID=one-42,
 POLL="STATE=d" ]
VM=[
 ID=43,
 DEPLOY_ID=one-43,
 POLL="STATE=d" ]

Can anyone shed some light on this matter? Thanks.

Hi valentin_bud,

I think the variable names that are reported by vmm/lxc/poll are wrong. Could you try the attached patch?

0001-fix-memory-and-stats-reporting.patch (932 Bytes)

cd /var/lib/one/remotes
patch -p1 < /path/to/the/patch/file

Or just edit /var/lib/one/remotes/vmm/lxc/poll and replace:

           POLL="$POLL USEDMEMORY=${USEDMEMORY}"

with

          POLL="$POLL MEMORY=${USEDMEMORY}"

and for CPU stats:

          POLL="$POLL USEDCPU=${USEDCPU}"

with

         POLL="$POLL CPU=${USEDCPU}"

Do not forget to propagate the changes to the hosts:

su - oneadmin
onehost sync --force

This should fix the issue.

Kind Regards
Anton Todorov

Hello Anton,

Thank you very much for your input. Indeed it works after applying your patch and synchronising the
remotes.

~# onevm list
    ID USER     GROUP    NAME            STAT UCPU    UMEM HOST             TIME
    37 oneadmin oneadmin djx             runn  0.0    7.4M yoda        13d 20h10
    38 oneadmin oneadmin djn             runn  0.0  200.7M yoda        10d 04h48

Best wishes,
Valentin

Hi Valentin,

Thank you for the feedback. I’ve created a pull request for upstream merge.

Cheers
Anton Todorov

Hi! Thanks for the report.

About the bug… Following the Poll Information section inside the Virtualization section from OpenNebula Integration Guide we noticed that used memory and cpu information should be given as USEDMEMORY and USEDCPU respectively. Seems like the right way of giving this information is the way that atodorov_storpool shows (thanks for the tip, by the way). We have created a pull request for upstream merge in the OpenNebula

Best