Change in vdsm[master]: detach: Support force detach on orphaned Storage Domains.

mlipchuk at redhat.com mlipchuk at redhat.com
Wed Jun 25 22:14:04 UTC 2014


Maor Lipchuk has posted comments on this change.

Change subject: detach: Support force detach on orphaned Storage Domains.
......................................................................


Patch Set 4:

(4 comments)

http://gerrit.ovirt.org/#/c/29042/4/vdsm/storage/hsm.py
File vdsm/storage/hsm.py:

Line 756:         vars.task.getExclusiveLock(STORAGE, spUUID)
Line 757:         pool = self.getPool(spUUID)
Line 758:         if sdUUID == pool.masterDomain.sdUUID:
Line 759:             raise se.CannotDetachMasterStorageDomain(sdUUID)
Line 760:         dom = sdCache.produce(sdUUID=sdUUID)
> This is true if this delete the domain, but this just modify single line in
I think that log can be useful here.
I have added an except and a log as suggested in the first patch
we should still fail with the DomainDoesNotExists.
Line 761:         dom.acquireHostId(pool.id)
Line 762:         try:
Line 763:             dom.acquireClusterLock(pool.id)
Line 764:             try:


Line 757:         pool = self.getPool(spUUID)
Line 758:         if sdUUID == pool.masterDomain.sdUUID:
Line 759:             raise se.CannotDetachMasterStorageDomain(sdUUID)
Line 760:         dom = sdCache.produce(sdUUID=sdUUID)
Line 761:         dom.acquireHostId(pool.id)
> Sure this is better - but why not move into StorageDomain.forceDetach() ?
moved this to private method
Line 762:         try:
Line 763:             dom.acquireClusterLock(pool.id)
Line 764:             try:
Line 765:                 for domPoolUUID in dom.getPools():


Line 766:                     dom.detach(domPoolUUID)
Line 767:             finally:
Line 768:                 dom.releaseClusterLock()
Line 769:         finally:
Line 770:             dom.releaseHostId(pool.id)
> Looks ok. However, this block of code is obviously a method of the StorageD
Since we are dealing with a domain related to the detach operation I think that this can also be implemented here as well
Line 771:         pool.forcedDetachSD(sdUUID)
Line 772: 
Line 773:     @public
Line 774:     def detachStorageDomain(self, sdUUID, spUUID, msdUUID=None,


Line 767:             finally:
Line 768:                 dom.releaseClusterLock()
Line 769:         finally:
Line 770:             dom.releaseHostId(pool.id)
Line 771:         pool.forcedDetachSD(sdUUID)
> ok
done
Line 772: 
Line 773:     @public
Line 774:     def detachStorageDomain(self, sdUUID, spUUID, msdUUID=None,
Line 775:                             masterVersion=None, options=None):


-- 
To view, visit http://gerrit.ovirt.org/29042
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4a6fb01775f7c834a3466e45b9b7ed9b4bd5c3be
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <mlipchuk at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipchuk at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list