Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1092087

Summary: Extending Preallocated Read Only Disk should fail
Product: Red Hat Enterprise Virtualization Manager Reporter: Raz Tamir <ratamir>
Component: ovirt-engineAssignee: Vered Volansky <vered>
Status: CLOSED CURRENTRELEASE QA Contact: Ori Gofen <ogofen>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.4.0CC: acanan, acathrow, amureini, ecohen, gklein, iheim, knesenko, lpeer, Rhev-m-bugs, scohen, tnisan, yeylon
Target Milestone: ---   
Target Release: 3.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: storage
Fixed In Version: org.ovirt.engine-root-3.4.0-17 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-12 14:05:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
vdsm and engine logs none

Description Raz Tamir 2014-04-28 17:52:31 UTC
Created attachment 890540 [details]
vdsm and engine logs

Description of problem:

When trying to extend a preallocated Read Only disk, the engine report that: 
1) "Failed to update VM 'vm_0' with the new volume size. VM restart is recommended."
2) "Size of the disk 'vm_0_Disk3' was successfully updated to 7 GB by admin."
3) "VM vm_0 vm_0_Disk3 disk was updated by admin."

And the ERROR messages in the log:

2014-04-28 20:27:10,586 ERROR [org.ovirt.engine.core.vdsbroker.vdsbroker.ExtendVmDiskSizeVDSCommand] (org.ovirt.thread.pool-4-thread-27) Failed in ExtendVmDi
skSizeVDS method
2014-04-28 20:27:10,586 ERROR [org.ovirt.engine.core.vdsbroker.vdsbroker.ExtendVmDiskSizeVDSCommand] (org.ovirt.thread.pool-4-thread-27) Command ExtendVmDisk
SizeVDSCommand(HostName = green-vdsc.qa.lab.tlv.redhat.com, HostId = bb1394fc-ff93-464a-a1ad-207c9f6f3b5b, vmId=f65ca7d3-4b82-4c92-bf6a-d72180f20c97) executi
on failed. Exception: VDSErrorException: VDSGenericException: VDSErrorException: Failed to ExtendVmDiskSizeVDS, error = Failed to update device, code = 56

And the disk updated successfully. 

From VDSM:

Thread-13::DEBUG::2014-04-28 20:27:10,542::libvirtconnection::124::root::(wrapper) Unknown libvirterror: ecode: 1 edom: 10 level: 2 message: internal error u
nable to execute QEMU command 'block_resize': Device 'drive-virtio-disk2' is read only
Thread-13::ERROR::2014-04-28 20:27:10,542::vm::4418::vm.Vm::(diskSizeExtend) vmId=`f65ca7d3-4b82-4c92-bf6a-d72180f20c97`::Unable to extend disk vdc to size 7
516192768
Traceback (most recent call last):
  File "/usr/share/vdsm/vm.py", line 4415, in diskSizeExtend
    return self._diskSizeExtendRaw(drive, newSizeBytes)
  File "/usr/share/vdsm/vm.py", line 4395, in _diskSizeExtendRaw
    "reboot", sizeRoundedBytes, exc_info=True)
  File "/usr/lib64/python2.6/logging/__init__.py", line 1321, in warning
    self.logger.warning(msg, *args, **kwargs)
  File "/usr/lib64/python2.6/logging/__init__.py", line 1068, in warning
    self._log(WARNING, msg, args, **kwargs)
  File "/usr/lib64/python2.6/logging/__init__.py", line 1173, in _log
    self.handle(record)
  File "/usr/lib64/python2.6/logging/__init__.py", line 1183, in handle
    self.callHandlers(record)
  File "/usr/lib64/python2.6/logging/__init__.py", line 1220, in callHandlers
    hdlr.handle(record)
  File "/usr/lib64/python2.6/logging/__init__.py", line 679, in handle
    self.emit(record)
  File "/usr/lib64/python2.6/logging/handlers.py", line 786, in emit
    msg = self.format(record)
  File "/usr/lib64/python2.6/logging/__init__.py", line 654, in format
    return fmt.format(record)
  File "/usr/lib64/python2.6/logging/__init__.py", line 436, in format
    record.message = record.getMessage()
  File "/usr/lib64/python2.6/logging/__init__.py", line 306, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Thread-13::DEBUG::2014-04-28 20:27:10,544::BindingXMLRPC::1074::vds::(wrapper) return diskSizeExtend with {'status': {'message': 'Failed to update device', 'code': 56}}

And even though this exception occur VDSM report that this device was extended:
** The original size was 5G --> Extended to 7G ** 

[root@green-vdsc ~]# vdsClient -s 0 getVolumeInfo 173c2617-f550-4459-a371-a1b993a8f074 `vdsClient -s 0 getConnectedStoragePoolsList` c82a4b1a-fc6b-4f7d-a2dc-7400b3309d15 66938add-d237-4b96-a61e-28fd0ddf4a56
        status = OK
        domain = 173c2617-f550-4459-a371-a1b993a8f074
        capacity = 7516192768
        voltype = LEAF
        description =
        parent = 00000000-0000-0000-0000-000000000000
        format = RAW
        image = c82a4b1a-fc6b-4f7d-a2dc-7400b3309d15
        uuid = 66938add-d237-4b96-a61e-28fd0ddf4a56
        disktype = 2
        legality = LEGAL
        mtime = 1398705425
        apparentsize = 7516192768
        truesize = 7516192768
        type = PREALLOCATED
        children = []
        pool =
        ctime = 1398705425


Version-Release number of selected component (if applicable):
3.4.0-0.15.beta3.el6ev.noarch
vdsm-4.14.7-0.1.beta3.el6ev.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Attach a  preallocated disk to vm as Read Only
2. Extend the disk
3.

Actual results:
Explained above


Expected results:
Operation should fail due to the fact that the disk is Read Only


Additional info:

Comment 1 Allon Mureinik 2014-04-29 06:46:50 UTC
There's no point in live-extending an RO disk - a canDoAction should block this.

Comment 2 Ori Gofen 2014-05-12 14:41:58 UTC
verified on av9 when extending a RO disk process fails with:

"Cannot edit Virtual Machine Disk. Read-only disk cannot be resized."

Comment 3 Itamar Heim 2014-06-12 14:05:41 UTC
Closing as part of 3.4.0