Bug 745154

Summary: Failure in deactivating master LV shouldn't fail creation of storage domain.
Product: [Retired] oVirt Reporter: Leonid Natapov <lnatapov>
Component: vdsmAssignee: Ayal Baron <abaron>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: abaron, amureini, bazulay, hateya, iheim, jkt, milan.dlauhy, plyons
Target Milestone: ---   
Target Release: 3.3.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: storage
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-04 23:11:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
vdsm log
none
vdsm.log none

Description Leonid Natapov 2011-10-11 14:20:28 UTC
Created attachment 527451 [details]
vdsm log

During creating of storage domain on ISCSI, failer in deactivating master LV shouldn't fail creation of storage domain. Full log attached.



Thread-426::ERROR::2011-10-11 15:26:30,011::task::868::TaskManager.Task::(_setError) Unexpected error
 Traceback (most recent call last):
 File "/usr/share/vdsm/storage/task.py", line 876, in _run
 return fn(*args, **kargs)
 File "/usr/share/vdsm/storage/hsm.py", line 1199, in public_createStorageDomain
 domClass=domClass, typeSpecificArg=typeSpecificArg, version=domVersion)
 File "/usr/share/vdsm/storage/sdf.py", line 60, in create
 version=version)
 File "/usr/share/vdsm/storage/blockSD.py", line 322, in create
 lvm.deactivateLVs(vgName, MASTERLV)
 File "/usr/share/vdsm/storage/lvm.py", line 1050, in deactivateLVs
_setLVAvailability(vgName, toDeactivate, "n")
 File "/usr/share/vdsm/storage/lvm.py", line 799, in _setLVAvailability

Comment 2 Dan Kenigsberg 2011-10-11 19:16:40 UTC
Leonid, please explain what brought you to the described condition. Also elaborate why this is a bug. In my opinion, if we cannot deactivate an LV in the created VG, we're in deep trouble and the creation should fail.

Comment 3 Leonid Natapov 2011-10-12 07:05:22 UTC
I wanted to add storage domain to my setup. An attempt to create storage domain failed with the error "RHEVM General Error",so I was unable to add SD. After investigating this issue with Igor was agreed to open a BZ.


2011-10-11 15:36:56,668 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.BrokerCommandBase] (http-0.0.0.0-8443-1) Vds: purple-vds1
2011-10-11 15:36:56,668 ERROR [org.ovirt.engine.core.vdsbroker.VDSCommandBase] (http-0.0.0.0-8443-1) Command CreateStorageDomainVDS execution failed. Exceptio
n: VDSGenericException: VDSErrorException: Failed in vdscommand to CreateStorageDomainVDS, error = Cannot deactivate Logical Volume: ('General Storage Excepti
on: ("5 [] [\'  LV c604a566-e520-40fd-b633-20c2461731e9/master in use: not deactivating\']\\nc604a566-e520-40fd-b633-20c2461731e9/[\'master\']",)',)
2011-10-11 15:36:56,668 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.CreateStorageDomainVDSCommand] (http-0.0.0.0-8443-1) FINISH, CreateStorageDomainVDSCommand, log id: 648b83f

Comment 4 Milan Dlauhy 2012-01-31 10:44:41 UTC
Created attachment 558594 [details]
vdsm.log

Comment 5 Milan Dlauhy 2012-01-31 10:45:09 UTC
I have the same problem with the latest packages also:

vdsm-4.9.3.2-0.fc16.x86_64
ovirt-engine-3.0.0_0001-1.4.fc16.x86_64

Traceback (most recent call last):
  File "/usr/share/vdsm/storage/task.py", line 863, in _run
    return fn(*args, **kargs)
  File "/usr/share/vdsm/logUtils.py", line 38, in wrapper
    res = f(*args, **kwargs)
  File "/usr/share/vdsm/storage/hsm.py", line 1919, in createStorageDomain
    domClass, typeSpecificArg, storageType, domVersion)
  File "/usr/share/vdsm/storage/blockSD.py", line 359, in create
    lvm.deactivateLVs(vgName, MASTERLV)
  File "/usr/share/vdsm/storage/lvm.py", line 1036, in deactivateLVs
    _setLVAvailability(vgName, toDeactivate, "n")
  File "/usr/share/vdsm/storage/lvm.py", line 732, in _setLVAvailability
    raise error(str(e))
CannotDeactivateLogicalVolume: Cannot deactivate Logical Volume: ('General Storage Exception: ("5 [] [\'  LV 0559e478-4190-48e6-8aac-fd
2348c141da/master in use: not deactivating\']\\n0559e478-4190-48e6-8aac-fd2348c141da/[\'master\']",)',)

Comment 6 Igor Lvovsky 2012-04-04 15:27:08 UTC
 Leonid,
I think it already solved .
Can you please try it on latest vdsm build 
https://brewweb.devel.redhat.com/buildinfo?buildID=208039

Comment 7 Haim 2012-05-10 03:36:04 UTC
vdsm should decide how they want to proceed with this bug (behavior). 
there is no actual need on deactivating special volumes after creation, so this function that does it may be deprecated. 
please resolve & move to on_qa when ready.

Comment 8 Ayal Baron 2013-09-04 23:11:49 UTC
Although the code still does not ignore the error, I don't think we'll 'fix' this for several reasons:
1. I haven't seen this issue since (i.e. almost never happens)
2. There is no reason for the lv to be in use, so failing in deactivating it is signalling that something wrong is going on.