nbd ( + lvm thin pool?) fragile
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
I've been trying this on several platforms -
16.04 physical host
16.04 VMware
17.04 vmware
The script pasted below creates a virtual disk, writes a partition table, creates an fs and some thin pools, then verifies that writes happened as expected.
On 16.04 physical host it seems to be working (though I do need to manually dmremove the devices as seen in cleanup(), else a second run fails).
On the VMware hosted vms, the mkfs.ext4 fails to find nbd0p1: "The file /dev/nbd0p1 does not exist and no size was specified."
(I've had other - corruption - issues which are what I was trying to track down with this test script, but it's possible, not certain, that those all boil down to having to manually dmremove the devices)
#### reproduction script:
#!/bin/bash -exu
modprobe nbd
rm -f nbd.img
cleanup() {
if [ $failed -eq 1 ]; then
echo "XXXXXXX"
lvscan
echo "XXXXXX"
vgchange -an nbd || true
qemu-nbd -d /dev/nbd0
dmsetup remove nbd-ThinDataLV || true
dmsetup remove nbd-ThinDataLV_
dmsetup remove nbd-ThinDataLV_
fi
}
truncate -s 30G nbd.img
sfdisk nbd.img << EOF
, 2G;
,,8e;
EOF
vg=nbd
thinsize=20G
sync
echo "Connecting empty file"
qemu-nbd -f raw -c /dev/nbd0 nbd.img
failed=1
trap cleanup EXIT
echo "Creating partition 1"
mkfs.ext4 /dev/nbd0p1
mount /dev/nbd0p1 /mnt
touch /mnt/helloworld
umount /mnt
echo "Creating LVM partitions"
pvscan --cache
pvcreate -ff /dev/nbd0p2
vgcreate nbd /dev/nbd0p2
lvcreate -n ThinDataLV -L "${thinsize}" "${vg}"
lvcreate -n MetaDataLV -L 1G "${vg}"
lvconvert -y --type thin-pool --poolmetadata "${vg}/MetaDataLV" "${vg}/ThinDataLV"
sleep 5
sync
sleep 5
echo "Disconnecting first"
cleanup
# now verify
echo "Reconnecting to verify"
qemu-nbd -f raw -c /dev/nbd0 nbd.img
echo "Mounting,"
mount /dev/nbd0p1 /mnt
echo "Checking whether helloworld file is there"
test -f /mnt/helloworld
echo "unmounting,"
umount /mnt
echo "disconnecting,"
cleanup
echo "Done"
failed=0
echo PASS
---
ApportVersion: 2.20.4-0ubuntu4.5
Architecture: amd64
AudioDevicesInUse:
USER PID ACCESS COMMAND
/dev/snd/
CurrentDesktop: XFCE
DistroRelease: Ubuntu 17.04
InstallationDate: Installed on 2017-09-15 (41 days ago)
InstallationMedia: Xubuntu 17.04 "Zesty Zapus" - Release amd64 (20170412)
IwConfig:
lxcbr0 no wireless extensions.
ens33 no wireless extensions.
lo no wireless extensions.
MachineType: VMware, Inc. VMware Virtual Platform
Package: linux (not installed)
ProcFB: 0 svgadrmfb
ProcKernelCmdLine: BOOT_IMAGE=
ProcVersionSign
RelatedPackageV
linux-
linux-
linux-firmware 1.164.1
RfKill:
1: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
Tags: zesty
Uname: Linux 4.10.0-37-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo
_MarkForUpload: True
dmi.bios.date: 05/19/2017
dmi.bios.vendor: Phoenix Technologies LTD
dmi.bios.version: 6.00
dmi.board.name: 440BX Desktop Reference Platform
dmi.board.vendor: Intel Corporation
dmi.board.version: None
dmi.chassis.
dmi.chassis.type: 1
dmi.chassis.vendor: No Enclosure
dmi.chassis.
dmi.modalias: dmi:bvnPhoenixT
dmi.product.name: VMware Virtual Platform
dmi.product.
dmi.sys.vendor: VMware, Inc.
This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:
apport-collect 1728109
and then change the status of the bug to 'Confirmed'.
If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.
This change has been made by an automated script, maintained by the Ubuntu Kernel Team.