nbd ( + lvm thin pool?) fragile

Bug #1728109 reported by Serge Hallyn
6
This bug affects 1 person
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_tmeta || true
        dmsetup remove nbd-ThinDataLV_tdata || true
    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/controlC0: serge 1399 F.... pulseaudio
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=/boot/vmlinuz-4.10.0-37-generic root=UUID=c33e6872-2e16-4b10-8d42-9dfacd6a132b ro find_preseed=/preseed.cfg auto noprompt priority=critical locale=en_US quiet
ProcVersionSignature: Ubuntu 4.10.0-37.41-generic 4.10.17
RelatedPackageVersions:
 linux-restricted-modules-4.10.0-37-generic N/A
 linux-backports-modules-4.10.0-37-generic N/A
 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.asset.tag: No Asset Tag
dmi.chassis.type: 1
dmi.chassis.vendor: No Enclosure
dmi.chassis.version: N/A
dmi.modalias: dmi:bvnPhoenixTechnologiesLTD:bvr6.00:bd05/19/2017:svnVMware,Inc.:pnVMwareVirtualPlatform:pvrNone:rvnIntelCorporation:rn440BXDesktopReferencePlatform:rvrNone:cvnNoEnclosure:ct1:cvrN/A:
dmi.product.name: VMware Virtual Platform
dmi.product.version: None
dmi.sys.vendor: VMware, Inc.

Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

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.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Serge Hallyn (serge-hallyn) wrote : AlsaInfo.txt

apport information

tags: added: apport-collected zesty
description: updated
Revision history for this message
Serge Hallyn (serge-hallyn) wrote : CRDA.txt

apport information

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : JournalErrors.txt

apport information

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Lspci.txt

apport information

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Lsusb.txt

apport information

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : ProcEnviron.txt

apport information

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : ProcModules.txt

apport information

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : PulseList.txt

apport information

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : UdevDb.txt

apport information

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : WifiSyslog.txt

apport information

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

http://pastebin.com/raw/YPGG6usG is the reproduction script.

In virtualbox it actually passes. Maybe this really is a problem with the disk driver for vmware?

description: updated
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Well, actually on virtualbox it's touch-and-go.

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.