Exemple #1
0
    def destroy(self):
        """ Destroy the device. """
        if not self.exists:
            raise VolumeGroupError("device has not been created", self.name)

        # set up the pvs since lvm needs access to them to do the vgremove
        self.setupParents(orig=True)

        # this sometimes fails for some reason.
        try:
            lvm.vgreduce(self.name, [], rm=True)
            lvm.vgremove(self.name)
        except lvm.LVMError:
            raise VolumeGroupError("Could not completely remove VG", self.name)
        finally:
            self.exists = False
Exemple #2
0
    def destroy(self):
        """ Destroy the device. """
        if not self.exists:
            raise VolumeGroupError("device has not been created", self.name)

        # set up the pvs since lvm needs access to them to do the vgremove
        self.setupParents(orig=True)

        # this sometimes fails for some reason.
        try:
            lvm.vgreduce(self.name, [], rm=True)
            lvm.vgremove(self.name)
        except lvm.LVMError:
            raise VolumeGroupError("Could not completely remove VG", self.name)
        finally:
            self.exists = False
Exemple #3
0
    def reduce(self, pv_list):
        """ Remove the listed PVs from the VG. """
        if not self.exists:
            raise VolumeGroupError("device has not been created", self.name)

        lvm.vgreduce(self.name, pv_list)
Exemple #4
0
    def reduce(self, pv_list):
        """ Remove the listed PVs from the VG. """
        if not self.exists:
            raise VolumeGroupError("device has not been created", self.name)

        lvm.vgreduce(self.name, pv_list)