Provisioning failed if inactive md device had been found

Bug #1390492 reported by Alexander Gordeev
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
High
Alexander Gordeev

Bug Description

It's hard to reproduce. But the possibility is a bit higher if cluster was re-deployed

Sometimes fuel-agent fails with

2014-11-07 12:45:20.795 4899 CRITICAL fuel-agent [-] KeyError: 'devices'
2014-11-07 12:45:20.795 4899 TRACE fuel-agent Traceback (most recent call last):
2014-11-07 12:45:20.795 4899 TRACE fuel-agent File "/usr/bin/provision", line 10, in <module>
2014-11-07 12:45:20.795 4899 TRACE fuel-agent sys.exit(provision())
2014-11-07 12:45:20.795 4899 TRACE fuel-agent File "/usr/lib/python2.6/site-packages/fuel_agent/cmd/agent.py", line 37, in provision
2014-11-07 12:45:20.795 4899 TRACE fuel-agent main(['do_provisioning'])
2014-11-07 12:45:20.795 4899 TRACE fuel-agent File "/usr/lib/python2.6/site-packages/fuel_agent/cmd/agent.py", line 67, in main
2014-11-07 12:45:20.795 4899 TRACE fuel-agent getattr(mgr, action)()
2014-11-07 12:45:20.795 4899 TRACE fuel-agent File "/usr/lib/python2.6/site-packages/fuel_agent/manager.py", line 296, in do_provisioning
2014-11-07 12:45:20.795 4899 TRACE fuel-agent self.do_partitioning()
2014-11-07 12:45:20.795 4899 TRACE fuel-agent File "/usr/lib/python2.6/site-packages/fuel_agent/manager.py", line 123, in do_partitioning
2014-11-07 12:45:20.795 4899 TRACE fuel-agent mu.mdcreate(md.name, md.level, *md.devices)
2014-11-07 12:45:20.795 4899 TRACE fuel-agent File "/usr/lib/python2.6/site-packages/fuel_agent/utils/md_utils.py", line 97, in mdcreate
2014-11-07 12:45:20.795 4899 TRACE fuel-agent set(reduce(lambda x, y: x + y, [md['devices'] for md in mds], [])):
2014-11-07 12:45:20.795 4899 TRACE fuel-agent KeyError: 'devices'
2014-11-07 12:45:20.795 4899 TRACE fuel-agent

The actual reason is that '/proc/mdstat' contains information about inactive md devices too.
Eg.:
Personalities :
md127 : inactive vdc3[2](S)
      204736 blocks

unused devices: <none>

`mdadm --details` can't get any information about inactive device
mdadm: md device /dev/md127 does not appear to be active.

Changed in fuel:
milestone: none → 6.0
Changed in fuel:
status: New → In Progress
Mike Scherbakov (mihgen)
tags: added: experimental
Changed in fuel:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (master)

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

commit 45da02351058346bdbbf6c26878a15c672280ce7
Author: Alexander Gordeev <email address hidden>
Date: Fri Nov 7 17:11:07 2014 +0400

    Fix KeyError in md_utils in fuel-agent

    fuel-agent failed after reset cluster and re-deploy while creating
    new md device if inactive devices were found

    Change-Id: I38f086fae7e7c5cd2a62669509538e8ddbb092b2
    Closes-Bug: #1390492

Changed in fuel:
status: In Progress → Fix Committed
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/133466

Changed in fuel:
status: Fix Committed → In Progress
Changed in fuel:
milestone: 6.0 → 6.1
Changed in fuel:
milestone: 6.1 → 6.0
Revision history for this message
Łukasz Oleś (loles) wrote :

Backport to 5.1.1?

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

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

commit 724124f8a982bc64c50ef6434f4f616b92763754
Author: Alexander Gordeev <email address hidden>
Date: Mon Nov 10 16:10:07 2014 +0300

    Fix inactive md devices removal in fuel-agent

    Provision will fail to create new md device if any of disks belongs
    to inactive md device from time to time.

    Change-Id: I9abea747e21963b830c1fc27699cc0d756a8c58c
    Closes-Bug: #1390492

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