Bug 1281325 - Used memory converting from Byte to Mi/Gi for a longer time
Used memory converting from Byte to Mi/Gi for a longer time
Status: ON_DEV
Product: OpenShift Origin
Classification: Red Hat
Component: Storage (Show other bugs)
3.x
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Derek Carr
Qixuan Wang
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-12 05:10 EST by Qixuan Wang
Modified: 2016-02-03 09:51 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Qixuan Wang 2015-11-12 05:10:35 EST
Description of problem:
Given a pod spec with request/limit quota set(for example, Memory: 256Mi). Create the pod, the used Memory is calculated and showed in bytes, and converted to Mi/Gi after several minutes. It's not a big deal but a bit long. 

Version-Release number of selected component (if applicable):
openshift v3.1.0.4-3-ga6353c7
kubernetes v1.1.0-origin-1107-g4c8e6f4
etcd 2.1.2

How reproducible:
Always

Steps to Reproduce:

1. Apply hard quata to the namespace
$ vi myquota.yaml

apiVersion: v1
kind: ResourceQuota
metadata:
  name: myquota
spec:
  hard:
    cpu: "30"
    memory: 16Gi
    persistentvolumeclaims: "20"
    pods: "20"
    replicationcontrollers: "30"
    resourcequotas: "1"
    secrets: "15"
    services: "10"

# oc create -f myquota.yaml -n qwang1 --config=./admin.kubeconfig

2. Check quota to the namespace
# oc describe quota myquota
 
3. Set Requests and Limits to a pod/container and create it
# vi pod-request-limit-valid-4.yaml

apiVersion: v1
kind: Pod
metadata:
  name: pod-request-limit-valid-4
  labels:
    name: pod-request-limit-valid-4
spec:
  containers:
  - name: pod-request-limit-valid-4
    image: openshift/mysql-55-centos7:latest
    env:
    - name: MYSQL_USER
      value: userSUM
      name: MYSQL_PASSWORD
      value: P5J6s8wf
      name: MYSQL_DATABASE
      value: root
      name: MYSQL_ROOT_PASSWORD
      value: W5J6s8wf
    resources:
      limits:
        cpu: "100m"
        memory: "256Mi"
      requests:
        cpu: "100m"
        memory: "256Mi"

#oc create -f pod-request-limit-valid-4.yaml 
 
4. Check quota to the namespace again
# describe quota myquota


Actual results:
4. Used memory shows in Byte for a longer time
[root@dhcp-136-118 testv3]# oc describe quota myquota
Name:			myquota
Namespace:		qwang1
Resource		Used		Hard
--------		----		----
cpu			100m		30
memory			268435456	16Gi
persistentvolumeclaims	0		20
pods			1		20
replicationcontrollers	0		30
resourcequotas		1		1
secrets			9		15
services		0		10

Expected results:
4. [root@dhcp-136-118 testv3]# oc describe quota myquota
Name:			myquota
Namespace:		qwang1
Resource		Used	Hard
--------		----	----
cpu			100m	30
memory			256Mi	16Gi
persistentvolumeclaims	0	20
pods			1	20
replicationcontrollers	0	30
resourcequotas		1	1
secrets			9	15
services		0	10

Additional info:
Comment 1 Derek Carr 2016-02-03 09:51:07 EST
The issue is that the format is changing from BinarySI to DecimalSI when doing addition on the server for resource quantities.

I have a fix to preserve the format in this PR that is pending upstream in Kubernetes:

https://github.com/kubernetes/kubernetes/pull/20505

Note You need to log in before you can comment on or make changes to this bug.