示例#1
0
    def _create_task(self, cb, params):

        pvname = params['pv_name']

        cb('entering task to create pv')
        try:

            cb('create pv')
            part = PartitionModel(objstore=self.objstore)
            part_name = pvname.split('/')[-1]
            dev_type = part.lookup(part_name)
            if dev_type['type'] == 'part':
                if 'dasd' in dev_type['name']:
                    type = '4'
                    change_dasdpart_type(part_name, type)
                else:
                    type = '8e'   # hex value for type Linux LVM
                    part.change_type(part_name, type)
            utils._create_pv(pvname)

        except OperationFailed:
            raise OperationFailed("GINPV00002E",
                                  {'name': pvname})

        cb('OK', True)
    def _create_task(self, cb, params):

        pvname = params['pv_name']

        cb('entering task to create pv')
        try:

            cb('create pv')
            part = PartitionModel(objstore=self.objstore)
            part_name = pvname.split('/')[2]
            type = '8e'   # hex value for type Linux LVM
            part.change_type(part_name, type)
            utils._create_pv(pvname)

        except OperationFailed:
            wok_log.error("PV create failed")
            raise OperationFailed("GINPV00002E",
                                  {'pvname': pvname})

        cb('OK', True)
示例#3
0
    def _create_task(self, cb, params):

        pvname = params['pv_name']

        cb('entering task to create pv')
        try:

            cb('create pv')
            part = PartitionModel(objstore=self.objstore)
            part_name = pvname.split('/')[-1]
            dev_type = part.lookup(part_name)
            if dev_type['type'] == 'part':
                if 'dasd' in dev_type['name']:
                    type = '4'
                    change_dasdpart_type(part_name, type)
                else:
                    type = '8e'  # hex value for type Linux LVM
                    part.change_type(part_name, type)
            utils._create_pv(pvname)

        except OperationFailed:
            raise OperationFailed("GINPV00002E", {'name': pvname})

        cb('OK', True)