Curtin doesn't clean up previous MD configuration
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
curtin |
Fix Released
|
High
|
Unassigned | ||
curtin (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
* On some machines which have existing MDADM RAID metadata on one or
more of disks, curtin fails to remove this existing metadata when
instructed to do so and fails to install on such machines.
Curtin has been updated to ignore mdadm asseble errors specifically
in the case where curtin has been instructed to wipe a designated
device. In the above case, curtin encountered an unexpected return
code from mdadm assemble command which is not relevant since curtin
is going to wipe the underlying device for re-installation.
[Test Case]
* Install proposed curtin package and deploy to a machine with a
partial mdadm raid array which cannot be properly assembled.
PASS: Successfully deploy image with RAID configuration included.
FAIL: Deployment fails with the following error:
Command: ['mdadm', '--assemble', '--scan']
Exit code: 3
Reason: -
Stdout: ''
Stderr: u'mdadm: /dev/md/4 assembled from 3 drives
not enough to start the array.
[Regression Potential]
* Users requesting curtin 'preserve' existing raid configurations may
be impacted.
[Original Description]
When deploying a machine in MAAS with a MD setup, deployment fails. Inspection shows that curtin doesn't clean up existin MD devices. On a failed machine I can see in dmesg:
[ 22.352672] md/raid1:md2: active with 2 out of 2 mirrors
[ 22.730212] md/raid1:md1: active with 2 out of 2 mirrors
these are MD devices from previous deployment. Instead of deleting those, curtin tries to create a new one. So /proc/mdstat shows:
Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]
md3 : inactive md1[1](S) md2[2](S)
3125299568 blocks super 1.2
md1 : active raid1 sdd[1] sdc[0]
1562649792 blocks super 1.2 [2/2] [UU]
md2 : active raid1 sdf[1] sde[0]
1562649792 blocks super 1.2 [2/2] [UU]
unused devices: <none>
MAAS's storage config appears to be correct.
Related branches
- Server Team CI bot: Approve (continuous-integration)
- Ryan Harper (community): Approve
-
Diff: 177 lines (+64/-30)4 files modifiedcurtin/block/clear_holders.py (+10/-2)
curtin/block/mdadm.py (+18/-5)
tests/unittests/test_block_mdadm.py (+28/-23)
tests/unittests/test_clear_holders.py (+8/-0)
- Scott Moser: Pending requested
-
Diff: 14513 lines (+10324/-1893)94 files modifiedMakefile (+3/-1)
curtin/__init__.py (+4/-0)
curtin/block/__init__.py (+249/-61)
curtin/block/clear_holders.py (+387/-0)
curtin/block/lvm.py (+96/-0)
curtin/block/mdadm.py (+18/-5)
curtin/block/mkfs.py (+10/-5)
curtin/commands/apply_net.py (+156/-1)
curtin/commands/apt_config.py (+668/-0)
curtin/commands/block_info.py (+75/-0)
curtin/commands/block_meta.py (+134/-263)
curtin/commands/block_wipe.py (+1/-2)
curtin/commands/clear_holders.py (+48/-0)
curtin/commands/curthooks.py (+61/-235)
curtin/commands/main.py (+4/-3)
curtin/config.py (+2/-3)
curtin/gpg.py (+74/-0)
curtin/net/__init__.py (+67/-30)
curtin/net/network_state.py (+45/-1)
curtin/util.py (+278/-81)
debian/changelog (+32/-2)
doc/conf.py (+21/-4)
doc/devel/README-vmtest.txt (+0/-152)
doc/devel/README.txt (+0/-55)
doc/devel/clear_holders_doc.txt (+85/-0)
doc/index.rst (+6/-0)
doc/topics/apt_source.rst (+164/-0)
doc/topics/config.rst (+551/-0)
doc/topics/development.rst (+68/-0)
doc/topics/integration-testing.rst (+245/-0)
doc/topics/networking.rst (+522/-0)
doc/topics/overview.rst (+7/-7)
doc/topics/reporting.rst (+3/-3)
doc/topics/storage.rst (+894/-0)
examples/apt-source.yaml (+267/-0)
examples/network-ipv6-bond-vlan.yaml (+56/-0)
examples/tests/apt_config_command.yaml (+85/-0)
examples/tests/apt_source_custom.yaml (+97/-0)
examples/tests/apt_source_modify.yaml (+92/-0)
examples/tests/apt_source_modify_arches.yaml (+102/-0)
examples/tests/apt_source_modify_disable_suite.yaml (+92/-0)
examples/tests/apt_source_preserve.yaml (+98/-0)
examples/tests/apt_source_search.yaml (+97/-0)
examples/tests/basic.yaml (+5/-1)
examples/tests/basic_network_static_ipv6.yaml (+22/-0)
examples/tests/basic_scsi.yaml (+1/-1)
examples/tests/network_alias.yaml (+125/-0)
examples/tests/network_mtu.yaml (+88/-0)
examples/tests/network_source_ipv6.yaml (+31/-0)
examples/tests/test_old_apt_features.yaml (+11/-0)
examples/tests/test_old_apt_features_ports.yaml (+10/-0)
examples/tests/uefi_basic.yaml (+15/-0)
examples/tests/vlan_network_ipv6.yaml (+92/-0)
setup.py (+2/-2)
tests/unittests/helpers.py (+41/-0)
tests/unittests/test_apt_custom_sources_list.py (+170/-0)
tests/unittests/test_apt_source.py (+1032/-0)
tests/unittests/test_block.py (+210/-0)
tests/unittests/test_block_lvm.py (+94/-0)
tests/unittests/test_block_mdadm.py (+28/-23)
tests/unittests/test_block_mkfs.py (+2/-2)
tests/unittests/test_clear_holders.py (+329/-0)
tests/unittests/test_make_dname.py (+200/-0)
tests/unittests/test_net.py (+54/-13)
tests/unittests/test_util.py (+180/-2)
tests/vmtests/__init__.py (+38/-38)
tests/vmtests/helpers.py (+129/-166)
tests/vmtests/test_apt_config_cmd.py (+55/-0)
tests/vmtests/test_apt_source.py (+238/-0)
tests/vmtests/test_basic.py (+21/-41)
tests/vmtests/test_bcache_basic.py (+5/-8)
tests/vmtests/test_bonding.py (+0/-204)
tests/vmtests/test_lvm.py (+2/-1)
tests/vmtests/test_mdadm_bcache.py (+21/-17)
tests/vmtests/test_multipath.py (+5/-13)
tests/vmtests/test_network.py (+205/-348)
tests/vmtests/test_network_alias.py (+40/-0)
tests/vmtests/test_network_bonding.py (+63/-0)
tests/vmtests/test_network_enisource.py (+91/-0)
tests/vmtests/test_network_ipv6.py (+53/-0)
tests/vmtests/test_network_ipv6_enisource.py (+26/-0)
tests/vmtests/test_network_ipv6_static.py (+42/-0)
tests/vmtests/test_network_ipv6_vlan.py (+34/-0)
tests/vmtests/test_network_mtu.py (+155/-0)
tests/vmtests/test_network_static.py (+44/-0)
tests/vmtests/test_network_vlan.py (+77/-0)
tests/vmtests/test_nvme.py (+2/-3)
tests/vmtests/test_old_apt_features.py (+89/-0)
tests/vmtests/test_raid5_bcache.py (+5/-8)
tests/vmtests/test_uefi_basic.py (+16/-18)
tools/jenkins-runner (+33/-7)
tools/launch (+9/-48)
tools/xkvm (+90/-2)
tox.ini (+30/-13)
tags: | added: 4010 |
tags: | added: maas |
tags: | added: bootstack |
tags: |
added: canonical-bootstack removed: bootstack |
description: | updated |
Changed in curtin (Ubuntu): | |
status: | New → Fix Released |
Changed in curtin (Ubuntu Xenial): | |
status: | New → Fix Committed |
tags: |
added: verification-done removed: verification-needed |
I forgot to mention, this is curtin in 14.04. I'd assume that's 0.1.0~bzr399- 0ubuntu1~ 16.04.1.