[octane] Disk and volume metdata preparation is non-idempotent

Bug #1578639 reported by Oleg S. Gelbukh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
Low
Oleg S. Gelbukh
7.0.x
Fix Committed
Low
Oleg S. Gelbukh
8.0.x
Fix Committed
Low
Oleg S. Gelbukh
Newton
Fix Committed
Low
Oleg S. Gelbukh

Bug Description

Detailed bug description:

While upgrading OpenStack environment, fuel-octane script works around incompatibilities between 'cobbler' and 'image' provisioning methods by updating node's volume metadata and creating additional partitions on the node.

This operations are implemented in a way that is not idempotent, which means it fails if run against the same node for the second and subsequent times for some reason.

Steps to reproduce:
1. Install Fuel Master node version 6.0
2. Install OpenStack environment version 6.0
3. Upgrade Fuel Master node to version 8.0 (6.0 -> 6.1 -> 7.0 via tarballs, 7.0 -> 8.0 via backup/reinstall/restore)
4. Upgrade OpenStack environment to version 8.0 with fuel-octane
5. Run 'octane upgrade-node' command on any node that requires partition preservation (e.g. compute node without live migration enabled)

Expected results:
 Node upgraded

Actual results:

2016-05-05 12:05:15 ERROR octane.util.subprocess python[12759] stderr: Traceback (most recent call last):
2016-05-05 12:05:15 ERROR octane.util.subprocess python[12759] stderr: File "/tmp/update_node_partition_info.py", line 27, in <module>
2016-05-05 12:05:15 ERROR octane.util.subprocess python[12759] stderr: os_vg = next(disk for disk in volumes if 'id' in disk and disk['id'] == 'os')
2016-05-05 12:05:15 ERROR octane.util.subprocess python[12759] stderr: StopIteration

Reproducibility:

Always

Workaround:

Wrap the failing iterator in try/except conditional.

Impact:

Low, as repeated runs of the script upon single node are unlikely and generally not recommended.

Description of the environment:

N/A

Additional information:

N/A

Changed in fuel:
status: New → Confirmed
importance: Undecided → Low
milestone: none → 9.0-updates
no longer affects: fuel/mitaka
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-octane (master)

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

Changed in fuel:
assignee: nobody → Oleg S. Gelbukh (gelbuhos)
status: Confirmed → In Progress
Revision history for this message
Oleg S. Gelbukh (gelbuhos) wrote :

The proper solution for this bug will require to check an actual partitions layout on the node and compare it to the expected metadata. This shall be implemented later on.

tags: added: feature-upgrade
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-octane (master)

Reviewed: https://review.openstack.org/312945
Committed: https://git.openstack.org/cgit/openstack/fuel-octane/commit/?id=685241e4b7ea8b0b9150b505d435c497722680f5
Submitter: Jenkins
Branch: master

commit 685241e4b7ea8b0b9150b505d435c497722680f5
Author: Oleg Gelbukh <email address hidden>
Date: Thu May 5 13:13:51 2016 +0000

    Stop update of volume metadata gracefully if 'os' volume is not on LVM

    To upgrade an OpenStack cluster node with preserved partitions and data
    from version 6.0 to version 8.0, changes in disk metadata required. These
    changes accommodate the metadata to change of provisioning method from
    'cobbler' to 'image'.

    To avoid failure if the metadata was already altered by the previous
    execution of upgrade-node command, the script update_node_partition_data.py
    should stop gracefully if no relevant partitions were found.

    Change-Id: I7a110423312d1cd4d5101e7ce048847092d8578f
    Closes-bug: 1578639

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

Fix proposed to branch: stable/7.0
Review: https://review.openstack.org/316071

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-octane (stable/8.0)

Reviewed: https://review.openstack.org/316070
Committed: https://git.openstack.org/cgit/openstack/fuel-octane/commit/?id=b1ca1e699fdff41af6688aaebebdf84b7af78854
Submitter: Jenkins
Branch: stable/8.0

commit b1ca1e699fdff41af6688aaebebdf84b7af78854
Author: Oleg Gelbukh <email address hidden>
Date: Thu May 5 13:13:51 2016 +0000

    Stop update of volume metadata gracefully if 'os' volume is not on LVM

    To upgrade an OpenStack cluster node with preserved partitions and data
    from version 6.0 to version 8.0, changes in disk metadata required. These
    changes accommodate the metadata to change of provisioning method from
    'cobbler' to 'image'.

    To avoid failure if the metadata was already altered by the previous
    execution of upgrade-node command, the script update_node_partition_data.py
    should stop gracefully if no relevant partitions were found.

    Change-Id: I7a110423312d1cd4d5101e7ce048847092d8578f
    Closes-bug: 1578639
    (cherry picked from commit 685241e4b7ea8b0b9150b505d435c497722680f5)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-octane (stable/7.0)

Reviewed: https://review.openstack.org/316071
Committed: https://git.openstack.org/cgit/openstack/fuel-octane/commit/?id=25fbbe0fa081d2fe08c6c9101a90602d9a14c0d4
Submitter: Jenkins
Branch: stable/7.0

commit 25fbbe0fa081d2fe08c6c9101a90602d9a14c0d4
Author: Oleg Gelbukh <email address hidden>
Date: Thu May 5 13:13:51 2016 +0000

    Stop update of volume metadata gracefully if 'os' volume is not on LVM

    To upgrade an OpenStack cluster node with preserved partitions and data
    from version 6.0 to version 8.0, changes in disk metadata required. These
    changes accommodate the metadata to change of provisioning method from
    'cobbler' to 'image'.

    To avoid failure if the metadata was already altered by the previous
    execution of upgrade-node command, the script update_node_partition_data.py
    should stop gracefully if no relevant partitions were found.

    Change-Id: I7a110423312d1cd4d5101e7ce048847092d8578f
    Closes-bug: 1578639
    (cherry picked from commit 685241e4b7ea8b0b9150b505d435c497722680f5)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-octane (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/332931

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-octane (stable/mitaka)
Download full text (40.5 KiB)

Reviewed: https://review.openstack.org/332931
Committed: https://git.openstack.org/cgit/openstack/fuel-octane/commit/?id=24f3c396612eb0c69fbf06bab3cebbb9ca829426
Submitter: Jenkins
Branch: stable/mitaka

commit b34d749f1c281dafbdbf155bd86830dc8f2a9aa2
Author: Ilya Kharin <email address hidden>
Date: Wed Jun 22 21:10:56 2016 +0300

    Support mock==1.8.0 in unit tests

    Use assert_called_once_with instead of assert_called_once that was
    introduced in 2.0.0.

    Change-Id: Ifb7699d4b552d148984961727355f0e23b487c7c

commit d60f1905143bb7576ffd670595de1c4aeafd7b34
Author: Ilya Kharin <email address hidden>
Date: Wed Jun 22 02:01:52 2016 +0300

    Allow to authorize by the predefined admin_token

    The admin_token_auth middleware is added to keystone pipelines to
    allow authorization by admin_token.

    Change-Id: Ic03150305a669fad1446436a68051fb9aa25b892

commit cc7fab59f44ffef60285f8732d798f52469b2530
Author: Ilya Kharin <email address hidden>
Date: Wed Jun 22 01:47:01 2016 +0300

    Reset default_domain_id before the keystone task

    The default_domain_id should be removed from keystone.conf after restore
    of DB and before to apply the keystone puppet task to avoid of using the
    configured domain as a default.

    Change-Id: I05a6c48532e8042496b3d8ccef53d65bf8c44653

commit e3f82399d567dbcfc1ae9a1ecbddba7bf5028fc8
Author: Ilya Kharin <email address hidden>
Date: Wed Jun 22 01:32:47 2016 +0300

    Add helper function to iterate over parameters

    The helpers.iterate_parameters function allows to iterate over lines of
    INI-like files along with a context of information, such section,
    parameter and value.

    Change-Id: I55b179118116fd5dacf100754057ea6589782dc2

commit 5ed370a4fbb3369d0f75873d205ac7f0c655f93a
Author: Ilya Kharin <email address hidden>
Date: Wed Jun 22 01:18:05 2016 +0300

    Add update_file context manager for local files

    The subprocess.update_file function provides an ability to update
    content of a local file by iterating over lines of an original file and
    forming a result content in a temporary file to replace the original
    file in the end. This function is very useful to change configuration
    files.

    Change-Id: I433a5da67887b231400dd63131799019f45c277c

commit 58f31e6c5f408630c42565ee53de6b59457bc84c
Author: Oleg Gelbukh <email address hidden>
Date: Wed Jun 22 14:34:03 2016 +0000

    Escape passwords passed to openstack client

    If special symbols are used in password for 'admin' user in
    OpenStack, octane passes them to command line client as is
    and it breaks shell.

    Properly escape the password before passing it to subprocess.

    Change-Id: Iad635aec6d5b5cc32975937e00205b7e89dc99d9
    Closes-bug: 1585960

commit 896aba1191eeb59cf85cc8be6a2ae67e08b76070
Author: Yuriy Taraday <email address hidden>
Date: Wed Jun 22 15:28:45 2016 +0300

    Add absolute_import to util/docker.py to avoid local tempfile module

    Closes-Bug: 1595156
    Change-Id: I9484efce6fa7aec1b41cf592f9e9768d85931fa7

commit 46586a62df962b2ce00b5d8a63f6fd34c920a1f4
Author: Oleg Gelbukh <email address hidden>
Date: Thu M...

tags: added: in-stable-mitaka
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.