canonical / lxd

Powerful system container and virtual machine manager
https://canonical.com/lxd
GNU Affero General Public License v3.0
4.38k stars 929 forks source link

Network usage 0 on eth0 on v3.3 was fine on v3.1 #4851

Closed lcherone closed 6 years ago

lcherone commented 6 years ago

Required information

Issue description

Since updating from 3.1 to 3.3, can no longer see network usage (counters) on eth0, values are just 0.

Steps to reproduce

lxc info ct1

user@server:~$ lxc info ct1
Name: ct1
Remote: unix://
Architecture: x86_64
Created: 2018/07/23 17:35 UTC
Status: Running
Type: persistent
Profiles: default
Pid: 2992
Ips:
  eth0: inet    10.0.0.148  vethWQOR8X
  eth0: inet6   fe80::216:3eff:fe37:e6b vethWQOR8X
  lo:   inet    127.0.0.1
  lo:   inet6   ::1
Resources:
  Processes: 91
  CPU usage:
    CPU usage (in seconds): 16
  Memory usage:
    Memory (current): 507.60MB
    Memory (peak): 516.69MB
  Network usage:
    eth0:
      Bytes received: 0B
      Bytes sent: 0B
      Packets received: 0
      Packets sent: 0
    lo:
      Bytes received: 28.25kB
      Bytes sent: 28.25kB
      Packets received: 390
      Packets sent: 390

Same with lxc query output:

lxc query -X GET /1.0/containers/ct1/state

{
    "cpu": {
        "usage": 16660715393
    },
    "disk": {},
    "memory": {
        "swap_usage": 0,
        "swap_usage_peak": 0,
        "usage": 508026880,
        "usage_peak": 516694016
    },
    "network": {
        "eth0": {
            "addresses": [
                {
                    "address": "10.0.0.148",
                    "family": "inet",
                    "netmask": "24",
                    "scope": "global"
                },
                {
                    "address": "fe80::216:3eff:fe37:e6b",
                    "family": "inet6",
                    "netmask": "64",
                    "scope": "link"
                }
            ],
            "counters": {
                "bytes_received": 0,
                "bytes_sent": 0,
                "packets_received": 0,
                "packets_sent": 0
            },
            "host_name": "vethWQOR8X",
            "hwaddr": "00:16:3e:37:0e:6b",
            "mtu": 1500,
            "state": "up",
            "type": "broadcast"
        },
        "lo": {
            "addresses": [
                {
                    "address": "127.0.0.1",
                    "family": "inet",
                    "netmask": "8",
                    "scope": "local"
                },
                {
                    "address": "::1",
                    "family": "inet6",
                    "netmask": "128",
                    "scope": "local"
                }
            ],
            "counters": {
                "bytes_received": 28255,
                "bytes_sent": 28255,
                "packets_received": 390,
                "packets_sent": 390
            },
            "host_name": "",
            "hwaddr": "",
            "mtu": 65536,
            "state": "up",
            "type": "loopback"
        }
    },
    "pid": 2992,
    "processes": 91,
    "status": "Running",
    "status_code": 103
}
stgraber commented 6 years ago

Looking into that one now.

stgraber commented 6 years ago

tracked it down, going to figure out the best way to fix it