Package: ucamdsm
Dell SCIntroductionThe CLI developed in this project allows the user to interact with Dell SCs using REST API.With this CLI, you can list the existing volumes, servers, etc, on the Dell SCs, clone volumes, create snapshots, replace existing volumes with a golden image, etc. It is also able to configure system/etc/fstabandmultipathwhen needed in some operations like volume mapping and mounting.Running the ApplicationPrerequisitesrequests 2.22.0Python 3.6InstallationTo install theucamdsmpippackage:pip3installucamdsmCLIThe help shows how to useucamdsm. Some detailed example can be found onhttps://confluence.uis.cam.ac.uk/display/SYS/Dell+SC+automation+and+scripting.usage:ucamdsm[-h][--dsm_hostDSM_HOST][--dsm_portDSM_PORT][--dsm_userDSM_USER][--dsm_passwordDSM_PASSWORD][--is_secureIS_SECURE][--record_configRECORD_CONFIG][--fileFILE]{list,delete_volume,replace_volume,clone_volume,create_snapshot,delete_recycled_vols,map_volume,unmap_volume,volume_from_snapshot}...

ManageDellStorageManagerobjectsviaRESTAPI.

positionalarguments:{list,delete_volume,replace_volume,clone_volume,create_snapshot,delete_recycled_vols,map_volume,unmap_volume,volume_from_snapshot}listListDellSCobjects.Example:ucamdsm--dsm_useruser--dsm_passwordabc123list--objectscsdelete_volumeDeleteDellSCVolume.Example:ucamdsm--dsm_useruser--dsm_passwordabc123delete_volume--vol_wwn12345replace_volumeClonethevolumemountedonsourcemountpointandmountitondestinationmountpoint.Then,deletethevolumewasinitiallymountedondestinationmountpoint.Example:ucamdsm--dsm_useruser--dsm_passwordabc123replace_volume--src_mp/src--dst_mp/dstclone_volumeCreateasnapshotwithlabelofavolumewithWWN,createaviewvolumefromthesnapshot,then,maptheviewvolumetolocalserverandmountitontargetmountpoint.Example:ucamdsm--dsm_useruser--dsm_passwordabc123clone_volume--vol_wwn12345--replay_labeltest1--clone_namename--target_mp/targetcreate_snapshotCreateasnapshotofthevolumemountedonagivenmountpoint.Example:ucamdsm--dsm_useruser--dsm_passwordabc123create_snapshot--mp/mp--replay_labeltest1--retention5delete_recycled_volsDeleterecycledvolumeswhoseWWNsarelistedinafile.Example:ucamdsm--dsm_useruser--dsm_passwordabc123delete_recycled_vols--wwns_file/tmp/recycled_vols_wwns.txtmap_volumeMapsthevolumetolocalserverandmountsitonthespecifiedmountpoint.Example:ucamdsm--dsm_useruser--dsm_passwordabc123map_volume--wwnvol_wwn--mp/d10unmap_volumeUnmapsthevolumefromlocalserver.Volumemustbeunmounted.Example:ucamdsm--dsm_useruser--dsm_passwordabc123create_snapshot--wwnvol_wwnvolume_from_snapshotCloneavolumefromasnapshotandmountitonagivenmountpoint.Example:ucamdsm--dsm_useruser--dsm_passwordabc123volume_from_snapshot--sidsnapshot_id--rpidreplay_profile_id--vol_nameclone_name--folder_idvolume_folder_id--mptarget_mountpoint

optionalarguments:-h,--helpshowthishelpmessageandexit--dsm_hostDSM_HOSTDSMhostname.Default:sc-data-ma.admin.cam.ac.uk--dsm_portDSM_PORTDSMport.Default:3033--dsm_userDSM_USERDSMDataCollectorusername--dsm_passwordDSM_PASSWORDDSMDataCollectorpassword--is_secureIS_SECURESecureconnection.Default:False--record_configRECORD_CONFIGRecordmultipathandfilesystemconfigdetails.Default:False(donotrecordsystemconfigdetails)--fileFILEReadargumentsfromjsonfileFor instance, to get the list of Dell Storage Centers:$ucamdsm--dsm_hosthost--dsm_useruser--dsm_passwordpasswordlist--objectscs--outputjson07/10/201904:24:32PMINFOConnectedtoDSM.APIVersion:3.5,ConnectionID:007/10/201904:24:32PMINFOAPIcallApiConnection/ApiConnection/0/StorageCenterListsucceeded.07/10/201904:24:32PMINFOListofscs:{"SB Storage Center":{"instanceId":"000","hostOrIP":"x.x.x.x"},"WCDC Storage Center":{"instanceId":"000","hostOrIP":"y.y.y.y"}}07/10/201904:24:32PMINFOLogoutofDSM:True.You get prompted foruserandpasswordif they are not specified in the command.$ucamdsm--dsm_hosthostlist--objectscs--outputjson
Username:user
Password:07/16/201904:59:53PMINFOConnectedtoDSM.APIVersion:3.5,ConnectionID:007/16/201904:59:53PMINFOAPIcallApiConnection/ApiConnection/0/StorageCenterListsucceeded.07/16/201904:59:53PMINFOListofscs:{"SB Storage Center":{"instanceId":"000","hostOrIP":"x.x.x.x"},"WCDC Storage Center":{"instanceId":"000","hostOrIP":"y.y.y.y"}}07/16/201904:59:53PMINFOLogoutofDSM:True.The CLI can also read arguments from ajsonfile like the one below:{"dsm_host":"abc","dsm_port":3033,"dsm_user":"user","dsm_password":"password","is_secure":false,"record_config":false,"subparser":"list","object":"scs","output":"json"}To use a config file, use the option--file:$ucamdsm--fileargs.json07/16/201905:05:57PMINFOConnectedtoDSM.APIVersion:3.5,ConnectionID:007/16/201905:05:58PMINFOAPIcallApiConnection/ApiConnection/0/StorageCenterListsucceeded.07/16/201905:05:58PMINFOListofscs:{"SB Storage Center":{"instanceId":"000","hostOrIP":"x.x.x.x"},"WCDC Storage Center":{"instanceId":"000","hostOrIP":"y.y.y.y"}}07/16/201905:05:58PMINFOLogoutofDSM:True.Application loggingLogs generated by the CLI are located in/var/log/ucamdsm/.Resourceshttps://github.com/openstack/cinder