importcsv
Use the importcsv command to parse a comma-separated values (CSV) file to create copy sets for a session.
The CSV file is parsed and copy sets are created from the data in the file. The CSV file must contain data for all the necessary roles in the session for which the copy sets are being created.
Syntax
Parameters
- -help | -h | -?
- Lists help for the command. If you specify additional parameters and arguments, those parameters and arguments are ignored.
- -quiet
- Suppresses the confirmation prompt for this command. This flag answers yes to all confirmation prompts.
- -file file_name
- A required parameter that specifies the name of the CSV file.
- -action { add | remove }
- An optional parameter that specifies whether to add or remove copysets from a CSV file. The default action when this parameter is not specified is add.
- -keeponhw
- Specifies that all of the base relationships (Metro Mirror, Global Copy, Snapshot, and FlashCopy) on the storage system are kept even though the copy set is removed from the session. The relationships are removed from any consistency groups that are defined on the storage system. Valid only when -action is remove.
- -force
- Forces the removal of the copy set despite any errors that occur when removing the copy set relationships from the storage system. When a forced removal is complete, any relationships that remain on the storage system for that copy set must be removed manually using the storage system interface. + Valid only when -action is remove.
- session_name | -
- Specifies the name of the session for which you are creating or removing copy sets.
Alternatively, use the dash (-) to specify that input for this parameter comes from an input stream (stdin). The dash is supported only in single-shot mode.
Example: Importing a CSV file for a session
The following CSV file is named session1.csv:
#session1,
#FlashCopy,
#Oct 2 10:03:18 AM
H1,T1
DS8000:2107.FRLL1:VOL:1004,DS8000:2107.FRLL1:VOL:1104
DS8000:2107.FRLL1:VOL:1011,DS8000:2107.FRLL1:VOL:1101
DS8000:2107.FRLL1:VOL:1005,DS8000:2107.FRLL1:VOL:1105
Example: Importing a file into a session without prompting for a confirmation
The following command imports the file into the session session2 without prompting for a confirmation:
csmcli> importcsv -quiet -file session1.csv session2
The following output is returned:
IWNR2001I The pair was successfully created in session session2 for copy set DS8000:2107.FRLL1:VOL:1004 with source DS8000:2107.FRLL1:VOL:1004 and target DS8000:2107.FRLL1:VOL:1104. IWNR2001I The pair was successfully created in session session2 for copy set DS8000:2107.FRLL1:VOL:1011 with source DS8000:2107.FRLL1:VOL:1011 and target DS8000:2107.FRLL1:VOL:1101. IWNR2001I The pair was successfully created in session session2 for copy set DS8000:2107.FRLL1:VOL:1005 with source DS8000:2107.FRLL1:VOL:1005 and target DS8000:2107.FRLL1:VOL:1105.
