Restoring virtual disks using a CSV file
To specify different options for parallel restore operations, you can use a CSV file.
Before you begin
Command-line restore provides a wide range of options that are applied simultaneously to a number of virtual machines. This works well for a large number of machines using the same settings, but it does not provide flexibility in supporting parallel restore operations with different settings.
As an alternative to the command-line syntax, you can use a comma separated values (CSV) file to define the list of virtual machines to restore, using a subset of the available options (-vmname, -datastore, -datacenter, -host, -pitdate, and -pittime). Using a CSV file provides more granularity than pure command-line syntax and can deal with more complex situations.
CSV files can be output from standard spreadsheet applications, providing ease-of-use and avoiding complex command line syntax. You can add one or more columns to store notes and observations: only the column headings defined below will be recognized and acted on. In some versions of vSphere Web client you can generate a CSV file from any list view. In the Inventory List, you can use the Export List functionality to create a CSV report listing all VMs in a host cluster. This output can provide a starting point for the CSV file you use to drive bulk restore operations.
| Heading | Description | Usage |
|---|---|---|
| Virtual Machine Name | The name of the virtual machine to be restored. | No wildcard characters are allowed. Case-sensitive. This column is mandatory. |
| New Virtual Machine Name | The name of the virtual machine that is restored. | This column uses the same syntax as the -vmname option. Optional. You can leave this column blank if you want to reuse the existing name. |
| New Datastore | The new datastore to which the virtual hard disks are restored. | This column uses the same syntax as the -datastore option. Optional. You can leave this column blank if you want to reuse the existing datastore. |
| New Datacenter | The new datacenter with which the virtual machine should be associated. | Uses the same syntax as the -datacenter option. Optional. You can leave this column blank if you want to reuse the existing datacenter. |
| New Host | The new host to which the virtual machine will be restored. | This column uses the same syntax as the -host option. Optional. You can leave this column blank if you want to reuse the existing host. |
| PITDATE | The point-in-time date from which the backup is specified. | This column uses the same syntax as the -pitdate option. Optional. You can leave this column blank to indicate the active backup should be restored. This column is required if PITTIME is specified in the CSV file. PITDATE dates should use the format set by the DATEFORMAT option. The default varies by locale in Windows. The default is DATEFORMAT 1 in Linux. |
| PITTIME | The point-in-time time of day from which the backup is specified. | This column uses the same syntax as the -pittime option. Optional. You can leave this column blank to indicate you want to use the active backup or if only the PITDATE is specified. PITTIME times should use the format set by TIMEFORMAT option. The default varies by locale in Windows. The default is TIMEFORMAT 1 in Linux. |
Example CSVs:
This is an example of how a CSV file looks when open in a spreadsheet view:
Virtual Machine Name New Virtual Machine Name New Host New Datastore New Datacenter, NOTES1 NOTES2 PITDATE PITTIME
VM1 *-DR_restore esx4.ibm.com DS_8 DC_RecoverSite1 group1
VM2 *-DR_restore esx4.ibm.com DS_8 DC_RecoverSite1 group1
VM3 *-DR_restore esx4.ibm.com DS_8 DC_RecoverSite1 group1
VM4 *-DR_restore esx5.ibm.com DS_10 DC_RecoverSite1 group2
VM5 *-DR_restore esx5.ibm.com DS_10 DC_RecoverSite1 group2
- <date> is replaced by the date of the restore.
- <time> is replaced by the time of the restore.
- <timestamp> is replaced by a combination of <date> and <time> outputs.
This is an example of a CSV file exported to a comma-separated text file.
Virtual Machine Name,New Virtual Machine Name,New Host,New Datastore,New Datacenter,NOTES1,NOTES2,PITDATE,PITTIME
Tiny Linux VM,Tiny Linux VM -restore,,,,,,,
lucasTestVM10,* -restore,,,,,,10/03/2017,10:35 AM
big-cet-4TB,,devesx06.storage.tucson.ibm.com,,,,10/05/207,,
This CSV will restore three virtual machines with a different set of options for each virtual machine. The columns NOTES1 and NOTES2 are ignored.
Open a command prompt and change to the directory: cd
"C:\Program Files\IBM\StorageProtect\baclient".
Open a terminal window and change to the directory: cd
/opt/tivoli/tsm/client/ba/bin.