예제 #1
0
파일: iscsi.py 프로젝트: stev3bb/cinder
    def delete_snapshot(self, snapshot):
        """Driver entry point for deleting a snapshot."""
        LOG.info('iXsystems Delete Snapshot')
        LOG.debug('delete_snapshot %s', snapshot['name'])
        freenas_snapshot = ix_utils.generate_freenas_snapshot_name(
            snapshot['name'], self.configuration.ixsystems_iqn_prefix)
        freenas_volume = ix_utils.generate_freenas_volume_name(
            snapshot['volume_name'], self.configuration.ixsystems_iqn_prefix)

        self.common._delete_snapshot(freenas_snapshot['name'],
                                     freenas_volume['name'])
예제 #2
0
파일: iscsi.py 프로젝트: stev3bb/cinder
    def create_volume_from_snapshot(self, volume, snapshot):
        """Creates a volume from snapshot."""
        LOG.info('iXsystems Craete Volume From Snapshot')
        LOG.info('create_volume_from_snapshot %s', snapshot['name'])

        existing_vol = ix_utils.generate_freenas_volume_name(
            snapshot['volume_name'], self.configuration.ixsystems_iqn_prefix)
        freenas_snapshot = ix_utils.generate_freenas_snapshot_name(
            snapshot['name'], self.configuration.ixsystems_iqn_prefix)
        freenas_volume = ix_utils.generate_freenas_volume_name(
            volume['name'], self.configuration.ixsystems_iqn_prefix)
        freenas_volume['size'] = volume['size']
        freenas_volume['target_size'] = volume['size']

        self.common._create_volume_from_snapshot(freenas_volume['name'],
                                                 freenas_snapshot['name'],
                                                 existing_vol['name'])
        self.common._create_iscsitarget(freenas_volume['target'],
                                        freenas_volume['name'])
예제 #3
0
파일: iscsi.py 프로젝트: stev3bb/cinder
    def initialize_connection(self, volume, connector):
        """Driver entry point to attach a volume to an instance."""
        LOG.info('iXsystems Initialise Connection')
        freenas_volume = ix_utils.generate_freenas_volume_name(
            volume['name'], self.configuration.ixsystems_iqn_prefix)
        if not freenas_volume['name']:
            # is this snapshot?
            freenas_volume = ix_utils.generate_freenas_snapshot_name(
                volume['name'], self.configuration.ixsystems_iqn_prefix)

        LOG.info('initialize_connection Entry: %s \t %s', volume['name'],
                 connector['host'])
        properties = {}
        properties['target_discovered'] = False
        properties['target_portal'] = ix_utils.get_iscsi_portal(
            self.configuration.ixsystems_server_hostname,
            self.configuration.ixsystems_server_iscsi_port)
        properties['target_iqn'] = freenas_volume['iqn']
        properties['volume_id'] = volume['id']

        LOG.debug('initialize_connection data: %s', properties)
        return {'driver_volume_type': 'iscsi', 'data': properties}