Bug 1777173

Summary: CPU Accounting is not enabled by default
Product: OpenShift Container Platform Reporter: Guanghui <guachen>
Component: NodeAssignee: Ryan Phillips <rphillips>
Status: CLOSED NOTABUG QA Contact: Sunil Choudhary <schoudha>
Severity: high Docs Contact:
Priority: high    
Version: 3.11.0CC: aos-bugs, decarr, guachen, jokerman, malonso, mmccomas, rphillips, schoudha, sjenning
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1692131 Environment:
Last Closed: 2019-12-02 17:18:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1692131    
Bug Blocks:    

Description Guanghui 2019-11-27 03:53:52 UTC
Description of problem:

atomic-openshift-node.service logs show the following message:
~~~
Failed to get system container stats for "/system.slice/atomic-openshift-node.service": failed to get cgroup stats for "/system.slice/atomic-openshift-node.service": failed to get container info for "/system.slice/atomic-openshift-node.service": unknown container "/system.slice/atomic-openshift-node.service"
container_manager_linux.go:793] CPUAccounting not enabled for pid: xxxx
container_manager_linux.go:796] MemoryAccounting not enabled for pid: xxxx
~~~

Version-Release number of selected component (if applicable):
~~~
oc v3.11.154
kubernetes v1.11.0+d4cacc0
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://lb.guachen.ocp:443
openshift v3.11.154
kubernetes v1.11.0+d4cacc0
~~~

How reproducible:
Always

Steps to Reproduce:
1. install cluster
2. ssh to node
3. journalctl -u atomic-openshift-node.service 

Actual results:
CPU/Memory Accounting is not enabled by default

Expected results:
CPU/Memory Accounting is enabled by default

Additional info:
~~~
# cat /etc/systemd/system.conf.d/origin-accounting.conf 
[Manager]
DefaultCPUAccounting=yes
DefaultMemoryAccounting=yes
DefaultBlockIOAccounting=yes

# systemctl show docker|grep Account
CPUAccounting=no
BlockIOAccounting=no
MemoryAccounting=no
TasksAccounting=no
~~~
CPU/Memory Accounting should be enabled by default.

Comment 1 Ryan Phillips 2019-12-02 14:59:29 UTC
Did you restart docker, and then restart Kubelet? Both restarts are necessary to enable accounting.

Comment 2 Guanghui 2019-12-02 15:14:10 UTC
Yes, I tried both restart docker and atom-openshift-node, but it didn't work.

I found that the system had to be rebooted to take effect.

Comment 3 Ryan Phillips 2019-12-02 15:57:50 UTC
For systemd to detect the new configuration file the following command will pick that up: `systemctl daemon-reexec`.