Zun

Delete image residual data

Registered by weikeyou

Delete image residual data
the bp does the following works:
1、If the image driver is glance, the tar file will be residual data, current progress doesn't clean it.
   The "zun image-delete" should add the cleaning process.
2、The "zun image-delete" wouldn't delete the image in glance, because glance is similar to a repository for Zun。
   This progress should be optimized.
3、The problem is that the image DB has no host. When delete image, rpc will choose an arbitrary host that may not have the image.
   so, adding host for image DB is needed

Update information 2018.05.03:
When use“zun pull“ to pull image, the image is considered can be managed by zun and the image is recorded in DB image table. These image is allowed to be delete by client.
Those images that pulled when create container are considered can not be managed by zun, because they were not recorded in the DB image table. These images can be cleaned by period task.

Blueprint information

Status:
Complete
Approver:
hongbin
Priority:
Medium
Drafter:
weikeyou
Direction:
Approved
Assignee:
weikeyou
Definition:
New
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
hongbin
Completed by
hongbin

Related branches

Sprints

Whiteboard

(hongbin 2018-03-29): I believe Nova solved a similar problem by employing a backgroup task that run periodically to detect unused image and do the cleanup: https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L7666 . Could you give a comparison between the approach used by Nova and your proposed approach? What are the pros and cons of both approaches respectively?

(weikeyou 2018-03-29) I am sorry say that I was restricted to the URL(https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L7666) in my company. My idea is that when pull image from glance, the progress will generate a tar file in images_directory configured in zun.conf. If we use image-delete to delete the image from glance, the current progress wouldn't delete the tar file that leads to residue.

(hongbin 2018-03-29): I have talked to @weikeyou offline. We identified two options to implement this feature:
1. Leverage the 'DELETE /images' API to delete the residual docker image and its tar file. Cloud admins need to manually trigger this API to clean up the images.
2. Introduce a periodic task to delete the residual docker image and its tar file. This is an automated process. No action required from cloud admins.
@weikeyou will investigate the pros and cons of both options and make the final decision.

Addressed by: https://review.openstack.org/566083
    Delete image residual data

Gerrit topic: https://review.openstack.org/#q,topic:bp/delete-image-residual-data,n,z

Addressed by: https://review.openstack.org/569140
    Delete image residual data

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.