[IBP] idempotency in cloud-init boothooks broken

Bug #1420396 reported by Alexander Gordeev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Released
Critical
Alexander Gordeev
5.1.x
Invalid
Undecided
Unassigned
6.0.x
Fix Released
Critical
Alexander Gordeev

Bug Description

Boothooks should be rewritten to handle pipes correctly.

Bad example:
cloud-init-per instance conntrack_max echo "net.nf_conntrack_max=1048576" | tee /etc/sysctl.conf

it will clean /etc/sysctl.conf on every next boot.

should be converted to something like

cloud-init-per instance conntrack_max /bin/sh -c 'echo "net.nf_conntrack_max=1048576" | tee /etc/sysctl.conf'

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/154949

Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (stable/6.0)

Fix proposed to branch: stable/6.0
Review: https://review.openstack.org/155771

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

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

commit ff902e172024d8003844b47ad78453f629f2fba3
Author: Alexander Gordeev <email address hidden>
Date: Wed Feb 11 16:59:06 2015 +0300

    [IBP] Fix idempotency issues in cloud-init boothooks

    script named 'cloud-init-per' is written in bash and can't work with
    pipes correctly. So, long command lines with pipes should be
    converted to a single command, eg:

    /bin/sh -c 'echo command | tee /etc/file'

    Without that, all those incorrectly handled commands will empty files
    on the every next boot after the first boot.

    Change-Id: Ib49a21cde42264320ada882c9e06a4a0e09badfa
    Closes-Bug: #1420396

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (stable/6.0)

Reviewed: https://review.openstack.org/155771
Committed: https://git.openstack.org/cgit/stackforge/fuel-web/commit/?id=9521325eb04679ef2ec386d054099c77b4ca0953
Submitter: Jenkins
Branch: stable/6.0

commit 9521325eb04679ef2ec386d054099c77b4ca0953
Author: Alexander Gordeev <email address hidden>
Date: Wed Feb 11 16:59:06 2015 +0300

    [IBP] Fix idempotency issues in cloud-init boothooks

    script named 'cloud-init-per' is written in bash and can't work with
    pipes correctly. So, long command lines with pipes should be
    converted to a single command, eg:

    /bin/sh -c 'echo command | tee /etc/file'

    Without that, all those incorrectly handled commands will empty files
    on the every next boot after the first boot.

    Change-Id: Ib49a21cde42264320ada882c9e06a4a0e09badfa
    Closes-Bug: #1420396

Revision history for this message
Ryan Moe (rmoe) wrote :

Invalid for 5.1.1-updates as IBP is not in 5.1

Revision history for this message
Anastasia Palkina (apalkina) wrote :

Verified on ISO #210 for CentOS and Ubuntu

"build_id": "2015-03-19_22-54-44", "ostf_sha": "b9a090c71682fbea5d9351051827d7d654d07be3", "build_number": "210", "release_versions": {"2014.2-6.1": {"VERSION": {"build_id": "2015-03-19_22-54-44", "ostf_sha": "b9a090c71682fbea5d9351051827d7d654d07be3", "build_number": "210", "api": "1.0", "nailgun_sha": "1d2bd383caecc5ec3f86bf93ccca940326f23e97", "production": "docker", "python-fuelclient_sha": "b223dcaf5fdad2f714cd245958fefe03995d6207", "astute_sha": "4a117a1ca6bdcc34fe4d086959ace1a6d18eeca9", "feature_groups": ["mirantis"], "release": "6.1", "fuelmain_sha": "f3d6353c08d8eb709c7ab100b56dc2bebef4157f", "fuellib_sha": "7764225db5bc653563309912afbb4058283c808b"}}}, "auth_required": true, "api": "1.0", "nailgun_sha": "1d2bd383caecc5ec3f86bf93ccca940326f23e97", "production": "docker", "python-fuelclient_sha": "b223dcaf5fdad2f714cd245958fefe03995d6207", "astute_sha": "4a117a1ca6bdcc34fe4d086959ace1a6d18eeca9", "feature_groups": ["mirantis"], "release": "6.1", "fuelmain_sha": "f3d6353c08d8eb709c7ab100b56dc2bebef4157f", "fuellib_sha": "7764225db5bc653563309912afbb4058283c808b"

Changed in fuel:
status: Fix Committed → Fix Released
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.