Bug 1161966 - [engine-backend] resizing a disk attached to a paused VM leaves the image LOCKED
Summary: [engine-backend] resizing a disk attached to a paused VM leaves the image LOCKED
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.5.0
Hardware: x86_64
OS: Unspecified
unspecified
high
Target Milestone: ovirt-3.6.0-rc
: 3.6.0
Assignee: Amit Aviram
QA Contact: Kevin Alon Goldblatt
URL:
Whiteboard:
Depends On:
Blocks: 1171725
TreeView+ depends on / blocked
 
Reported: 2014-11-09 21:50 UTC by Elad
Modified: 2016-03-10 12:04 UTC (History)
10 users (show)

Fixed In Version: ovirt-engine-3.6.0_qa1
Doc Type: Bug Fix
Doc Text:
Cause: Resizing a disk attached to a paused VM was enabled Consequence: Extending the disk while the vm is paused can cause errors when resuming the VM. Fix: Resizing the disk while the VM is paused is now disabled Result:
Clone Of:
: 1171725 (view as bug list)
Environment:
Last Closed:
oVirt Team: Storage
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
logs (1.65 MB, application/x-gzip)
2014-11-09 21:50 UTC, Elad
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 35520 0 master MERGED engine: Limitaion addition to disk extending. 2020-04-26 10:16:23 UTC

Description Elad 2014-11-09 21:50:42 UTC
Created attachment 955577 [details]
logs

Description of problem:
Trying to resize an image disk while it is attached to a paused VM causes the image to get stuck as LOCKED. 

Version-Release number of selected component (if applicable):
rhev 3.5 vt9
rhevm-3.5.0-0.19.beta.el6ev.noarch
Host OS: Red Hat Enterprise Linux Server release 7.0 (Maipo)
vdsm-4.16.7.3-1.el7ev.x86_64
libvirt-daemon-1.1.1-29.el7_0.3.x86_64
qemu-kvm-rhev-1.5.3-60.el7_0.10.x86_64
selinux-policy-3.13.1-6.el7.noarch
sanlock-3.1.0-2.el7.x86_6

How reproducible:
Always


How reproducible:
Always

Steps to Reproduce:
1. Create a VM with a disk attached, start it in paused state
2. Perform a live resize to the disk while it is attached to the paused VM
3.

The image gets LOCKED. tried to resume the VM, it was blocked on CanDoAction:

2014-11-09 23:05:35,046 WARN  [org.ovirt.engine.core.bll.RunVmCommand] (ajp-/127.0.0.1:8702-5) [7c4a42d4] CanDoAction of action RunVm failed. Reasons:VAR__ACTION__RUN,VAR__TYPE__VM,ACTION_TYPE_FAILED_VM_IS_LOCKED


Then I stopped the VM. The image remained LOCEKD.


Actual results:


The request to extend the disk as shown in engine.log:


2014-11-09 23:02:29,693 INFO  [org.ovirt.engine.core.bll.UpdateVmDiskCommand] (ajp-/127.0.0.1:8702-14) [247d4b89] Running command: UpdateVmDiskCommand internal: false. Entities 
affected :  ID: 3e5be0c4-ffb4-48e0-95ff-5d4d391c3b48 Type: DiskAction group EDIT_DISK_PROPERTIES with role type USER
2014-11-09 23:02:29,709 INFO  [org.ovirt.engine.core.bll.ExtendImageSizeCommand] (ajp-/127.0.0.1:8702-14) [7f70c980] Running command: ExtendImageSizeCommand internal: true. Enti
ties affected :  ID: 3e5be0c4-ffb4-48e0-95ff-5d4d391c3b48 Type: DiskAction group EDIT_DISK_PROPERTIES with role type USER


The task is executed by vdsm but it seems that engine do not poll it so it remains in state 'finished' in vdsm tasks queue:

[root@green-vdsb ~]# vdsClient -s 0 getAllTasks
efc97870-d3e7-4d7e-b80a-ac5bcb082aad :
        verb = extendVolumeSize
        code = 0
        state = finished
        tag = spm
        result = 
        message = 1 jobs completed successfully
        id = efc97870-d3e7-4d7e-b80a-ac5bcb082aad


efc97870-d3e7-4d7e-b80a-ac5bcb082aad::DEBUG::2014-11-09 23:02:30,869::task::595::Storage.TaskManager.Task::(_updateState) Task=`efc97870-d3e7-4d7e-b80a-ac5bcb082aad`::moving from state running -> state finished


After ~35 min:

Thread-24082::DEBUG::2014-11-09 23:36:19,858::task::1191::Storage.TaskManager.Task::(prepare) Task=`3bff3ac3-9ed1-4969-8ced-94954c4000ad`::finished: {'tasks': {'efc97870-d3e7-4d
7e-b80a-ac5bcb082aad': {'code': 0, 'tag': u'spm', 'state': 'finished', 'verb': 'extendVolumeSize', 'result': '', 'message': '1 jobs completed successfully', 'id': 'efc97870-d3e7
-4d7e-b80a-ac5bcb082aad'}}}


The image remains LOCKED.


              image_guid              | disk_alias  | imagestatus 
--------------------------------------+-------------+-------------

 3f8c8b58-b3d5-48c1-8f5d-17bd1bdbe297 | vm-3_Disk1  |           2



Expected results:
1) In my opinion, resize to a disk while it is attached to a VM in pasued should be blocked on CanDoAction
2) If it should not be blocked, engine should poll the task and clean it so the image won't get stuck in LOCKED


Additional info: 
engine.log 
vdsm.log
messages
qemu log

Comment 1 Tal Nisan 2014-11-24 17:37:10 UTC
Amit, all that is needed is to prevent the VM disk from being resized while the VM is in paused state

Comment 3 Elad 2015-04-26 13:01:02 UTC
A disk, attached to a paused VM cannot be resized.

" Cannot edit Virtual Machine Disk because the VM is in Paused status. "

Verified using ovirt-engine-3.6.0_qa1 
ovirt-engine-3.6.0-0.0.master.20150412172306.git55ba764.el6.noarch

Comment 4 Allon Mureinik 2016-03-10 10:44:37 UTC
RHEV 3.6.0 has been released, setting status to CLOSED CURRENTRELEASE

Comment 5 Allon Mureinik 2016-03-10 10:48:27 UTC
RHEV 3.6.0 has been released, setting status to CLOSED CURRENTRELEASE

Comment 6 Allon Mureinik 2016-03-10 12:04:57 UTC
RHEV 3.6.0 has been released, setting status to CLOSED CURRENTRELEASE


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