Change in vdsm[master]: lvm:moved metadatasize as an optional param for pv create in...

nsoffer at redhat.com nsoffer at redhat.com
Fri Mar 6 13:09:59 UTC 2015


Nir Soffer has posted comments on this change.

Change subject: lvm:moved metadatasize as an optional param for pv create in lvm module
......................................................................


Patch Set 3: Code-Review-1

(2 comments)

https://gerrit.ovirt.org/#/c/38188/3/vdsm/storage/lvm.py
File vdsm/storage/lvm.py:

Line 691:         pv = os.path.join(PV_PREFIX, pv)
Line 692:     return pv
Line 693: 
Line 694: 
Line 695: def _createpv(devices, metadataSize=0, options=tuple()):
I'm ok with allowing a pv without metadata area if you need that, but the default should not be no metadata. Lets keep this a required argument and change the code so it works for gluster use case.
Line 696:     """
Line 697:     Size for pvcreate should be with units k|m|g
Line 698:     pvcreate on a dev that is already a PV but not in a VG returns rc = 0.
Line 699:     The device is re-created with the new parameters.


Line 703:     if options:
Line 704:         cmd.extend(options)
Line 705:     if metadataSize:
Line 706:         cmd.extend(("--metadatasize", metadatasize, "--metadatacopies", "2",
Line 707:                     "--metadataignore", "y"))
When called with metadatasize=0, metadatasize is "0m" here (see line 701) so this will not do what you want.

I think what we need is to remove line 701 and do:

    if metadatasize != 0:
        cmd.extend(("--metadatasize", "%sm" % metadatasize,
                    "--metadatacopies", "2",
                    "--metadataignore", "y"))

Please verify that creating a pv without specifying metadata parameters actually does what you want.
Line 708:     cmd.extend(devices)
Line 709:     rc, out, err = _lvminfo.cmd(cmd, devices)
Line 710:     return rc, out, err
Line 711: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I00f161c0d6996219553c556125a97a01d69a4be3
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Timothy Asir <tjeyasin at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Eduardo <ewarszaw at gmail.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Sandro Bonazzola <sbonazzo at redhat.com>
Gerrit-Reviewer: Timothy Asir <tjeyasin at redhat.com>
Gerrit-Reviewer: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list