curtin fails to open/erase disk with existing MDADM RAID configuration when deploying Windows images only
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Invalid
|
Undecided
|
Unassigned | ||
curtin |
Fix Released
|
High
|
Unassigned |
Bug Description
Windows image installation fails during curtin if the disks have an existing MDADM RAID configuration leftover on-disk.
Deployment does not fail when deploying Ubuntu 16.04 - despite seemingly the same deployment kernel/initrd and same curtin version in use.
Reproduced on MAAS 2.4.0 (6981-g011e51b7
Curtin in all cases claims to be curtin: Installation started. (18.1-17-
A quick erase on MAAS 2.4 will successfully clear the superblock and allow the installation to proceed. However apparently this wasn't always the case and was fixed previously (LP #1708052) so unclear (and untested) if this works on MAAS 2.3 and earlier.
In my case (2.4) curtin does not know the possible users of the device, however in a customer case (2.0-2.3 as yet unknown version on 16.04) it does know the users but still otherwise fails with the same error. See error outputs below for examples of both cases.
- The issue will occur whether sda, sdb or both drives have an mdadm superblock - even when windows isn't using sdb and sdb is not configured with any partitions etc. (Just has the leftover mdadm info)
- The issue occurs regardless of the current storage layout in MAAS (though installing windows seems to just use a flat layout regardless of the config)
====
Error log from 2.4
====
curtin: Installation started. (18.1-17-
Failed to exclusively open path: /dev/sda
Device holders with exclusive access: []
Device mounts: []
Possible users of /dev/sda:
None
[Errno 16] Device or resource busy: '/dev/sda'
curtin: Installation failed with exception: Unexpected error while running command.
Command: ['curtin', 'block-meta', 'custom']
Exit code: 3
Reason: -
Stdout: Failed to exclusively open path: /dev/sda
Device holders with exclusive access: []
Device mounts: []
Possible users of /dev/sda:
None
[Errno 16] Device or resource busy: '/dev/sda'
Stderr: ''
====
Error log from customer 2.0-2.3
====
curtin: Installation started. (18.1-17-
Failed to exclusively open path: /dev/sdbF
Device holders with exclusive access: ['md126', 'md127']D
Device mounts: []D
Possible users of /dev/sdb:P
NoneN
[Errno 16] Device or resource busy: '/dev/sdb'[
curtin: Installation failed with exception: Unexpected error while running command.c
Command: ['curtin', 'block-meta', 'custom']C
Exit code: 3E
Reason: -R
Stdout: Failed to exclusively open path: /dev/sdbS
Device holders with exclusive access: ['md126', 'md127']
Device mounts: []
Possible users of /dev/sdb:
None
[Errno 16] Device or resource busy: '/dev/sdb'
Stderr: ''S
Related branches
- Server Team CI bot: Approve (continuous-integration)
- curtin developers: Pending requested
-
Diff: 3184 lines (+1417/-240)59 files modifiedcurtin/__init__.py (+1/-1)
curtin/commands/apt_config.py (+22/-6)
curtin/commands/block_meta.py (+157/-49)
curtin/swap.py (+9/-3)
curtin/udev.py (+37/-0)
debian/changelog (+27/-0)
doc/topics/apt_source.rst (+57/-0)
doc/topics/storage.rst (+45/-2)
examples/tests/basic.yaml (+9/-0)
examples/tests/basic_scsi.yaml (+27/-0)
examples/tests/multipath.yaml (+1/-0)
examples/tests/nvme.yaml (+2/-2)
examples/tests/nvme_bcache.yaml (+1/-1)
examples/tests/simple-storage.yaml (+48/-0)
helpers/common (+50/-5)
tests/unittests/helpers.py (+7/-0)
tests/unittests/test_apt_custom_sources_list.py (+61/-29)
tests/unittests/test_commands_block_meta.py (+4/-3)
tests/unittests/test_commands_extract.py (+2/-1)
tests/unittests/test_make_dname.py (+172/-30)
tests/unittests/test_swap.py (+42/-28)
tests/unittests/test_udev.py (+68/-0)
tests/vmtests/__init__.py (+124/-20)
tests/vmtests/releases.py (+6/-0)
tests/vmtests/test_apt_config_cmd.py (+11/-2)
tests/vmtests/test_apt_source.py (+7/-2)
tests/vmtests/test_basic.py (+61/-8)
tests/vmtests/test_bcache_basic.py (+6/-0)
tests/vmtests/test_bcache_bug1718699.py (+4/-0)
tests/vmtests/test_fs_battery.py (+5/-0)
tests/vmtests/test_iscsi.py (+6/-0)
tests/vmtests/test_journald_reporter.py (+4/-0)
tests/vmtests/test_lvm.py (+5/-0)
tests/vmtests/test_lvm_iscsi.py (+13/-7)
tests/vmtests/test_lvm_raid.py (+16/-8)
tests/vmtests/test_lvm_root.py (+2/-0)
tests/vmtests/test_mdadm_bcache.py (+42/-0)
tests/vmtests/test_mdadm_iscsi.py (+13/-6)
tests/vmtests/test_multipath.py (+31/-0)
tests/vmtests/test_network.py (+6/-0)
tests/vmtests/test_network_alias.py (+6/-0)
tests/vmtests/test_network_bonding.py (+6/-0)
tests/vmtests/test_network_bridging.py (+7/-0)
tests/vmtests/test_network_ipv6.py (+8/-0)
tests/vmtests/test_network_ipv6_static.py (+4/-0)
tests/vmtests/test_network_ipv6_vlan.py (+4/-0)
tests/vmtests/test_network_mtu.py (+9/-0)
tests/vmtests/test_network_static.py (+4/-0)
tests/vmtests/test_network_static_routes.py (+5/-0)
tests/vmtests/test_network_vlan.py (+6/-0)
tests/vmtests/test_nvme.py (+17/-4)
tests/vmtests/test_old_apt_features.py (+7/-2)
tests/vmtests/test_pollinate_useragent.py (+6/-0)
tests/vmtests/test_raid5_bcache.py (+15/-7)
tests/vmtests/test_simple.py (+67/-1)
tests/vmtests/test_ubuntu_core.py (+2/-0)
tests/vmtests/test_uefi_basic.py (+17/-7)
tests/vmtests/test_zfsroot.py (+10/-0)
tools/jenkins-runner (+6/-6)
tags: | added: sts |
Changed in maas: | |
status: | Incomplete → New |
Changed in curtin: | |
status: | Confirmed → In Progress |
Hi Trent,
Could you please attach the curtin configuration and the full log?
Also, I think this may be an issue when curtin is dealing with DD images in general and not correctly cleaning up the disk since MAAS should be sending the right configuration that includes deleting the super block.