The cinder.volume.drivers.hitachi.hnas_backend Module

Hitachi Unified Storage (HUS-HNAS) platform. Backend operations.

class HnasBackend(drv_configs)

Bases: object

Back end. Talks to HUS-HNAS.

add_iscsi_conn(*args, **kwargs)

Setup the lun on on the specified target port

Parameters:
  • cmd – ssc command name
  • ip0 – string IP address of controller
  • user – string user authentication for array
  • pw – string password authentication for array
  • lun_name – id of the logical unit being extended
  • hdp – data pool of the logical unit
  • port – iSCSI port
  • tgtalias – iSCSI qualified name
  • initiator – initiator address
check_lu(cmd, ip0, user, pw, volume_name, hdp)

Checks if a given LUN is already mapped

Parameters:
  • cmd – ssc command name
  • ip0 – string IP address of controller
  • user – string user authentication for array
  • pw – string password authentication for array
  • volume_name – number of the LUN
  • hdp – storage pool of the LUN
Returns:

True if the lun is attached

Returns:

the LUN id

Returns:

Info related to the target

check_target(cmd, ip0, user, pw, hdp, target_alias)

Checks if a given target exists and gets its info

Parameters:
  • cmd – ssc command name
  • ip0 – string IP address of controller
  • user – string user authentication for array
  • pw – string password authentication for array
  • hdp – pool name used
  • target_alias – alias of the target
Returns:

True if target exists

Returns:

list with the target info

create_dup(cmd, ip0, user, pw, src_lun, hdp, size, name)

Clones a volume

Clone primitive used to support all iSCSI snapshot/cloning functions. Used for iSCSI only.

Parameters:
  • cmd – ssc command name
  • ip0 – string IP address of controller
  • user – string user authentication for array
  • pw – string password authentication for array
  • hdp – data Pool of the logical unit
  • src_lun – id of the logical unit being deleted
  • size – size of the LU being cloned. Only for logging purposes
Returns:

formated string

create_lu(cmd, ip0, user, pw, hdp, size, name)

Creates a new Logical Unit.

If the operation can not be performed for some reason, utils.execute() throws an error and aborts the operation. Used for iSCSI only

Parameters:
  • cmd – ssc command name
  • ip0 – string IP address of controller
  • user – string user authentication for array
  • pw – string password authentication for array
  • hdp – data Pool the logical unit will be created
  • size – Size (Mb) of the new logical unit
  • name – name of the logical unit
Returns:

formated string with ‘LUN %d HDP: %d size: %s MB, is successfully created’

del_iscsi_conn(cmd, ip0, user, pw, evsid, iqn, hlun)

Remove the lun on on the specified target port

Parameters:
  • cmd – ssc command name
  • ip0 – string IP address of controller
  • user – string user authentication for array
  • pw – string password authentication for array
  • evsid – EVSID for the file system
  • iqn – iSCSI qualified name
  • hlun – logical unit id
Returns:

formated string

delete_lu(cmd, ip0, user, pw, hdp, lun)

Delete an logical unit. Used for iSCSI only

Parameters:
  • cmd – ssc command name
  • ip0 – string IP address of controller
  • user – string user authentication for array
  • pw – string password authentication for array
  • hdp – data Pool of the logical unit
  • lun – id of the logical unit being deleted
Returns:

formated string ‘Logical unit deleted successfully.’

extend_vol(cmd, ip0, user, pw, hdp, lun, new_size, name)

Extend a iSCSI volume.

Parameters:
  • cmd – ssc command name
  • ip0 – string IP address of controller
  • user – string user authentication for array
  • pw – string password authentication for array
  • hdp – data Pool of the logical unit
  • lun – id of the logical unit being extended
  • new_size – new size of the LU
  • name – formated string
file_clone(cmd, ip0, user, pw, fslabel, src, name)

Clones NFS files to a new one named ‘name’

Clone primitive used to support all NFS snapshot/cloning functions.

Parameters:
  • cmd – ssc command name
  • ip0 – string IP address of controller
  • user – string user authentication for array
  • pw – string password authentication for array
  • fslabel – file system label of the new file
  • src – source file
  • name – target path of the new created file
Returns:

formated string

get_evs(cmd, ip0, user, pw, fsid)

Gets the EVSID for the named filesystem.

Parameters:
  • cmd – ssc command name
  • ip0 – string IP address of controller
  • user – string user authentication for array
  • pw – string password authentication for array
Returns:

EVS id of the file system

get_existing_lu_info(cmd, ip0, user, pw, fslabel, lun)

Returns the information for the specified Logical Unit.

Returns the information of an existing Logical Unit on HNAS, according to the name provided.

Parameters:
  • cmd – the command that will be run on SMU
  • ip0 – string IP address of controller
  • user – string user authentication for array
  • pw – string password authentication for array
  • fslabel – label of the file system
  • lun – label of the logical unit
get_hdp_info(cmd, ip0, user, pw, fslabel=None)

Gets the list of filesystems and fsids.

Parameters:
  • cmd – ssc command name
  • ip0 – string IP address of controller
  • user – string user authentication for array
  • pw – string password authentication for array
  • fslabel – filesystem label we want to get info
Returns:

formated string with filesystems and fsids

get_iscsi_info(cmd, ip0, user, pw)

Gets IP addresses for EVSs, use EVSID as controller.

Parameters:
  • cmd – ssc command name
  • ip0 – string IP address of controller
  • user – string user authentication for array
  • pw – string password authentication for array
Returns:

formated string with iSCSI information

get_nfs_info(cmd, ip0, user, pw)

Gets information on each NFS export.

Parameters:
  • cmd – ssc command name
  • ip0 – string IP address of controller
  • user – string user authentication for array
  • pw – string password authentication for array
Returns:

formated string

get_targetiqn(cmd, ip0, user, pw, targetalias, hdp, secret)

Obtain the targets full iqn

Returns the target’s full iqn rather than its alias. :param cmd: ssc command name :param ip0: string IP address of controller :param user: string user authentication for array :param pw: string password authentication for array :param targetalias: alias of the target :param hdp: data pool of the logical unit :param secret: CHAP secret of the target :returns: string with full IQN

get_targetsecret(cmd, ip0, user, pw, targetalias, hdp)

Returns the chap secret for the specified target.

Parameters:
  • cmd – ssc command name
  • ip0 – string IP address of controller
  • user – string user authentication for array
  • pw – string password authentication for array
  • targetalias – alias of the target
  • hdp – data pool of the logical unit
Return secret:

CHAP secret of the target

get_version(cmd, ver, ip0, user, pw)

Gets version information from the storage unit

Parameters:
  • cmd – ssc command name
  • ver – string driver version
  • ip0 – string IP address of controller
  • user – string user authentication for array
  • pw – string password authentication for array
Returns:

formatted string with version information

rename_existing_lu(cmd, ip0, user, pw, fslabel, new_name, vol_name)

Renames the specified Logical Unit.

Renames an existing Logical Unit on HNAS according to the new name provided.
Parameters:
  • cmd – command that will be run on SMU
  • ip0 – string IP address of controller
  • user – string user authentication for array
  • pw – string password authentication for array
  • fslabel – label of the file system
  • new_name – new name to the existing volume
  • vol_name – current name of the existing volume
run_cmd(*args, **kwargs)

Run a command on SMU or using SSH

Parameters:
  • cmd – ssc command name
  • ip0 – string IP address of controller
  • user – string user authentication for array
  • pw – string password authentication for array
Returns:

formated string with version information

set_targetsecret(cmd, ip0, user, pw, targetalias, hdp, secret)

Sets the chap secret for the specified target.

Parameters:
  • cmd – ssc command name
  • ip0 – string IP address of controller
  • user – string user authentication for array
  • pw – string password authentication for array
  • targetalias – alias of the target
  • hdp – data pool of the logical unit
  • secret – CHAP secret of the target

Previous topic

The cinder.volume.drivers.hitachi.hbsd_snm2 Module

Next topic

The cinder.volume.drivers.hitachi.hnas_iscsi Module

Project Source

This Page