curtin fails to setup bcache when unclean bcache from previous install exists
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
curtin |
Fix Released
|
High
|
Unassigned | ||
curtin (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
curtin: 0.1.0~bzr505-
How to reproduce:
Let's say you have 2 disks, one as faster, another one as slower.
1. create a two partition on the faster one
2. set the first partition as /
3. set the remaining partition as bcache cache device and use the second and slow disk as backing device
https:/
4. install OS (with MAAS in my case)
$ maas admin machine deploy retc7f
$ maas admin machine get-curtin-config retc7f > curtin-config.yaml
-> first deployment succeeds
5. quick erase all disks (erasing a few megabytes at the beginning and the end of the drives with MAAS in my case)
$ maas admin machine release retc7f erase=true quick_erase=true
-> quick erase succeeds
6. use the same machine again with the same bcache layout, then install OS
$ maas admin machine deploy retc7f
$ maas admin machine get-curtin-config retc7f > curtin-
7. Get an installation failure with "Device or resource busy"
An error occured handling 'vda-part2': OSError - [Errno 16] Device or resource busy: '/dev/vda2'
Curtin config of the first install:
https:/
Curtin config after the quick erase:
https:/
My gut feeling is that backing devices' bcache signature was deleted by quick erase, but the bcache signature of the second partition of the cache device wasn't cleanup because it was in the middle of the disk (not covered by quick erase). Then, bcache was in unclean state which might cause "Device or resource busy". Possibly more bcache cleanup just before installing OS may be required.
curtin: Installation started. (0.1.0~
third party drivers not installed or necessary.
Failed to exclusively open path: /dev/vda2
Device holders with exclusive access: []
Device mounts: []
Possible users of /dev/vda2:
None
An error occured handling 'vda-part2': OSError - [Errno 16] Device or resource busy: '/dev/vda2'
[Errno 16] Device or resource busy: '/dev/vda2'
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/vda2
Device holders with exclusive access: []
Device mounts: []
Possible users of /dev/vda2:
None
An error occured handling 'vda-part2': OSError - [Errno 16] Device or resource busy: '/dev/vda2'
[Errno 16] Device or resource busy: '/dev/vda2'
Stderr: ''
Related branches
- Server Team CI bot: Approve (continuous-integration)
- Scott Moser (community): Approve
-
Diff: 272 lines (+143/-35)7 files modifiedcurtin/block/clear_holders.py (+13/-0)
curtin/commands/block_meta.py (+15/-19)
curtin/commands/block_wipe.py (+4/-0)
curtin/commands/clear_holders.py (+1/-1)
examples/tests/bcache-wipe-xfs.yaml (+74/-0)
tests/unittests/test_commands_block_meta.py (+11/-15)
tests/vmtests/test_bcache_bug1718699.py (+25/-0)
- curtin developers: Pending requested
-
Diff: 1202 lines (+350/-270)36 files modifiedcurtin/block/__init__.py (+11/-5)
curtin/block/clear_holders.py (+33/-4)
curtin/commands/block_meta.py (+23/-20)
curtin/commands/block_wipe.py (+4/-0)
curtin/commands/clear_holders.py (+1/-1)
debian/changelog (+17/-0)
examples/tests/bcache-wipe-xfs.yaml (+74/-0)
examples/tests/uefi_basic.yaml (+23/-0)
tests/unittests/test_clear_holders.py (+82/-0)
tests/unittests/test_commands_block_meta.py (+11/-15)
tests/vmtests/__init__.py (+14/-15)
tests/vmtests/releases.py (+0/-11)
tests/vmtests/test_basic.py (+0/-48)
tests/vmtests/test_bcache_basic.py (+0/-4)
tests/vmtests/test_bcache_bug1718699.py (+21/-0)
tests/vmtests/test_iscsi.py (+0/-4)
tests/vmtests/test_lvm.py (+0/-8)
tests/vmtests/test_lvm_iscsi.py (+0/-4)
tests/vmtests/test_mdadm_iscsi.py (+0/-4)
tests/vmtests/test_network.py (+0/-5)
tests/vmtests/test_network_alias.py (+0/-5)
tests/vmtests/test_network_bonding.py (+0/-8)
tests/vmtests/test_network_enisource.py (+0/-6)
tests/vmtests/test_network_ipv6.py (+0/-5)
tests/vmtests/test_network_ipv6_enisource.py (+0/-7)
tests/vmtests/test_network_ipv6_static.py (+0/-5)
tests/vmtests/test_network_ipv6_vlan.py (+0/-16)
tests/vmtests/test_network_mtu.py (+1/-6)
tests/vmtests/test_network_static.py (+0/-6)
tests/vmtests/test_network_static_routes.py (+0/-6)
tests/vmtests/test_network_vlan.py (+0/-16)
tests/vmtests/test_nvme.py (+0/-5)
tests/vmtests/test_raid5_bcache.py (+0/-5)
tests/vmtests/test_uefi_basic.py (+1/-15)
tools/launch (+10/-10)
tools/xkvm (+24/-1)
Changed in curtin: | |
importance: | Undecided → High |
status: | New → Incomplete |
tags: | added: cpe-onsite |
Changed in curtin: | |
status: | Incomplete → New |
description: | updated |
description: | updated |
Changed in curtin: | |
status: | Confirmed → In Progress |
Changed in curtin: | |
status: | In Progress → Fix Committed |
I was in hurry to get rolling, so didn't have enough time to collect more info. More robust reproducer could be created when I have some time.