Пример #1
0
    def initialize_connection(self, volume, connector):
        """Initialize connection between the server and the volume."""
        targets = {
            'info': {},
            'list': [],
            'lun': {},
            'iqns': {},
        }
        ldev = utils.get_ldev(volume)
        # When 'ldev' is 0, it should be true.
        # Therefore, it cannot remove 'is None'.
        if ldev is None:
            msg = utils.output_log(MSG.INVALID_LDEV_FOR_CONNECTION,
                                   volume_id=volume['id'])
            raise exception.VSPError(msg)

        if (self.find_targets_from_storage(targets, connector,
                                           self.storage_info['ports'])
                and self.conf.vsp_group_request):
            self.create_mapping_targets(targets, connector)

        utils.require_target_existed(targets)

        targets['list'].sort()
        for port in self.storage_info['ports']:
            targets['lun'][port] = False
        target_lun = int(self.map_ldev(targets, ldev))

        return {
            'driver_volume_type': self.driver_info['volume_type'],
            'data': self.get_properties(targets, connector, target_lun),
        }
Пример #2
0
    def initialize_connection(self, volume, connector):
        """Initialize connection between the server and the volume."""
        targets = {
            'info': {},
            'list': [],
            'lun': {},
            'iqns': {},
        }
        ldev = utils.get_ldev(volume)
        # When 'ldev' is 0, it should be true.
        # Therefore, it cannot remove 'is None'.
        if ldev is None:
            msg = utils.output_log(MSG.INVALID_LDEV_FOR_CONNECTION,
                                   volume_id=volume['id'])
            raise exception.VSPError(msg)

        if (self.find_targets_from_storage(
                targets, connector, self.storage_info['ports']) and
                self.conf.vsp_group_request):
            self.create_mapping_targets(targets, connector)

        utils.require_target_existed(targets)

        targets['list'].sort()
        for port in self.storage_info['ports']:
            targets['lun'][port] = False
        target_lun = int(self.map_ldev(targets, ldev))

        return {
            'driver_volume_type': self.driver_info['volume_type'],
            'data': self.get_properties(targets, connector, target_lun),
        }
Пример #3
0
    def init_cinder_hosts(self, **kwargs):
        """Initialize server-storage connection."""
        targets = kwargs.pop('targets', {'info': {}, 'list': [], 'iqns': {}})
        connector = cinder_utils.brick_get_connector_properties(
            multipath=self.conf.use_multipath_for_image_xfer,
            enforce_multipath=self.conf.enforce_multipath_for_image_xfer)
        target_ports = self.storage_info['ports']

        if target_ports:
            if (self.find_targets_from_storage(targets, connector,
                                               target_ports)
                    and self.conf.vsp_group_request):
                self.create_mapping_targets(targets, connector)

            utils.require_target_existed(targets)
Пример #4
0
    def init_cinder_hosts(self, **kwargs):
        """Initialize server-storage connection."""
        targets = kwargs.pop('targets', {'info': {}, 'list': [], 'iqns': {}})
        connector = cinder_utils.brick_get_connector_properties(
            multipath=self.conf.use_multipath_for_image_xfer,
            enforce_multipath=self.conf.enforce_multipath_for_image_xfer)
        target_ports = self.storage_info['ports']

        if target_ports:
            if (self.find_targets_from_storage(
                    targets, connector, target_ports) and
                    self.conf.vsp_group_request):
                self.create_mapping_targets(targets, connector)

            utils.require_target_existed(targets)