mount-image-callback fails on qcow image on xenial
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-utils |
Fix Released
|
Undecided
|
Unassigned | ||
cloud-utils (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Xenial |
Fix Released
|
Medium
|
Unassigned | ||
Artful |
Fix Released
|
Medium
|
Unassigned | ||
Bionic |
Fix Released
|
Medium
|
Unassigned |
Bug Description
=== Begin SRU Template ===
[Impact]
mount-image-
This function in mount-image-
but not on xenial. The function does succeed some times, but is
brittle.
The fix applied is also applied upstream, and consists mainly of adding
blockdev --rereadpt /dev/nbdX
udevadm settle
where 'nbdX' is the device that mount-image-
point to the file that is to be mounted.
These above added function should not be harmful in any case.
[Test Case]
In a fresh install:
$ sudo apt-get update -q && sudo apt-get install -qy cloud-image-utils
$ url=http://
$ wget "$url" -O xenial-
$ cp -a xenial-
$ sudo mount-image-
waiting on pidfile for /dev/nbd0 in /sys/block/nbd0/pid
connected disk.img (qcow2) to /dev/nbd0. waiting for device.
[Regression Potential]
The regression potential stems from additional udev events
caused by calling blockdev --rereadpt.
udev events should not cause unwanted side effects, but could.
[Other Info]
=== End SRU Template ===
On xenial only:
$ wget http://
$ cp -a xenial-
$ sudo mount-image-
waiting on pidfile for /dev/nbd0 in /sys/block/nbd0/pid
connected disk.img (qcow2) to /dev/nbd0. waiting for device.
partitioned disk.
waiting for /dev/nbd0p1 part=1 to be ready.
waiting for /dev/nbd0p1 part=1 to be ready.
waiting for /dev/nbd0p1 part=1 to be ready.
waiting for /dev/nbd0p1 part=1 to be ready.
waiting for /dev/nbd0p1 part=1 to be ready.
waiting for /dev/nbd0p1 part=1 to be ready.
waiting for /dev/nbd0p1 part=1 to be ready.
waiting for /dev/nbd0p1 part=1 to be ready.
waiting for /dev/nbd0p1 part=1 to be ready.
gave up on waiting for /dev/nbd0p1
$ echo $?
1
This fix seems to work and should be safe.
=== modified file 'bin/mount-
--- bin/mount-
+++ bin/mount-
@@ -316,6 +316,8 @@
fi
i=0
+ [ -b "$mdev" ] || blockdev --rereadpt $nbd ||
+ { error "blockdev --rereadpt $nbd failed"; return 1; }
while :; do
[ -b "$mdev" ] && break
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: cloud-image-utils 0.27-0ubuntu24
ProcVersionSign
Uname: Linux 4.4.0-104-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.14
Architecture: amd64
Date: Thu Jan 4 17:23:15 2018
Ec2AMI: ami-00000388
Ec2AMIManifest: FIXME
Ec2Availability
Ec2InstanceType: m1.small
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
PackageArchitec
ProcEnviron:
TERM=screen
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: cloud-utils
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in cloud-utils (Ubuntu Xenial): | |
status: | Fix Released → Confirmed |
Changed in cloud-utils (Ubuntu Bionic): | |
status: | New → Fix Released |
Changed in cloud-utils (Ubuntu Bionic): | |
importance: | Undecided → Medium |
Changed in cloud-utils (Ubuntu Artful): | |
importance: | Undecided → Medium |
Changed in cloud-utils (Ubuntu Xenial): | |
importance: | Undecided → Medium |
description: | updated |
description: | updated |
artful and bionic are 'fix-released' as some magic in udev/systemd makes it work.
It does seem though that maybe running blockdev makes sense there also though.