A Docker app is not displayed correctly
search cancel

A Docker app is not displayed correctly

book

Article ID: 297553

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

Symptoms:
When pushing a Docker app with default 1GB disk quota, it could fail with error "disk limit is smaller than volume size" as shown below.
[root@mdw ~]# CF_DOCKER_PASSWORD=xxxx cf push img1 --docker-username tom  --docker-image tom/tom-repo:img1 tom -t 600
   2018-06-25T23:29:06.20-0400 [CELL/0] OUT Cell 21c1ae94-0f86-4dc5-83ec-7b76dd2dba58 creating container for instance da9af175-a04a-4079-49f7-89d5
   2018-06-25T23:29:07.88-0400 [CELL/0] ERR Cell 21c1ae94-0f86-4dc5-83ec-7b76dd2dba58 failed to create container for instance da9af175-a04a-4079-49f7-89d5: running image plugin create: making image: creating image: applying disk limits: disk limit is smaller than volume size
   2018-06-25T23:29:07.88-0400 [CELL/0] ERR : exit status 1
   2018-06-25T23:29:07.88-0400 [CELL/0] OUT Cell 21c1ae94-0f86-4dc5-83ec-7b76dd2dba58 destroying container for instance da9af175-a04a-4079-49f7-89d5
   2018-06-25T23:29:07.88-0400 [CELL/0] OUT Cell 21c1ae94-0f86-4dc5-83ec-7b76dd2dba58 successfully destroyed container for instance da9af175-a04a-4079-49f7-89d5
   2018-06-25T23:29:07.90-0400 [API/0] OUT Process has crashed with type: "web"
   2018-06-25T23:29:07.90-0400 [API/0] OUT App instance exited with guid 6b783e7e-4a21-4d52-8a6b-a99b7147ed22 payload: {"instance"=>"da9af175-a04a-4079-49f7-89d5", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"failed to initialize container: running image plugin create: making image: creating image: applying disk limits: disk limit is smaller than volume size\n: exit status 1", "crash_count"=>3, "crash_timestamp"=>1529983747883330324, "version"=>"a6bc244b-30cb-49f5-8f22-0778392d1b73"}
It seems the application requires more than 1GB disk space. After pushing same application with 2G disk quota it can complete with no problem. However it only shows a small disk usage. It only shows 52K in this example and is less than 1G where "cf push" fails for the application.
 
[root@mdw ~]# CF_DOCKER_PASSWORD=xxxx cf push img1 --docker-username tom  --docker-image tom/tom-repo:img1 tom -t 600 -k 2G
Using docker repository password from environment variable CF_DOCKER_PASSWORD.
Pushing app img1 to org org1 / space dev as admin...
Getting app info...
Updating app with these attributes...
  name:                   img1
  docker image:           tom/tom-repo:img1
  docker username:        tom
  command:                /docker-entrypoint.sh httpd -k start -D FOREGROUND
- disk quota:             1G
+ disk quota:             2G

......

docker image:      tom/tom-repo:img1
start command:     /docker-entrypoint.sh httpd -k start -D FOREGROUND

     state     since                  cpu    memory      disk        details
#0   running   2018-06-26T03:48:35Z   0.0%   25M of 1G   52K of 2G

Environment


Cause

There are two metrics regarding the container's disk stats, total_bytes_used and the exclusive_bytes_usedexclusive_bytes_used is the disk usage which does not include the RootFS image layers, while total_bytes_used includes those layers.

Prior to Diego 2.4.0 exclusive_bytes_used is returned to Cloud Controller, therefore CF CLI gets same metric. That's why disk usage of the Docker application is not shown correctly.

Resolution

The bug has been fixed since Diego 2.4.0 and will be shipped in PAS 2.2 (contains Diego 2.8.0).
Pivotal Cloud Foundry Engineering is also working on backport of the fix to PAS 1.12, 2.0, and 2.1.