示例#1
0
文件: blockSD.py 项目: openSUSE/vdsm
    def extend(self, devlist):
        mapping = self.readMetadataMapping().values()
        if self.getVersion() in VERS_METADATA_LV:
            if len(mapping) + len(devlist) > MAX_PVS:
                raise se.StorageDomainIsMadeFromTooManyPVs()

        self._extendlock.acquire()
        try:

            knowndevs = list(multipath.getMPDevNamesIter())
            devices = []

            for dev in devlist:
                if dev in knowndevs:
                    devices.append(dev)
                else:
                    raise se.InvalidPhysDev(dev)

            lvm.extendVG(self.sdUUID, devices)
            self.updateMapping()
            newsize = self.metaSize(self.sdUUID)
            lvm.extendLV(self.sdUUID, sd.METADATA, newsize)

        finally:
            self._extendlock.release()
示例#2
0
    def extend(self, devlist):
        mapping = self.readMetadataMapping().values()
        if self.getVersion() in VERS_METADATA_LV:
            if len(mapping) + len(devlist) > MAX_PVS:
                raise se.StorageDomainIsMadeFromTooManyPVs()

        self._extendlock.acquire()
        try:

            knowndevs = list(multipath.getMPDevNamesIter())
            devices = []

            for dev in devlist:
                if dev in knowndevs:
                    devices.append(dev)
                else:
                    raise se.InvalidPhysDev(dev)

            lvm.extendVG(self.sdUUID, devices)
            self.updateMapping()
            newsize = self.metaSize(self.sdUUID)
            lvm.extendLV(self.sdUUID, sd.METADATA, newsize)

        finally:
            self._extendlock.release()
示例#3
0
    def _getCachedExtraCfg(self):
        if not self._filterStale:
            return self._extraCfg

        with self._filterLock:
            if not self._filterStale:
                return self._extraCfg

            self._extraCfg = _buildConfig(multipath.getMPDevNamesIter())
            _updateLvmConf(self._extraCfg)
            self._filterStale = False

            return self._extraCfg
示例#4
0
文件: lvm.py 项目: zofuthan/vdsm
    def _getCachedExtraCfg(self):
        if not self._filterStale:
            return self._extraCfg

        with self._filterLock:
            if not self._filterStale:
                return self._extraCfg

            self._extraCfg = _buildConfig(multipath.getMPDevNamesIter())
            _updateLvmConf(self._extraCfg)
            self._filterStale = False

            return self._extraCfg
示例#5
0
文件: blockSD.py 项目: humblec/vdsm
    def extend(self, devlist, force):
        with self._extendlock:
            if self.getVersion() in VERS_METADATA_LV:
                mapping = self.readMetadataMapping().values()
                if len(mapping) + len(devlist) > MAX_PVS:
                    raise se.StorageDomainIsMadeFromTooManyPVs()

            knowndevs = set(multipath.getMPDevNamesIter())
            unknowndevs = set(devlist) - knowndevs
            if unknowndevs:
                raise se.InaccessiblePhysDev(unknowndevs)

            lvm.extendVG(self.sdUUID, devlist, force)
            self.updateMapping()
            newsize = self.metaSize(self.sdUUID)
            lvm.extendLV(self.sdUUID, sd.METADATA, newsize)
示例#6
0
文件: blockSD.py 项目: oVirtorg/vdsm
    def extend(self, devlist, force):
        with self._extendlock:
            if self.getVersion() in VERS_METADATA_LV:
                mapping = self.readMetadataMapping().values()
                if len(mapping) + len(devlist) > MAX_PVS:
                    raise se.StorageDomainIsMadeFromTooManyPVs()

            knowndevs = set(multipath.getMPDevNamesIter())
            unknowndevs = set(devlist) - knowndevs
            if unknowndevs:
                raise se.InaccessiblePhysDev(unknowndevs)

            lvm.extendVG(self.sdUUID, devlist, force)
            self.updateMapping()
            newsize = self.metaSize(self.sdUUID)
            lvm.extendLV(self.sdUUID, sd.METADATA, newsize)