Bug 1009086 - [vdsm] small raw volume sizes (<~1M) are rounded to 0m in createVolume (lvcreate error)
[vdsm] small raw volume sizes (<~1M) are rounded to 0m in createVolume (lvcre...
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: vdsm (Show other bugs)
x86_64 Unspecified
high Severity low
: ---
: 3.3.0
Assigned To: Federico Simoncelli
: Triaged
Depends On:
  Show dependency treegraph
Reported: 2013-09-17 12:17 EDT by Elad
Modified: 2016-02-10 15:55 EST (History)
11 users (show)

See Also:
Fixed In Version: v4.13.0
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-10-13 16:16:00 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: Storage
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
logs (215.93 KB, application/x-gzip)
2013-09-17 12:17 EDT, Elad
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 19390 None None None Never

  None (edit)
Description Elad 2013-09-17 12:17:28 EDT
Created attachment 798879 [details]

Description of problem:

vdsm is failing to create a volume from glance.

vdsm is trying to perform lvcreate operation with a different lv size than specified in createVolume.
Although size=1042453 is passed, the lvcreate command is issued with 0m.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. add glance (with images) as an external provider to RHEV
2. import an image to RHEV

Actual results:

vdsm is trying to perform lvcreate with a different volume size:


Thread-3820::INFO::2013-09-17 16:54:59,896::logUtils::44::dispatcher::(wrapper) Run and protect: createVolume(sdUUID='10c139cc-a8c5-49ad-a353-b5c42589c90b', spUUID='5849b030-626e-47cb-ad90-3ce782d831b3', imgUUID='d541e10e-142e-48ab-9e9a-d24c49d9c035', size='1042453', volFormat=5, preallocate=1, diskType=2, volUUID='740fde4b-f8ed-439f-920d-57f942cbffff', desc='', srcImgUUID='00000000-0000-0000-0000-000000000000', srcVolUUID='00000000-0000-0000-0000-000000000000')


8a203438-35b8-4457-9adc-3e9d445758dc::DEBUG::2013-09-17 16:55:00,920::lvm::314::Storage.Misc.excCmd::(cmd) '/usr/bin/sudo -n /sbin/lvm lvcreate --config " devices { preferred_names = [\\"^/dev/mapper/\\"] ignore_suspended_devices=1 write_cache_state=0 disable_after_error_count=3 filter = [ \'a|/dev/mapper/3514f0c54d5c00002|/dev/mapper/3514f0c54d5c00003|/dev/mapper/3514f0c54d5c00004|/dev/mapper/3514f0c54d5c00005|/dev/mapper/3514f0c54d5c00006|/dev/mapper/3514f0c54d5c00007|/dev/mapper/3514f0c54d5c00008|/dev/mapper/3514f0c54d5c00009|/dev/mapper/3514f0c54d5c0000a|/dev/mapper/3514f0c54d5c0000b|/dev/mapper/3514f0c54d5c0000c|/dev/mapper/3514f0c54d5c0000d|/dev/mapper/3514f0c54d5c0000e|/dev/mapper/3514f0c54d5c0000f|/dev/mapper/3514f0c54d5c00597|/dev/mapper/3514f0c54d5c00989|\', \'r|.*|\' ] }  global {  locking_type=1  prioritise_write_locks=1  wait_for_locks=1 }  backup {  retain_min = 50  retain_days = 0 } " --autobackup n --contiguous n --size 0m --addtag OVIRT_VOL_INITIALIZING --name 740fde4b-f8ed-439f-920d-57f942cbffff 10c139cc-a8c5-49ad-a353-b5c42589c90b' (cwd None)


8a203438-35b8-4457-9adc-3e9d445758dc::DEBUG::2013-09-17 16:55:01,125::lvm::314::Storage.Misc.excCmd::(cmd) FAILED: <err> = '  Unable to create new logical volume with no extents\n'; <rc> = 5
8a203438-35b8-4457-9adc-3e9d445758dc::ERROR::2013-09-17 16:55:01,131::volume::508::Storage.Volume::(create) Unexpected error
Traceback (most recent call last):
  File "/usr/share/vdsm/storage/volume.py", line 473, in create
    srcVolUUID, imgPath, volPath)
  File "/usr/share/vdsm/storage/blockVolume.py", line 178, in _create
  File "/usr/share/vdsm/storage/lvm.py", line 1026, in createLV
    raise se.CannotCreateLogicalVolume(vgName, lvName)
CannotCreateLogicalVolume: Cannot create Logical Volume: ('10c139cc-a8c5-49ad-a353-b5c42589c90b', '740fde4b-f8ed-439f-920d-57f942cbffff')

Additional info:logs
Comment 3 Federico Simoncelli 2013-09-19 04:52:11 EDT
Attached VDSM logs are not containing the relevant error.

This is completely unrelated to glance as it's the regular createVolume flow and in fact you can reproduce it using rest-api just trying to create a disk:

# add disk --provisioned_size 1042453 --interface virtio --name DeleteMe1 --format raw --sparse false --storage_domains-storage_domain storage_domain.name=BlockDomain1

id                               : 2501552a-3185-42f8-8beb-d10289a950cf
name                             : DeleteMe1
actual_size                      : 0
alias                            : DeleteMe1
bootable                         : False
creation_status-state            : pending
format                           : raw
image_id                         : b32204b7-8d1b-462f-9ff9-3843ae778826
interface                        : virtio
propagate_errors                 : False
provisioned_size                 : 1042453
quota-id                         : 00000000-0000-0000-0000-000000000000
shareable                        : False
size                             : 1042453
sparse                           : False
status-state                     : locked
storage_domains-storage_domain-id: 6cb765e4-d5f1-460b-862b-d955bfda5129
wipe_after_delete                : False

16ec03a6-cf4a-48a3-a2a0-a0c33e139da1::DEBUG::2013-09-19 04:28:38,615::lvm::314::Storage.Misc.excCmd::(cmd) '/usr/bin/sudo -n /sbin/lvm lvcreate --config " devices { preferred_names = [\\"^/dev/mapper/\\"] ignore_s
uspended_devices=1 write_cache_state=0 disable_after_error_count=3 filter = [ \'a|/dev/mapper/1ATA_QEMU_HARDDISK_QM00007|/dev/mapper/1IET_00010001|/dev/mapper/1IET_00010002|/dev/mapper/1IET_00010003|/dev/mapper/1I
020004|/dev/mapper/1IET_00020005|/dev/mapper/1IET_00020006|/dev/mapper/1IET_00020007|\', \'r|.*|\' ] }  global {  locking_type=1  prioritise_write_locks=1  wait_for_locks=1 }  backup {  retain_min = 50  retain_day
s = 0 } " --autobackup n --contiguous n --size 0m --addtag OVIRT_VOL_INITIALIZING --name b32204b7-8d1b-462f-9ff9-3843ae778826 6cb765e4-d5f1-460b-862b-d955bfda5129' (cwd None)
16ec03a6-cf4a-48a3-a2a0-a0c33e139da1::DEBUG::2013-09-19 04:28:38,757::lvm::314::Storage.Misc.excCmd::(cmd) FAILED: <err> = '  Unable to create new logical volume with no extents\n'; <rc> = 5

16ec03a6-cf4a-48a3-a2a0-a0c33e139da1::ERROR::2013-09-19 04:28:38,760::task::850::TaskManager.Task::(_setError) Task=`16ec03a6-cf4a-48a3-a2a0-a0c33e139da1`::Unexpected error
Traceback (most recent call last):
  File "/usr/share/vdsm/storage/task.py", line 857, in _run
    return fn(*args, **kargs)
  File "/usr/share/vdsm/storage/task.py", line 318, in run
    return self.cmd(*self.argslist, **self.argsdict)
  File "/usr/share/vdsm/storage/securable.py", line 68, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/share/vdsm/storage/sp.py", line 1994, in createVolume
    desc=desc, srcImgUUID=srcImgUUID, srcVolUUID=srcVolUUID)
  File "/usr/share/vdsm/storage/sd.py", line 411, in createVolume
    preallocate, diskType, volUUID, desc, srcImgUUID, srcVolUUID)
  File "/usr/share/vdsm/storage/volume.py", line 470, in create
    raise e
CannotCreateLogicalVolume: Cannot create Logical Volume: ('6cb765e4-d5f1-460b-862b-d955bfda5129', 'b32204b7-8d1b-462f-9ff9-3843ae778826')

This is not a test blocker, just use images larger than 1Mb.

Note You need to log in before you can comment on or make changes to this bug.