Liron Aravot has uploaded a new change for review.

Change subject: StorageDomain.getInfo - report the first pv of the metadata lv
......................................................................

StorageDomain.getInfo - report the first pv of the metadata lv

This patch adds the report of the first pv of the domain metadata lv
(for block domains) to StorageDomain.getInfo().
Currently we assume that the metadata lv is created on the first extant
of the device and verify that when performing different operations on
the domain.

As we intend to add support for operations that modify the vg
stracture (like reducing devices) - we want to prevent those
operations from being made on the first device of the metadata lv
as they might cause the metadata lv first extant to be changed from
0.

This patch adds the reporting of that info, so that the engine can
leverage the info to block such operations.

Change-Id: I32c847ae89b9f8f512c3dd8a0fff96fbc753ee5b
Signed-off-by: Liron Aravot <[email protected]>
---
M lib/api/vdsm-api.yml
M vdsm/storage/blockSD.py
2 files changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/27/63027/7

diff --git a/lib/api/vdsm-api.yml b/lib/api/vdsm-api.yml
index 514206d..8168fbb 100644
--- a/lib/api/vdsm-api.yml
+++ b/lib/api/vdsm-api.yml
@@ -5651,6 +5651,12 @@
         -   description: The Storage Domain UUID
             name: uuid
             type: *UUID
+
+        -   defaultvalue: null
+            description: The GUID of the first device containing the domain 
metadata lv (optional)
+            name: metadatadevice
+            type: string
+
         type: object
 
     StorageDomainStatus: &StorageDomainStatus
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index 11191cd..b164551 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -445,6 +445,10 @@
             # FIXME: following line.
             lvm.extendLV(self.sdUUID, volumeUUID, size)  # , isShuttingDown)
 
+    def getMetadataLVFirstDevice(self):
+        dev, _ = lvm.getFirstExt(self.sdUUID, sd.METADATA)
+        return os.path.basename(dev)
+
     @classmethod
     def getMetaDataMapping(cls, vgName, oldMapping={}):
         firstDev, firstExtent = lvm.getFirstExt(vgName, sd.METADATA)
@@ -1103,6 +1107,7 @@
         vg = lvm.getVG(self.sdUUID)  # vg.name = self.sdUUID
         info['vguuid'] = vg.uuid
         info['state'] = vg.partial
+        info['metadatadevice'] = self._manifest.getMetadataLVFirstDevice()
         return info
 
     def getStats(self):


-- 
To view, visit https://gerrit.ovirt.org/63027
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I32c847ae89b9f8f512c3dd8a0fff96fbc753ee5b
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Liron Aravot <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: gerrit-hooks <[email protected]>
_______________________________________________
vdsm-patches mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to