Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

lsmcli(1) [centos man page]

LSMCLI(1)							  libStorageMgmt							 LSMCLI(1)

NAME
lsmcli - LibStorageMgmt command line interface SYNOPSIS
lsmcli command [GLOBAL OPTIONS]...[COMMAND OPTIONS]... DESCRIPTION
lsmcli is the command line tool for the libStorageMgmt library. This tool allows users to do one off storage related management operations or to script management of their storage. PREREQUISITES
* libstoragemgmt daemon. The daemon 'lsmd' is needed by every lsmcli command for socket initial communication. * URI(Uniform Resource Identifier) URI is used to in deify which and how the plugin should communicate with storage array. The valid URI format is: plugin://<username>@host:<port>?<query_string_parameters> plugin+ssl://<username>@host:<port>?<query_string_parameters> Quick examples(please refer to "LibStorageMgmt User Guide" for detail): * Simulator: sim:// simc:// * NetApp ONTAP: ontap://username@host ontap+ssl://username@host * Storage Array support SMI-S(like, EMC CX/VNX, HDS AMS, IBM SVC/DS, and etc): smis://username@host:<port>?namespace=<namespace> smis+ssl://username@host:<port>?namespace=<namespace> You can pass URI to lsmcli via one of these ways: * Using '-u, --uri' argument. * Using 'LSMCLI_URI' environment variable. * Add this line into $HOME/.lsmcli: uri=<URI> * Password All plugins require authentication(except simulator). You can pass it to lsmcli via one of these ways: * Using '-P, --prompt' argument to prompt fro password. * Using 'LSMCLI_PASSWORD' environment variable. GLOBAL OPTIONS
--version Show program's version number and exit -h, --help Show this help message and exit. Will show help message of certain command if command defined. -u <URI>, --uri <URI> Uniform Resource Identifier (env LSMCLI_URI) -P, --prompt Prompt for password (env LSMCLI_PASSWORD) -H, --human Print sizes in human readable format (e.g., KiB, MiB, GiB, TiB, PiB, EiB) -t <SEP>, --terse <SEP> Print output in terse form with "SEP" as a record separator without header unless '--header' defined. --header Include the header with terse -e, --enum Display enumerated types as numbers instead of text -f, --force Bypass confirmation prompt for data loss operations -w <WAIT>, --wait=<WAIT> Command timeout value in ms (default = 30s) -b Run the command asynchronously instead of waiting for completion. The lsmcli command will exit with exit code(7) and job id will be written to STDOUT when a command is still executing on the storage array. Use 'job-status --id <job id>' to inquire on the progress of the command. Some array or plugin might not support running asynchronous job, in that circumstance, -b will be effective, command will wait until finished. -s, --script Displaying data in script friendly way. Without this option, data is displayed in this manner: ID | Name | Member IDs -------------------------------------+-------+------------- 87720e90-3a83-11df-b8bf-00a0980ad71b | aggr0 | ID_A | | ID_B aa0ffc70-3dba-11df-b8cf-00a0980ad71b | aggr1 | ID_C | | ID_D With this option, data is displayed in this manner. -------------------------------------------------- ID | 87720e90-3a83-11df-b8bf-00a0980ad71b Name | aggr0 Member IDs | ID_A | ID_B -------------------------------------------------- ID | aa0ffc70-3dba-11df-b8cf-00a0980ad71b Name | aggr1 Member IDs | ID_C | ID_D -------------------------------------------------- COMMANDS
list List information on LSM objects --type <TYPE> Required. Valid values are: VOLUMES, INITIATORS, POOLS, FS, SNAPSHOTS, EXPORTS, DISKS, NFS_CLIENT_AUTH, ACCESS_GROUPS, SYSTEMS, PLUGINS. --fs <FS_ID> Required for --type=SNAPSHOTS. List the snapshots of certain filesystem. PLUGINS will list all supported plugins of LSM, not only the current one. -o, --optional Optional. Valid for POOLS and DISKS to retrieve optional data if available. job-status Retrieve information about a job. --job <JOB_ID> capabilities Retrieves array capabilities --sys <SYS_ID> Required. ID of the system to query for capabilities plugin-info Retrieves plugin description and version for current URI. volume-create Creates a volume (AKA, LUN or logical volume). --name <NAME> Required. Volume name --size <SIZE> Required. Volume size(See SIZE OPTION for allowed formats). --pool <POOL_ID> Required. ID of pool. --provisioning <THINP_TYPE> Optional. Provisioning type. Valid values are: DEFAULT, THIN, FULL. DEFAULT means let plugin choose. THIN means requiring a Thin Provisioning enabled volume. FULL means requiring a fully allocated volume. volume-delete Delete a volume given its ID --vol <VOL_ID> Required. The ID of volume to delete. volume-resize Re-sizes a volume, requires: --vol <VOL_ID> Required. The ID of volume to resize. --size <NEW_SIZE> Required. The new size of volume.(See SIZE OPTION for allowed formats). Due to boundary alignment concern, array might return a volume with slightly bigger size than requested. volume-replicate Creates a new volume and replicates provided volume to it. --vol <VOL_ID> Required. The ID of volume to replicate. --name <NAME> Required. The name for new volume to hold replicated data. --rep-type <REPL_TYPE> Required. Valid types of replication are SNAPSHOT, CLONE, COPY, MIRROR_ASYNC, MIRROR_SYNC. TODO: Explain every type here. --pool <POOL_ID> Optional. The ID of pool where the new volume should create in. If not define, replicate volume and source volume will be in the same pool. volume-replicate-range Replicates a portion of a volume, like only replicate the first 1024 block of certain volume to another volume. --src-vol <SRC_VOL_ID> Required. The ID of replication source volume. --dst-vol <DST_VOL_ID> Required. The ID of replication destination volume. --rep-type <REPL_TYPE> Required. Valid types of replication are SNAPSHOT, CLONE, COPY, MIRROR_ASYNC, MIRROR_SYNC. TODO: Explain every type here. --src-start <SRC_START_BLK> Required. Replication source volume start block number. Must in pair with --count and --dst-start. If you have several non- continuous block ranges, you can define repeatly define this arugument, like '--src-start 0 --dst-start 0 --count 1024 --src-start 2048 --dst-start 2048 --count 2048' --dst-start <DST_START_BLK> Required. Replication destination volume start block number. Must in pair with --count and --src-start. --count <BLK_COUNT> Required. The count of replicated block startting from --src-startblock. Must in pair with --src-start and --dst-start. volume-replicate-range-block-size Size of each replicated block on a system in bytes. --sys <SYS_ID> Required. ID of the system to query for replicated block size. volume-dependants Returns True if volume has a dependant child, like replication. --vol <VOL_ID> Required. The ID of volume to query dependency. volume-dependants-rm Removes volume dependencies(like replication). --vol <VOL_ID> Required. The ID of volume to remove dependency. volume-access-group Lists the access group(s) that have access to the provided volume. --vol <VOL_ID> Required. The ID of volume to query access. volumes-accessible-initiator Lists the initiator(s) that have access to the provided volume. --vol <VOL_ID> Required. The ID of volume to query access. access-group-grant Grant a access group the RO or RW access to certain volume. Like LUN masking or NFS export. --vol <VOL_ID> Required. The ID of volume to access. --ag <AG_ID> Required. The ID of access group to grant. --access <ACCESS> Optional. Permission of access, valid values are RO, RW. Default value is RW. access-group-revoke Revoke an access group the RO or RW access to certain volume. --vol <VOL_ID> Required. The ID of volume to revoke. --ag <AG_ID> Required. The ID of access group to revoke. access-group-create Create an access group. --name <AG_NAME> Required. The human friendly name for new access group. --init <INIT_ID> Required. The first initiator ID of new access group. --init-type <INIT_TYPE> Required. The initiator type. Valid values are: WWPN, WWNN, ISCSI, HOSTNAME, SAS. --sys <SYS_ID> Required. The ID of system where this access group should reside on. access-group-add Adds an initiator to an access group. --ag <AG_ID> Required. ID of access group. --init <INIT_ID> Required. ID of initiator to add. --init-type <INIT_TYPE> Required. The initiator type. Valid values are: WWPN, WWNN, ISCSI, HOSTNAME, SAS. access-group-remove Removes an initiator from an access group. --ag <AG_ID> Required. ID of access group. --init <INIT_ID> Required. ID of initiator to remove. access-group-delete Delete an access group. --ag <AG_ID> Required. ID of access group to delete. access-grant Grants access to an initiator to a volume --init <INIT_ID> Required. ID of initiator to grant access. --init-type <INIT_TYPE> Required. The initiator type. Valid values are: WWPN, WWNN, ISCSI, HOSTNAME, SAS. --vol <VOL_ID> Required. The ID of volume to grant access. access-revoke Removes access for an initiator to a volume --vol <VOL_ID> Required. The ID of volume to revoke. --init <INIT_ID> Required. ID of initiator to revoke. access-group-volumes Lists the volumes that the access group has been granted access to. --ag <AG_ID> Required. The ID of access group to query. initiators-granted-volume Lists the initiators that have been granted access to specified volume --init <INIT_ID> Required. The ID of initiator to query. iscsi-chap Configures ISCSI inbound/outbound CHAP authentication --init <INIT_ID> Required. The ID of iSCSI initiator to configure. --in-user <IN_USER> Optional. Inbound CHAP user name. --in-pass <IN_PASS> Optional. Inbound CHAP password --out-user <OUT_USER> Optional. Outbound CHAP user name. --out-pass <OUT_PASS> Optional. Outbound CHAP password fs-create Creates a filesystem --name <NAME> Required. Human friendly name for new filesystem. --size <SIZE> Required. Volume size(See SIZE OPTION for allowed formats). --pool <POOL_ID> Required. ID of pool to hold the new filesystem. fs-delete Delete a filesystem --fs <FS_ID> Required. ID of the filesystem to delete. fs-resize Resizes a filesystem --fs <FS_ID> Required. ID of the filesystem to resize. --size <NEW_SIZE> Required. New size of filesystem. See SIZE OPTION for allowed formats. fs-export Export a filesystem via NFS. --fs <FS_ID> Required. ID of the filesystem to export. --exportpath <EXPORT_PATH> Optional. NFS server export path. e.g. '/foo/bar'. --anonuid <ANONY_UID> Optional. The UID(User ID) to map to anonymous user. --anongid <ANONY_GID> Optional. The GID(Group ID) to map to anonymous user. --auth-type <AUTH_TYPE> Optional. NFS client authentication type. This is just a place holder, not supported yet. --root-host <ROOT_HOST> Optional. Repeatable. The host/IP has root access. For two or more hosts/IPs: --ro-host <RO_HOST> Optional. Repeatable. The host/IP has read only access. For two or more hosts/IPs: '--ro-host hostA --ro-host hostB'. --rw-host <RW_HOST> Optional. The host/IP has read/write access. For two or more hosts/IPs: fs-unexport Delete an NFS export --fs <FS_ID> Required. ID of the filesystem to unexport. fs-clone Creates a file system clone. The 'clone' means point in time read writeable space efficient copy of data, aka read-writable snapshot. --src-fs <SRC_FS_ID> Required. The ID of the filesystem to clone. --dst-name <DST_FS_NAME> Required. The name for newly created destination file system. --backing-snapshot <BE_SS_ID> Required. TODO: explain 'backing-snapshot' here. fs-snap-create Creates a snapshot of certain filesystem. The snapshot means using copy-on-write technology to ensure the data will not be erased for future changes since snapshot creation time(PIT, point in time). The ordinal filesystem will still be read writable, the snapshot will be read only containing the data of PIT. --name <SNAP_NAME> Required. The human friendly name of new snapshot. --fs <FS_ID> Required. The ID of filesystem to create snapshot against. --file <FILE_PATH> Optional. Repeatable. With this option defined, the snapshot will only containing the defined file/path. For two or more files/paths: fs-snap-delete Deletes a snapshot. --snap <SNAP_ID> Required. The ID of snapshot to delete. --fs <FS_ID> Required. The ID of filesystem. TODO. No idea why we need fs_id. fs-snap-restore Restores a FS or specified files to previous snapshot state. This will discard all the changes to filesystem since snapshot. --fs <FS_ID> Required. The ID of filesystem to restore. --snap <SNAP_ID> Required. The ID of snapshot to restore. --file <FILE_PATH> Optional. Repeatable. With this option defined, will only restore the defined files. For two or more files/paths: --fileas <NEW_FILE_PATH> Optional. Repeatable. With this option defined, the restored file will be saved to defined path or filename. For two or more files/paths: fs-dependants Returns True if a child dependency(snapshot or clone) exists. --fs <FS_ID> Required. The ID of filesystem to query. --file <FILE_PATH> Optional. Repeatable. Only check defined files for snapshot or clone. For two or more files/paths: '--file fileA --file pathB'. fs-dependants-rm Removes filesystem dependencies(snapshot or clone). --fs <FS_ID> Required. The ID of filesystem to remove dependency. --file <FILE_PATH> Optional. Repeatable. Only remove defined files for snapshot or clone. For two or more files/paths: '--file fileA --file pathB'. file-clone Creates a clone of a file (thin provisioned). --src <SRC_FILE_PATH> Required. Repeatable. Source file to clone (relative path). For two or more files/paths: '--src fileA --src fileB'. --dst <DST_FILE_PATH> Required. Repeatable. Destination file to clone (relative path). For two or more files/paths: pool-create Creates a storage pool. --name <POOL_NAME> Required. Human friendly name for new pool. --size <POOL_SIZE> Optional. The size of new pool. Due to data alignment and other issue, the size of new pool might largger than requested. See SIZE OPTION for allowed formats. --member-id <MEM_ID> Optional. Repeatable. Pool member ID, could be ID of Disk/Pool/Volume. Should be used with --member-type. For two or more members: '--member-id DISK_A --member DISK_B --raid-type RAID1 --member-type DISK' --member-type <MEM_TYPE> Optional. Valid values are: DISK, POOL, VOLUME. The 'DISK' member type means pool is created from disk(s), might has RAID. The 'VOLUME' member type means pool is created from volume(s), might has RAID. The 'POOL' member type means pool is allocated from other pool(s). --raid-type <RAID_TYPE> Optional. The RAID type of new pool. Valid values are: JBOD, RAID0, RAID1, RAID5, RAID6, RAID10, RAID50, RAID51, RAID60, RAID61. --thinp-type <THINP_TYPE> Optional. The Thin Provisioning type of new pool. Valid values are: THIN, THICK. 'THIN' indicates pool can create Thin Pro- visioning volume or filesystem. 'THICK' indicates pool can only create fully allocated volume or filesystem. --member-count <MEM_COUNT> Optional. The count of members. If '--member-id' is not defined or less than '--member-count', plugin/array will automati- cally choose the rest. pool-delete Deletes a storage pool. --pool <POOL_ID> Required. The ID of pool to delete. SIZE OPTION
--size <SIZE> Storage space size. Format is '<number>' + '<prefix>'. Example: "10GiB", "20.5MB". No postfix indicates bytes. Valid prefixes are: KiB, # 2^10 Bytes MiB, # 2^20 Bytes GiB, # 2^30 Bytes TiB, # 2^40 Bytes PiB, # 2^50 Bytes EiB, # 2^60 Bytes KB, # 10^3 Bytes MB, # 10^6 Bytes GB, # 10^9 Bytes TB, # 10^12 Bytes PB, # 10^15 Bytes EB, # 10^17 Bytes These prefixes are supported also, but not recommended: K, M, G, T, P, E, # equal to KiB, MiB, and etc k, m, g, t, p, e, # equal to KiB, MiB, and etc FILES
~/.lsmcli lsmcli configuration file, containing name-value pairs separated by '='. The only currently supported configuration option is 'uri', such as 'uri=ontap://user@filer.example.com'. Configuration options in .lsmcli are only used if not overridden by command-line option or environment variable. EXAMPLES (command output omitted for brevity) Simulator, list pools (no password required) $ lsmcli -u sim:// -l POOLS NetApp, list volumes (prompting for password) $ lsmcli -u ontap://root@host/ -l VOLUMES -P SMI-S, list systems (prompting for password) $ lsmcli -u smispy://username@host:5988/?namespace=root/interop -l SYSTEMS -P Targetd, list pools (using env variables for URI and password) $ export LSMCLI_URI=targetd://username@host:18700 $ export LSMCLI_PASSWORD=<password> $ lsmcli -l POOLS NexentaStor, create volume (using environment variables for URI and password) $ export LSMCLI_URI='nstor://user@host' $ export LSMCLI_PASSWORD=<password> $ lsmcli volume-create --name volume_name --size 1TiB --pool default SMI-S, create volume (using environment variables for URI and password) $ export LSMCLI_URI='smispy+ssl://user@host:5989?namespace=root/emc' $ export LSMCLI_PASSWORD=<password> $ lsmcli volume-create --name volume_name --size 1TiB --pool default ENVIRONMENT
LSMCLI_URI The URI for the storage array in question. LSMCLI_PASSWORD The password to use for the array. NOTES
Plugin installation Plugins are installed individually except for the simulator which is always included. Secure sockets layer (SSL) All of the plugins (except the simulator) support SSL when communicating from the plugin to the array. This is accomplished by adding "+ssl" to the plugin and usually by selecting a different port number from non-SSL communications. $ lsmcli -u smispy+ssl://username@host:5989/?namespace=interop list --type SYSTEMS -P SSL error: certificate verify failed When using SMI-S plugin with SSL against self-signed SMI-S provider, lsmcli normally quit with 'SSL error: certificate verify failed'. Please contact SMI-S provider support to setup the self-signed certificate in your system. If you prefer to bypass the certificate check, add 'no_ssl_verify=yes' at the end of URI, for example: smispy+ssl://admin@emc-smi:5989?namespace=root/emc&no_ssl_verify=yes BUGS
Please report bugs to <libstoragemgmt-devel@lists.sourceforge.net> AUTHOR
Tony Asleson <tasleson@redhat.com> Gris Ge <fge@redhat.com> lsmcli 0.0.24 January 2014 LSMCLI(1)
Man Page