示例#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
示例#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
示例#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)
示例#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)