Timothy Asir has uploaded a new change for review.

Change subject: gluster: create pv with custom dataalignment value
......................................................................

gluster: create pv with custom dataalignment value

Blivet creates pv with 1mb dataalignment forcefully for
whatever given value. So that we have used vdsm.storage.lvm
module to create pv. But due to some lvm configuration
VDSM also creates pv with 1mb dataalignment value.
Seperate bug oppend for vdsm to fix this issue in
https://bugzilla.redhat.com/show_bug.cgi?id=1235086
This patch uses lvm pvcreate command as a workaround till
this bug fixed in either vdsm or blivet.

Change-Id: I5eb58f81679729af4d3dc34bc9f7edba757acc67
Signed-off-by: Timothy Asir Jeyasingh <tjeya...@redhat.com>
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1178705
---
M vdsm/gluster/storagedev.py
1 file changed, 9 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/82/42782/1

diff --git a/vdsm/gluster/storagedev.py b/vdsm/gluster/storagedev.py
index eb8b103..ec18d19 100644
--- a/vdsm/gluster/storagedev.py
+++ b/vdsm/gluster/storagedev.py
@@ -32,7 +32,6 @@
 from blivet.devices import LVMThinLogicalVolumeDevice
 from blivet import udev
 
-import storage.lvm as lvm
 from vdsm import utils
 
 import fstab
@@ -41,6 +40,9 @@
 
 
 log = logging.getLogger("Gluster")
+_pvCreateCommandPath = utils.CommandPath("lvcreate",
+                                         "/sbin/pvcreate",
+                                         "/usr/sbin/pvcreate",)
 _vgCreateCommandPath = utils.CommandPath("vgcreate",
                                          "/sbin/vgcreate",
                                          "/usr/sbin/vgcreate",)
@@ -156,9 +158,12 @@
     def _createPV(deviceList, alignment=0):
         def _createAlignedPV(deviceList, alignment):
             for dev in deviceList:
-                rc, out, err = lvm._createpv(
-                    [dev.path], metadataSize=0,
-                    options=('--dataalignment', '%sK' % alignment))
+                # bz#1178705: Blivet always creates pv with 1MB dataalignment
+                # Workaround: Till blivet fixes the issue, we use lvm pvcreate
+                rc, out, err = utils.execCmd([_pvCreateCommandPath.cmd,
+                                              '--dataalignment',
+                                              '%sk' % alignment,
+                                              dev.path])
                 if rc:
                     raise ge.GlusterHostStorageDevicePVCreateFailedException(
                         dev.path, alignment, rc, out, err)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5eb58f81679729af4d3dc34bc9f7edba757acc67
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Timothy Asir <tjeya...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to