Bug 901971 - engine: unlock_entity.sh is not unlocking the vm, only images under the vm
Summary: engine: unlock_entity.sh is not unlocking the vm, only images under the vm
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.2.0
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ---
: 3.2.0
Assignee: Eli Mesika
QA Contact: David Botzer
URL:
Whiteboard: infra
Depends On:
Blocks: 915537
TreeView+ depends on / blocked
 
Reported: 2013-01-20 09:59 UTC by Dafna Ron
Modified: 2016-02-10 19:20 UTC (History)
10 users (show)

Fixed In Version: sf5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
screen shot (44.89 KB, image/jpeg)
2013-01-20 09:59 UTC, Dafna Ron
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 11252 0 None MERGED core:unlock_entity.sh is not unlocking the vm... 2020-11-10 08:07:15 UTC

Description Dafna Ron 2013-01-20 09:59:45 UTC
Created attachment 683506 [details]
screen shot

Description of problem:

I have a locked vm which I wanted to unlock using the unlock_entity.sh script. 
although its reported as successful, only the objects under the vm were unlocked nut not the vm itself. 
running the query again after the unlock will show that there are not locked objects: 

before: 

 vm_name |               disk_id                
---------+--------------------------------------
 FGFG    | f463a392-1a3e-4f0a-a8c6-885d994a1383
 NEW     | dd749492-baa0-4478-b8ef-d277c88a5272
(2 rows)


after: 

[root@dafna-web-admin dbscripts]# ./unlock_entity.sh -r -t vm -i FGFG -s localhost -p 5432 -d engine -u postgres
Caution, this operation may lead to data corruption and should be used with care. Please contact support prior to running this command
Are you sure you want to proceed? [y/n]
y
select fn_db_unlock_entity('vm', 'FGFG', true);
 

INSERT 887842 1
unlock vm FGFG completed successfully.[root@dafna-web-admin dbscripts]# ./unlock_entity.sh -r -t vm -i NEW -s localhost -p 5432 -d engine -u postgres
Caution, this operation may lead to data corruption and should be used with care. Please contact support prior to running this command
Are you sure you want to proceed? [y/n]
y
select fn_db_unlock_entity('vm', 'NEW', true);
 

INSERT 887847 1
unlock vm NEW completed successfully.[root@dafna-web-aq -t vm -s localhost -p 5432 -d engine -u postgres^C
[root@dafna-web-admin dbscripts]# ./unlock_entity.sh -q -t vm -s localhost -p 5432 -d engine -u postgres
 vm_name 
---------
 DESKTOP
(1 row)



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

sf3

How reproducible:

100%

Steps to Reproduce:
1. lock a vm and the disks
2. run unlock on vm entity with -r
3. only the disks will be released but the vm still appears as locked
  
Actual results:

we are not unlocking the vm

Expected results:

we should unlock vm as well when using the -r option

Additional info:

Comment 1 Eli Mesika 2013-01-21 11:52:41 UTC
http://gerrit.ovirt.org/#/c/11252/

Comment 4 Eli Mesika 2013-01-24 17:37:51 UTC
fixed in commit : 8c05bba

Comment 6 David Botzer 2013-03-27 11:02:17 UTC
Eli,

3.2/SF11

1. I export a vm to template
2. I unlock the VM while it is exporting to template
-- vm & its disk are stopped
3. But the Template is still locked !!! and stops only when it finishes creating the Template

--> is it correct ?
3.2/SF11

Comment 7 Dafna Ron 2013-03-27 11:36:49 UTC
(In reply to comment #6)
> Eli,
> 
> 3.2/SF11
> 
> 1. I export a vm to template
> 2. I unlock the VM while it is exporting to template
> -- vm & its disk are stopped
> 3. But the Template is still locked !!! and stops only when it finishes
> creating the Template
> 
> --> is it correct ?
> 3.2/SF11

vm and template are different objects and so are their images. 
unlock of a vm will only change the vm and its images state in the db and does not change the state of any other images which are copied/cloned from it  
this behavior is correct and should also not be changes since it might create problems in the images in the lower layers.

Comment 8 David Botzer 2013-03-27 11:50:15 UTC
Fixed, 3.2/SF11
Locked VMs & disks are stopped correctly
Fixed, 3.2/SF11

Comment 9 Itamar Heim 2013-06-11 09:28:43 UTC
3.2 has been released

Comment 10 Itamar Heim 2013-06-11 09:31:46 UTC
3.2 has been released

Comment 11 Itamar Heim 2013-06-11 09:47:40 UTC
3.2 has been released


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