Remove IBP target images after env removal

Bug #1454781 reported by Sergii Golovatiuk
44
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Released
High
Alexander Gordeev
6.0.x
Invalid
Medium
Vladimir Kozhukalov
6.1.x
Won't Fix
Medium
Vladimir Kozhukalov
7.0.x
Fix Released
High
Alexander Gordeev

Bug Description

How to reproduce:
1. Create environment
2. Provision using IBP
3. Delete environment

expected:
no IBP files for that env at /var/www/nailgun/targetimages
(upd: yaml file is expected.) ~mstrukov

actual:
[root@nailgun targetimages]# ls -1 /var/www/nailgun/targetimages/env_1*
/var/www/nailgun/targetimages/env_1_ubuntu_1404_amd64-boot.img.gz
/var/www/nailgun/targetimages/env_1_ubuntu_1404_amd64.img.gz
/var/www/nailgun/targetimages/env_1_ubuntu_1404_amd64.yaml

Environment:
{
    "api": "1.0",
    "astute_sha": "d9d488c4c675e6dd33eb68b33a79abe591b4c26f",
    "auth_required": true,
    "build_id": "2015-05-12_17-03-01",
    "build_number": "408",
    "feature_groups": [
        "mirantis"
    ],
    "fuel-library_sha": "156fb11bbf3e12e7c73a9a3ac785c9d33d4ac343",
    "fuel-ostf_sha": "21afa436e725be1debadf1c207018753b537c7b3",
    "fuelmain_sha": "51b86bb24b27742a22b23e2ae3dfc850c47e5fbf",
    "nailgun_sha": "042ed77ffdff22a5242ac7f8a6980836d0a5ef1a",
    "openstack_version": "2014.2.2-6.1",
    "production": "docker",
    "python-fuelclient_sha": "af6c9c3799b9ec107bcdc6dbf035cafc034526ce",
    "release": "6.1",
    "release_versions": {
        "2014.2.2-6.1": {
            "VERSION": {
                "api": "1.0",
                "astute_sha": "d9d488c4c675e6dd33eb68b33a79abe591b4c26f",
                "build_id": "2015-05-12_17-03-01",
                "build_number": "408",
                "feature_groups": [
                    "mirantis"
                ],
                "fuel-library_sha": "156fb11bbf3e12e7c73a9a3ac785c9d33d4ac343",
                "fuel-ostf_sha": "21afa436e725be1debadf1c207018753b537c7b3",
                "fuelmain_sha": "51b86bb24b27742a22b23e2ae3dfc850c47e5fbf",
                "nailgun_sha": "042ed77ffdff22a5242ac7f8a6980836d0a5ef1a",
                "openstack_version": "2014.2.2-6.1",
                "production": "docker",
                "python-fuelclient_sha": "af6c9c3799b9ec107bcdc6dbf035cafc034526ce",
                "release": "6.1"
            }
        }
    }
}

Changed in fuel:
milestone: none → 7.0
importance: Undecided → Medium
assignee: nobody → Vladimir Kozhukalov (kozhukalov)
summary: - IBP files are left after environment removal
+ Remove IBP target images after env removal
tags: added: feature-image-based
Revision history for this message
Alexander Gordeev (a-gordeev) wrote :

Invalid for 6.0
Raising to high for 7.0

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (master)

Fix proposed to branch: master
Review: https://review.openstack.org/211566

Changed in fuel:
status: Confirmed → In Progress
Changed in fuel:
status: Confirmed → In Progress
tags: added: life-cycle-management
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (master)

Reviewed: https://review.openstack.org/211566
Committed: https://git.openstack.org/cgit/stackforge/fuel-web/commit/?id=0457984b5e14d66afd1eed6ef641e1750ca2750c
Submitter: Jenkins
Branch: master

commit 0457984b5e14d66afd1eed6ef641e1750ca2750c
Author: Alexander Gordeev <email address hidden>
Date: Tue Aug 11 16:03:24 2015 +0300

    Remove target images after env removal

    Target images should be removed if env removal occurs.

    Implemented by conditional execution of DeleteIBPImagesTask
    after DeletionTask.
    DeleteIBPImagesTask will be skipped if cluster doesn't use IBP
    or opetating system is not Ubuntu.

    Change-Id: I79ec69696311a33924a6271bca6dcb3295373a62
    Closes-Bug: #1454781

Changed in fuel:
status: In Progress → Fix Committed
Maksym Strukov (unbelll)
tags: added: on-verification
Revision history for this message
Maksym Strukov (unbelll) wrote :

Actual:
One file not removed.

'''
[root@nailgun ~]# ls -hal /var/www/nailgun/targetimages/env_1*
-rw-r--r-- 1 root root 2,4K вер 3 19:39 /var/www/nailgun/targetimages/env_1_ubuntu_1404_amd64.yaml
'''

{"build_id": "265", "build_number": "265", "release_versions": {"2015.1.0-7.0": {"VERSION": {"build_id": "265", "build_number": "265", "api": "1.0", "fuel-library_sha": "4fdf3d6b070204366593012428395d173698678a", "nailgun_sha": "0dfcf73deb8ae99654f3da2ea95b7b68b9ee7273", "feature_groups": ["mirantis"], "fuel-nailgun-agent_sha": "d7027952870a35db8dc52f185bb1158cdd3d1ebd", "openstack_version": "2015.1.0-7.0", "fuel-agent_sha": "082a47bf014002e515001be05f99040437281a2d", "production": "docker", "python-fuelclient_sha": "9643fa07f1290071511066804f962f62fe27b512", "astute_sha": "e63709d16bd4c1949bef820ac336c9393c040d25", "fuel-ostf_sha": "582a81ccaa1e439a3aec4b8b8f6994735de840f4", "release": "7.0", "fuelmain_sha": "9ab01caf960013dc882825dc9b0e11ccf0b81cb0"}}}, "auth_required": true, "api": "1.0", "fuel-library_sha": "4fdf3d6b070204366593012428395d173698678a", "nailgun_sha": "0dfcf73deb8ae99654f3da2ea95b7b68b9ee7273", "feature_groups": ["mirantis", "experimental"], "fuel-nailgun-agent_sha": "d7027952870a35db8dc52f185bb1158cdd3d1ebd", "openstack_version": "2015.1.0-7.0", "fuel-agent_sha": "082a47bf014002e515001be05f99040437281a2d", "production": "docker", "python-fuelclient_sha": "9643fa07f1290071511066804f962f62fe27b512", "astute_sha": "e63709d16bd4c1949bef820ac336c9393c040d25", "fuel-ostf_sha": "582a81ccaa1e439a3aec4b8b8f6994735de840f4", "release": "7.0", "fuelmain_sha": "9ab01caf960013dc882825dc9b0e11ccf0b81cb0"}

tags: removed: on-verification
Revision history for this message
Alexander Gordeev (a-gordeev) wrote :

Actual issue was about wasting disk space by IBP target images from removed environment.

Average target images disk space consumption is expected to be slightly less than 1G per environment.

non removed yaml file is just a couple of Kbytes.

I could partially agree that it was not fixed properly, however i don't think that it's still high. The root cause is that nailgun doesn't use this yaml file as a source of all information about the images, it uses image data from release section of fixtures. But fuel-agent during the image build couldn't update fixtures with metadata about the images at nailgun side and in addition fuel-agent requires input data about the images to be built. So, what we get here is definitely the chicken and the egg problem.

Leaving this yaml file as is is completely safe as fuel-agent will recreate yaml file only during image building stage. Even if you drop nailgun db and start to deploy environments and under certain circumstances your env ID will interfere with the one which's already existing in yaml files, fuel-agent will silently rewrite it.

I'll file a separate bug about yaml removal targeted to 8.0 with meduim or even low priority.

This bug should be closed as it actually fixes the problem.

Revision history for this message
Maksym Strukov (unbelll) wrote :

Verified as fixed in 7.0-265

{"build_id": "265", "build_number": "265", "release_versions": {"2015.1.0-7.0": {"VERSION": {"build_id": "265", "build_number": "265", "api": "1.0", "fuel-library_sha": "4fdf3d6b070204366593012428395d173698678a", "nailgun_sha": "0dfcf73deb8ae99654f3da2ea95b7b68b9ee7273", "feature_groups": ["mirantis"], "fuel-nailgun-agent_sha": "d7027952870a35db8dc52f185bb1158cdd3d1ebd", "openstack_version": "2015.1.0-7.0", "fuel-agent_sha": "082a47bf014002e515001be05f99040437281a2d", "production": "docker", "python-fuelclient_sha": "9643fa07f1290071511066804f962f62fe27b512", "astute_sha": "e63709d16bd4c1949bef820ac336c9393c040d25", "fuel-ostf_sha": "582a81ccaa1e439a3aec4b8b8f6994735de840f4", "release": "7.0", "fuelmain_sha": "9ab01caf960013dc882825dc9b0e11ccf0b81cb0"}}}, "auth_required": true, "api": "1.0", "fuel-library_sha": "4fdf3d6b070204366593012428395d173698678a", "nailgun_sha": "0dfcf73deb8ae99654f3da2ea95b7b68b9ee7273", "feature_groups": ["mirantis", "experimental"], "fuel-nailgun-agent_sha": "d7027952870a35db8dc52f185bb1158cdd3d1ebd", "openstack_version": "2015.1.0-7.0", "fuel-agent_sha": "082a47bf014002e515001be05f99040437281a2d", "production": "docker", "python-fuelclient_sha": "9643fa07f1290071511066804f962f62fe27b512", "astute_sha": "e63709d16bd4c1949bef820ac336c9393c040d25", "fuel-ostf_sha": "582a81ccaa1e439a3aec4b8b8f6994735de840f4", "release": "7.0", "fuelmain_sha": "9ab01caf960013dc882825dc9b0e11ccf0b81cb0"}

description: updated
Revision history for this message
Dmitry Pyzhov (dpyzhov) wrote :
Revision history for this message
Vitaly Sedelnik (vsedelnik) wrote :

Won't Fix for 6.1-updates because of Medium importance

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.