Image getting deleted when copied into the glance repository directory
Problem
When a user deletes any image from the GUI or uses the "OpenStack image delete" command and then copies the same image into the repository directory. It automatically gets deleted and not allowed to copy it again.
Environment
- Platform9 Managed OpenStack - v4.0 and Higher
Happens mostly with images with higher size.
Cause
When image delete call is made either from GUI or OpenStack command line, the image is first removed from glance and then from the actual hosts. This process takes time to get deleted it from the filesystem. At the same time if copy attempt is made to the repository directory (/var/opt/pf9/imagelibrary/data) , process will think it needs to be deleted and automatically delete it.
Resolution
Before attempting to copy image again, you should wait for at least the time interval mentioned in the "/etc/pf9/imagelibrary/imagelibrary.conf" on the node which configured to store images. On safer side please wait for thrice of interval time.