The cinder.volume.drivers.netapp.eseries.iscsi_driver Module

The cinder.volume.drivers.netapp.eseries.iscsi_driver Module

Volume driver for NetApp E-Series iSCSI storage systems.

class NetAppEseriesISCSIDriver(*args, **kwargs)

Bases: cinder.volume.driver.BaseVD, cinder.volume.driver.ManageableVD

NetApp E-Series iSCSI volume driver.

CI_WIKI_NAME = 'NetApp_Eseries_CI'
DRIVER_NAME = 'NetApp_iSCSI_ESeries'
VERSION = '1.0.0'
check_for_setup_error()
create_cgsnapshot(context, cgsnapshot, snapshots)
create_cloned_volume(volume, src_vref)

Creates a clone of the specified volume.

If volume_type extra specs includes ‘replication: <is> True’ the driver needs to create a volume replica (secondary) and setup replication between the newly created volume and the secondary volume.

create_consistencygroup(context, group)
create_consistencygroup_from_src(context, group, volumes, cgsnapshot=None, snapshots=None, source_cg=None, source_vols=None)
create_export(context, volume, connector)

Exports the volume.

Can optionally return a Dictionary of changes to the volume object to be persisted.

create_group(context, group)

Creates a group.

Parameters:
  • context – the context of the caller.
  • group – the Group object of the group to be created.
Returns:

model_update

model_update will be in this format: {‘status’: xxx, ……}.

If the status in model_update is ‘error’, the manager will throw an exception and it will be caught in the try-except block in the manager. If the driver throws an exception, the manager will also catch it in the try-except block. The group status in the db will be changed to ‘error’.

For a successful operation, the driver can either build the model_update and return it or return None. The group status will be set to ‘available’.

create_snapshot(snapshot)
create_volume(volume)

Creates a volume.

Can optionally return a Dictionary of changes to the volume object to be persisted.

If volume_type extra specs includes ‘capabilities:replication <is> True’ the driver needs to create a volume replica (secondary), and setup replication between the newly created volume and the secondary volume. Returned dictionary should include:

volume['replication_status'] = 'copying'
volume['replication_extended_status'] = <driver specific value>
volume['driver_data'] = <driver specific value>
create_volume_from_snapshot(volume, snapshot)
delete_cgsnapshot(context, cgsnapshot, snapshots)
delete_consistencygroup(context, group, volumes)
delete_group(context, group, volumes)

Deletes a group.

Parameters:
  • context – the context of the caller.
  • group – the Group object of the group to be deleted.
  • volumes – a list of Volume objects in the group.
Returns:

model_update, volumes_model_update

param volumes is a list of objects retrieved from the db. It cannot be assigned to volumes_model_update. volumes_model_update is a list of dictionaries. It has to be built by the driver. An entry will be in this format: {‘id’: xxx, ‘status’: xxx, ……}. model_update will be in this format: {‘status’: xxx, ……}.

The driver should populate volumes_model_update and model_update and return them.

The manager will check volumes_model_update and update db accordingly for each volume. If the driver successfully deleted some volumes but failed to delete others, it should set statuses of the volumes accordingly so that the manager can update db correctly.

If the status in any entry of volumes_model_update is ‘error_deleting’ or ‘error’, the status in model_update will be set to the same if it is not already ‘error_deleting’ or ‘error’.

If the status in model_update is ‘error_deleting’ or ‘error’, the manager will raise an exception and the status of the group will be set to ‘error’ in the db. If volumes_model_update is not returned by the driver, the manager will set the status of every volume in the group to ‘error’ in the except block.

If the driver raises an exception during the operation, it will be caught by the try-except block in the manager. The statuses of the group and all volumes in it will be set to ‘error’.

For a successful operation, the driver can either build the model_update and volumes_model_update and return them or return None, None. The statuses of the group and all volumes will be set to ‘deleted’ after the manager deletes them from db.

delete_snapshot(snapshot)
delete_volume(volume)

Deletes a volume.

If volume_type extra specs includes ‘replication: <is> True’ then the driver needs to delete the volume replica too.

do_setup(context)

Any initialization the volume driver does while starting.

ensure_export(context, volume)

Synchronously recreates an export for a volume.

extend_volume(volume, new_size)
get_pool(volume)

Return pool name where volume reside on.

Parameters:volume – The volume hosted by the driver.
Returns:name of the pool where given volume is in.
get_volume_stats(refresh=False)

Return the current state of the volume service.

If ‘refresh’ is True, run the update first.

For replication the following state should be reported: replication = True (None or false disables replication)

initialize_connection(volume, connector)

Allow connection to connector and return connection info.

Parameters:
  • volume – The volume to be attached
  • connector – Dictionary containing information about what is being connected to.
Returns conn_info:
 

A dictionary of connection information.

manage_existing(volume, existing_ref)

Manage exiting stub.

This is for drivers that don’t implement manage_existing().

manage_existing_get_size(volume, existing_ref)

Return size of volume to be managed by manage_existing.

When calculating the size, round up to the next GB.

Parameters:
  • volume – Cinder volume to manage
  • existing_ref – Driver-specific information used to identify a volume
Returns size:

Volume size in GiB (integer)

remove_export(context, volume)

Removes an export for a volume.

terminate_connection(volume, connector, **kwargs)

Disallow connection from connector.

Parameters:
  • volume – The volume to be disconnected.
  • connector – A dictionary describing the connection with details about the initiator. Can be None.
unmanage(volume)

Unmanage stub.

This is for drivers that don’t implement unmanage().

update_consistencygroup(context, group, add_volumes=None, remove_volumes=None)
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.