Bug 901971 - engine: unlock_entity.sh is not unlocking the vm, only images under the vm
engine: unlock_entity.sh is not unlocking the vm, only images under the vm
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
3.2.0
x86_64 Linux
high Severity high
: ---
: 3.2.0
Assigned To: Eli Mesika
David Botzer
infra
:
Depends On:
Blocks: 915537
  Show dependency treegraph
 
Reported: 2013-01-20 04:59 EST by Dafna Ron
Modified: 2016-02-10 14:20 EST (History)
10 users (show)

See Also:
Fixed In Version: sf5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Infra
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


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

  None (edit)
Description Dafna Ron 2013-01-20 04:59:45 EST
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 06:52:41 EST
http://gerrit.ovirt.org/#/c/11252/
Comment 4 Eli Mesika 2013-01-24 12:37:51 EST
fixed in commit : 8c05bba
Comment 6 David Botzer 2013-03-27 07:02:17 EDT
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 07:36:49 EDT
(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 07:50:15 EDT
Fixed, 3.2/SF11
Locked VMs & disks are stopped correctly
Fixed, 3.2/SF11
Comment 9 Itamar Heim 2013-06-11 05:28:43 EDT
3.2 has been released
Comment 10 Itamar Heim 2013-06-11 05:31:46 EDT
3.2 has been released
Comment 11 Itamar Heim 2013-06-11 05:47:40 EDT
3.2 has been released

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