Ejemplo n.º 1
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()
Ejemplo n.º 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()
Ejemplo n.º 3
0
    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)
Ejemplo n.º 4
0
    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)