Flawed volume delete behavior in teardown script

Bug #1518492 reported by Sameer Adhikari
4
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
Low
Jean-Philippe Evrard
Liberty
Fix Released
Low
Jesse Pretorius
Trunk
Fix Released
Low
Jean-Philippe Evrard

Bug Description

Teardown script has a serious flaw in the task "Remove all logical volumes".
It ignore the scenario where the admin may have created another volume outside of AIO, and AIO deletes that too.
I stumbled on this because we create a snapshot volume that we use to revert the system back to know good state.
This step is easy to create.
1. Create a snapshot volume (for example, lvcreate --size 50G -s -n root_lv /dev/lxc/root)
2. Run lvs (you will see you root_lv volume)
3. Run AIO
4. From /opt/openstack-ansible run scripts/teardown.sh
5. Run lvs (You will see that root_lv has disappeared, and so has your ability to revert the system to an earlier know good image)

Why doesn't teardown only delete the volumes created to host the containers?

Revision history for this message
Byron McCollum (byron-mccollum) wrote :

I think the LXC volume group was intended for exclusive use by the LXC containers managed by OpenStack-Ansible. If you need a LV for other purposes, as you have suggested, create a separate VG.

Revision history for this message
Sameer Adhikari (tri2sing) wrote :

The suggestion to use a separate VG make sense.

As I look through the script, it seems that not only does it destroy all volumes on lxc, it also destroys all containers irrespective of whether they were created by AIO or by some other application.

Is it an acceptable solution to tweak the message to at least state that the expected behavior is to destroy all containers and volumes, even those created outside of AIO.

Changed in openstack-ansible:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible (master)

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

Changed in openstack-ansible:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible (master)

Reviewed: https://review.openstack.org/249325
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible/commit/?id=96b33d6d1c55e9d9bc723f415d1a3d8561823d13
Submitter: Jenkins
Branch: master

commit 96b33d6d1c55e9d9bc723f415d1a3d8561823d13
Author: Jean-Philippe Evrard <email address hidden>
Date: Tue Nov 24 17:57:27 2015 +0100

    Improve message of the teardown.sh

    Currently the teardown doesn't care about destroy other lxc
    containers and destroys everything.
    Same for logical volumes in the lxc volume group.

    This tweaks the message to make it more clear.

    Closes-Bug: #1518492

    Change-Id: If8bbd9c8b6cea4d18ad982ee676e0480a88a1a4e

Changed in openstack-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible (liberty)

Reviewed: https://review.openstack.org/250704
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible/commit/?id=6736537eb2974df1f3d55bed1e2389563ad7311c
Submitter: Jenkins
Branch: liberty

commit 6736537eb2974df1f3d55bed1e2389563ad7311c
Author: Jean-Philippe Evrard <email address hidden>
Date: Tue Nov 24 17:57:27 2015 +0100

    Improve message of the teardown.sh

    Currently the teardown doesn't care about destroy other lxc
    containers and destroys everything.
    Same for logical volumes in the lxc volume group.

    This tweaks the message to make it more clear.

    Closes-Bug: #1518492

    Change-Id: If8bbd9c8b6cea4d18ad982ee676e0480a88a1a4e
    (cherry picked from commit 96b33d6d1c55e9d9bc723f415d1a3d8561823d13)

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/openstack-ansible 12.0.8

This issue was fixed in the openstack/openstack-ansible 12.0.8 release.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/openstack-ansible 12.0.9

This issue was fixed in the openstack/openstack-ansible 12.0.9 release.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/openstack-ansible 13.0.0

This issue was fixed in the openstack/openstack-ansible 13.0.0 release.

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

This issue was fixed in the openstack/openstack-ansible 13.0.0 release.

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/openstack-ansible 12.0.11

This issue was fixed in the openstack/openstack-ansible 12.0.11 release.

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.