Charm fails when zapping loopback device
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Swift Storage Charm |
Fix Released
|
High
|
Liam Young |
Bug Description
The charm mounts the specified file using loopback device loop0 But subsequent config-change hook runs fail with:
Traceback (most recent call last):
File "./hooks/
main()
File "./hooks/
hooks.
File "/var/lib/
self.
File "/var/lib/
restart_
File "/var/lib/
r = lambda_f()
File "/var/lib/
(lambda: f(*args, **kwargs)), restart_map, stopstart,
File "/var/lib/
return f(*args, **kwargs)
File "./hooks/
setup_storage()
File "/var/lib/
clean_
File "/var/lib/
zap_
File "/var/lib/
'bs=1M', 'count=1'])
File "/usr/lib/
raise CalledProcessEr
subprocess.
Changed in charm-swift-storage: | |
status: | New → Confirmed |
importance: | Undecided → High |
assignee: | nobody → Liam Young (gnuoy) |
summary: |
- Charm tries to mount the same loopback device multiple times + Charm fails when zapping loopback device |
description: | updated |
Changed in charm-swift-storage: | |
milestone: | none → 18.05 |
Changed in charm-swift-storage: | |
status: | Fix Committed → Fix Released |
This seems to come down to the backing file being associated with
loop0 on initial install. But when the file is mounted a secound
loopback device is used, loop1. The association between loop1 and
the backing file is removed when the file is unmounted. This only
becomes an issue when clean_storage is called. clean_storage unmounts
the filesystem which removes the backing from the loopback device and
then tries to dd the loopback device which fails as it has no file
association. Stepping through in slightly more detail:
1) In setup_storage determine_ block_devices is called which loopback_ device with the backing file as loopback_ device returns the first match which happens to be '/dev/loop1' ) is then called. The first thing
indirectly calls ensure_
the argument. This loops over the output of 'losetup -a'.
'losetup -a' returns both loop0 and loop1 but
ensure_
loop1
2) clean_storage(
clean_storage does is unmount the filesystem using the backing
file which causes loop1 to be disassociated from the backing file.
clean_storage then calls zap_disk on loop1 but loop1 is no longer
associated with a file and so the first dd call fails