The cinder.volume.drivers.hitachi.hnas_nfs Module

Volume driver for HNAS NFS storage.

class HNASNFSDriver(*args, **kwargs)

Bases: cinder.volume.drivers.nfs.NfsDriver

Base class for Hitachi NFS driver.

Executes commands relating to Volumes.

Version history:

Version 1.0.0: Initial driver version
Version 2.2.0: Added support to SSH authentication
Version 3.0.0: Added pool aware scheduling
Version 4.0.0: Added manage/unmanage features
Version 4.1.0: Fixed XML parser checks on blank options
Version 5.0.0: Remove looping in driver initialization
               Code cleaning up
               New communication interface between the driver and HNAS
               Removed the option to use local SSC (ssh_enabled=False)
               Updated to use versioned objects
               Changed the class name to HNASNFSDriver
               Deprecated XML config file
               Added support to manage/unmanage snapshots features
               Fixed driver stats reporting
CI_WIKI_NAME = 'Hitachi_HNAS_CI'
VERSION = '5.0.0'
create_cloned_volume(*args, **kwargs)

Creates a clone of the specified volume.

Parameters:
  • volume – reference to the volume being created
  • src_vref – reference to the source volume
Returns:

the provider_location of the cloned volume

create_snapshot(*args, **kwargs)

Create a snapshot.

Parameters:snapshot – dictionary snapshot reference
Returns:the provider_location of the snapshot created
create_volume(*args, **kwargs)

Creates a volume.

Parameters:volume – volume reference
Returns:the volume provider_location
create_volume_from_snapshot(*args, **kwargs)

Creates a volume from a snapshot.

Parameters:
  • volume – volume to be created
  • snapshot – source snapshot
Returns:

the provider_location of the volume created

delete_snapshot(*args, **kwargs)

Deletes a snapshot.

Parameters:snapshot – dictionary snapshot reference
do_setup(context)

Perform internal driver setup.

extend_volume(*args, **kwargs)

Extend an existing volume.

Parameters:
  • volume – dictionary volume reference
  • new_size – int size in GB to extend
Raises:

InvalidResults

get_volume_stats(refresh=False)

Get volume stats.

Parameters:refresh – if it is True, update the stats first.
Returns:dictionary with the stats from HNAS
_stats[‘pools’] = {
‘total_capacity_gb’: total size of the pool, ‘free_capacity_gb’: the available size, ‘QoS_support’: bool to indicate if QoS is supported, ‘reserved_percentage’: percentage of size reserved, ‘max_over_subscription_ratio’: oversubscription rate, ‘thin_provisioning_support’: thin support (True), }
manage_existing(*args, **kwargs)

Manages an existing volume.

The specified Cinder volume is to be taken into Cinder management. The driver will verify its existence and then rename it to the new Cinder volume name. It is expected that the existing volume reference is an NFS share point and some [/path]/volume; e.g., 10.10.32.1:/openstack/vol_to_manage or 10.10.32.1:/openstack/some_directory/vol_to_manage

Parameters:
  • volume – cinder volume to manage
  • existing_vol_ref – driver-specific information used to identify a

volume :returns: the provider location :raises: VolumeBackendAPIException

manage_existing_get_size(*args, **kwargs)

Returns the 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_vol_ref – existing volume to take under management
Returns:

the size of the volume or raise error

Raises:

VolumeBackendAPIException

manage_existing_snapshot(snapshot, existing_ref)
manage_existing_snapshot_get_size(snapshot, existing_ref)
unmanage(*args, **kwargs)

Removes the specified volume from Cinder management.

It does not delete the underlying backend storage object. A log entry will be made to notify the Admin that the volume is no longer being managed.

Parameters:volume – cinder volume to unmanage
unmanage_snapshot(snapshot)

Previous topic

The cinder.volume.drivers.hitachi.hnas_iscsi Module

Next topic

The cinder.volume.drivers.hitachi.hnas_utils Module

Project Source

This Page