[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Best way to delete images (local and in registry)





Am 2016-04-21 um 20:24 schrieb Andy Goldstein:


On Thu, Apr 21, 2016 at 2:22 PM, v <vekt0r7 gmx net> wrote:
Am 2016-04-21 um 13:49 schrieb Andy Goldstein:


On Thursday, April 21, 2016, v <vekt0r7 gmx net> wrote:


Am 2016-04-21 um 09:44 schrieb aleks:
Hi Lorenz

Am 21-04-2016 09:01, schrieb Lorenz Vanthillo:
Thanks Aleks,

Is this deleting images on your nodes or also on your
openshift-registry?

As far as I have seen only in the registy not on the nodes.
That's the reason why we afterwards execute a

ansible -m shell -a 'docker rmi $(docker images -q)' all

And for example:

oadm prune images --keep-younger-than=60m

Will this only delete images images older than 60m which aren't used?
Or wil this also delete images which are used (maybe only on the node
but not out of the registry?)
Unfortunately this will not delete any images at all, it will only delete the references to those images. You will not get any disk space back with this.

This is incorrect. oadm prune images does free up disk space in the registry pod's storage. 
Hello,

this is interesting. We've tried executing
oadm prune builds --confirm and then
oadm prune deployments --confirm and then
oadm prune images --confirm
and it never freed up a meaningful amount of disk space. We tried it with Origin 1.0.6 and just recently with Origin 1.1.4 (our registry is currently 50 GiB in size).

Does that mean that we have encountered a bug?

We will need more information to determine if there's a bug or not. Could you please provide:
  • The command(s) you ran, and output, showing the registry's size before pruning
  • the output from running 'oadm prune images' (including the exact command line you ran)
  • The command(s) and output showing the registry's size after pruning
Dear Mr. Goldstein,

thank you very much for taking interest in our issues with Origin 1.1.4. Here comes the output you requested:

root master01 ~ # du -s /data/registry/docker/registry/v2/
61184824        /data/registry/docker/registry/v2/

root master01 ~ # oadm prune images --confirm
Deleting references from image streams to images ...
STREAM                                  IMAGE                                                                     TAGS
test/booking   sha256:f98a1b3e04483ce2aef8db3fe60f96cff332b5e248f4392f1f8f77683a0bfa72   latest
test/booking   sha256:b2ecf6a32a95921b8789eaf8e6f9ecd5141cf06d3bea0a1b4c803180aae90eee   latest
prod/coder                 sha256:e87719b4bf9a8d92e96f78fc60f2cb3ce7040ef1a1ed8ae649faeee414520505   latest
test/booking   sha256:b025722494ca4ef05e74734d647795dcefe94f4b29476c0d882b4488d212fb6d   latest
test/booking   sha256:b7e2daa5732f2ac9da160a32ec4865434986628d352345fc3f492ed4c2554065   latest
test/booking   sha256:2c792289c69dfae91f068bac14a8b3fec10128e3cfcfb0b6037357908458de34   latest
test/booking   sha256:ac06de98d7cb3f16ad7c92cb25aeff0a2a759cfd06d307629bf6ba1a87a0c446   latest
test/booking   sha256:e214b820f295b35f4da2e67e3f94328c5a18d94b55f9b97823a08d3777cc4bf8   latest
prod/booking   sha256:60faf646109cf90ec8d5eb071c5a066346eb3b5291a79772b776c8cb36e6f3f3   latest
test/booking   sha256:616d6ca9965a181da31d4ae5a639a795292e0cefb25eb8aede65ce561745660c   latest
prod/offer         sha256:74daebd81689786cbccf98f1ee1f97641f3321da8c7f8dbeaf673500aa8df0a8   latest
test/booking   sha256:0561a33c88e786b1740ac36cf8a6fb41a22a0b76de5e4efbc4af8b22ef61f19a   latest
prod/gate                sha256:39783ed3166c9db846be6f5ce88af3d81bfbc38db5550407281eea0d609327a2   latest

Deleting registry layer blobs ...
BLOB
sha256:a844c88431c581881114773680304d177d7b8fa983bfc4299b0b5b15ad68b71b
sha256:449fff85ad5bc6c5f9b3b6dbb0965db3e02b7fc4ba998cbed78a351120c3f68e
sha256:26429e2d9c67622ec7e86cb02b70d6ba54012d942f8479d5c80e0602ab605eb1
sha256:96f46a6fac98e5cba293ab788795b12e0c7abb8a7eda0834cb5b2d78620a96e6
###
### *snip* I cut out 70 lines
###

Deleting registry repository manifest data ...
REPO                                    IMAGE
test/booking   sha256:f98a1b3e04483ce2aef8db3fe60f96cff332b5e248f4392f1f8f77683a0bfa72
test/booking   sha256:b2ecf6a32a95921b8789eaf8e6f9ecd5141cf06d3bea0a1b4c803180aae90eee
prod/geocoder                 sha256:e87719b4bf9a8d92e96f78fc60f2cb3ce7040ef1a1ed8ae649faeee414520505
test/booking   sha256:b025722494ca4ef05e74734d647795dcefe94f4b29476c0d882b4488d212fb6d
test/booking   sha256:b7e2daa5732f2ac9da160a32ec4865434986628d352345fc3f492ed4c2554065
test/booking   sha256:2c792289c69dfae91f068bac14a8b3fec10128e3cfcfb0b6037357908458de34
test/booking   sha256:ac06de98d7cb3f16ad7c92cb25aeff0a2a759cfd06d307629bf6ba1a87a0c446
test/booking   sha256:e214b820f295b35f4da2e67e3f94328c5a18d94b55f9b97823a08d3777cc4bf8
prod/booking   sha256:60faf646109cf90ec8d5eb071c5a066346eb3b5291a79772b776c8cb36e6f3f3
test/booking   sha256:616d6ca9965a181da31d4ae5a639a795292e0cefb25eb8aede65ce561745660c
prod/offer         sha256:74daebd81689786cbccf98f1ee1f97641f3321da8c7f8dbeaf673500aa8df0a8
test/booking   sha256:0561a33c88e786b1740ac36cf8a6fb41a22a0b76de5e4efbc4af8b22ef61f19a
prod/offergate                sha256:39783ed3166c9db846be6f5ce88af3d81bfbc38db5550407281eea0d609327a2

Deleting images from server ...
IMAGE
sha256:fe601337970c8f2c753a31d96832bf88f0a1e1782a4235df07d1b63036e40a2e
sha256:56ede46935d31bca6553edc43edb73f93583b782eed4cc03a46390d9105461c3
###
### *snip* I cut out 400 lines
###

root master01 ~ # du -s /data/registry/docker/registry/v2/
61184564        /data/registry/docker/registry/v2/

As you can see the difference in size before/after the pruning is less than 300 Bytes. We were hoping that our upgrade from 1.0.6 to 1.1.4 would fix this problem but unfortunately the issue still remains. I'd be glad to provide you with more details or debug information at your request.

Regards,
v

 




 

As for your second question:
If a pod, RC or DC is using the image it will not get deleted, you can read the docs for more details:
https://docs.openshift.com/enterprise/3.1/admin_guide/pruning_resources.html#pruning-images



Well due to the fact hat I'm not using such option you can try it by your own as long as you don't add ' --confirm ' to the command

Best Regards
Aleks

PS: Please keep the list on cc thanks
To: lorenz vanthillo outlook com
Subject: Re: Best way to delete images (local and in registry)
Date: Thu, 21 Apr 2016 08:42:50 +0200
From: al-openshiftusers none at
CC: users lists openshift redhat com

Hi Lorenz.

Am 20-04-2016 14:33, schrieb Lorenz Vanthillo:
> I'm searching for the best way to delete unused docker images in my
> cluster.
> Because we're rebuilding images + pushing them to the registry.
>
> When we perform
> docker images -q |xargs do


oadm prune images --keep-younger-than=60m

Will this only delete images images older than 60m which aren't used?
Or wil this also delete images which are used (maybe only on the node
but not out of the registry?)

Well due to the fact hat I'm not using such option you can try it by your own as long as you don't add ' --confirm ' to the command

Best Regards cker rmi
>
> We get:
> REPOSITORY TAG IMAGE ID CREATED
> VIRTUAL SIZE
> <none> <none> 0fd6f6a7d8


oadm prune images --keep-younger-than=60m

Will this only delete images images older than 60m which aren't used?
Or wil this also delete images which are used (maybe only on the node
but not out of the registry?)

Well due to the fact hat I'm not using such option you can try it by your own as long as you don't add ' --confirm ' to the command

Best Regards fb 6 days ago
> 660.1 MB
> <none> <none> cdcb32f9b621 2 weeks ago
> 743.2 MB
> <none> <none> 9df362e36242 2 weeks ago
> 794 MB
> <none> <none> 67de4dbed60e 2 weeks ago
> 704 MB
> <none> <none> 999e0047a070 2 weeks ago
> 543.6 MB
>
> But oc get images gave us:

[snipp]

> Is this fine?
>
> And what's the best way to delete old images out of the registry?

Do you have tried this way?


https://docs.openshift.com/enterprise/3.1/admin_guide/pruning_resources.html#pruning-images

After wards we have run

docker rmi $(docker images -q)

on every node.

I'm not sure if the last step is still necessary in the current
version.

Best Regards
Aleks

_______________________________________________
users mailing list
users lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users

_______________________________________________
users mailing list
users lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users




_______________________________________________
users mailing list
users lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]