by Giovanni B. Perotti (Italy) 1. 2. 3. 4. 5. Table of contents Introduction 11. About it 12. Prerequisites 13. Installation Set up 21. Defining an image catalog 22. Defining a virtual tape drive 23. Loading an image catalog into a virtual tape drive Save and Transfer 31. Transferring virtual save volumes to a remote system 32. Performing a save to a virtual tape 33. Customizing save command parameters 34. Displaying the save contents of a virtual tape 35. Backing up virtual tape volumes to real tape volumes Restore FAQ A single command to 1. Save the system on virtual tapes 2. Send the save to a remote system 3. Backup the save on tape volumes 11-About it While IBM System i blade servers are invading the iseries market, more and more customers with multiple systems or partitions would like to save on tape units and to have their system saves transferred to a system equipped with tape drives. This open source utility provides a solution based on a single command that allows to save the system on virtual tape volumes, send the tape volume images to another system, and have it copy the tape images to real tape volumes. 12-Prerequisites OS/400 release V6R1 or subsequent ILE RPG IV Compiler, product 5722WDS, opt. 31. Note that the ILE RPG IV Compiler is needed to compile VRTSAV sources. One this is done, you may save library VRTSAV and install it on another system, even not equipped with the ILE RPG IV Compiler. However, make sure to run command VRTSAV/INSTALL to complete the installation. If you plan to transfer virtual save volumes to a remote system to have them copied to real tapes, we recommend that you also install also the Easy400-distributed free open-source Object Distribution Facility (ODF). ODF may be very useful for transferring back to the source system objects restored on the remote system. 13-Installation Download file vrtsav.zip from the Easy400 download page and unzip it. Follow the Readme.txt instructions to upload and to restore library VRTSAV. On the IBM System i run the following procedure: STRREXPRC SRCMBR(INSTALL) SRCFILE(VRTSAV/QREXSRC) It does the following: creates service program VRTSAV/VRTSAV creates modules and programs in library VRTSAV restores IFS directory /vrtsav runs command VRTSAV/INSTALL to create and to populate library VRTSAVDATA. This library will contain local user data. Duplicates some VRTSAV commands to library QGPL.
Virtual tape support on IBM System i started with OS/400 release 5.4. You may find some detail documentation on IBM Redboook "i5/os V5R4 Virtual Tape: A Guide to Planning and Implementation". May we recommend that you read at least Chapter 1, Introduction to virtual tape. Basically, to define a virtual tape you have to go through three steps: 1. define an image catalog simulating to be set of tape volumes on the Integrated File System 2. define a virtual tape device 3. load the virtual tape device with the image catalog. 1-Define an image catalog As per the mentioned Redbook, a number of system commands are used to define virtual tapes, please refer to Chapter 3, Implementing virtual tape storage. VRTSAV provides its own commands to make this setup easier. Command vrtsav/wrkimg Figure 2a - Command WRKIMG Enter 1 for the option and, for example, SAVSYS for the name of the image catalog to be created, then press Enter. Figure 2b - Creating an image catalog You receive the prompt of command vrtsav/addimg: Figure 2c - Command ADDIMG Through this command you are going to define the size, the number and the names of the virtual tape reels that will contain your saves. This command will generate images of your virtual tape reels in an IFS directory created
automatically and named /images/tape/savsys. These images will have the same name you assign to the volumes, and their sizes will be dynamic, that is they will be inflated while a save is performed. For the volume size, enter the the capacity in megabyte of a tape reel of yours, for instance 400,000. For the volume prefix, enter 3 letters, for instance VOL. Enter the number of volumes that you estimate needed to contain your saves, for instance 1. Should the number of volumes result not enough to contain a save, the system would automatically generate new ones with prefix GEN. Figure 2d - Input to command ADDIMG The IFS image catalog is generated, and you receive the screen in Figure 2e. Figure 2e - Image catalog generated 2-Define a virtual tape Command vrtsav/wrkvrttap Press F22 from the screen in Figure 2e to run command vrtsav/wrkvrtapp: Figure 2f - Command WRKVRTAPP Enter 1 for the option and, for example, TAPVRT01 for the name of the virtual tape to be created, then press Enter.
Figure 2g - Creating a virtual tape You receive the prompt of command vrtsav/crtvrttap: Figure 2h - Command vrtsav/crtvrttap Add some text description and press Enter to receive the prompt of system command CRTDEVTAP (press the Enter key again to display all parameters): Figure 2i - System command CRTDEVTAP Press the Enter key to run command CRTDEVTAP. You receive the following screen: Figure 2j - Virtual tape created 3-Load the virtual tape device with the image catalog Select the virtual tape with option 22 to display the available image catalogs:
Figure 2k - Select the image catalog to be connected (see Note 1 at the end of this page) Select with a 1 the image catalog to be connected (loaded into the virtual tape). You receive the following screen: Figure 2l - Image catalog now connected to the virtual tape Press F3 to exit from WRKVRTTAP and to return to the WRKIMG screen: Figure 2m - WRKIMG screen when virtual tape connected Press F3 again to exit from the WRKIMG screen. NOTE 1 - After selecting the catalog image to be connected to the virtual tape, you may receive an error message (MCH5204) saying the resource VRTTAPnn is not available, thus causing the image catalog fail to be loaded into the virtual tape. In such a case, do the following: i. go back to the screen in figure 2j and delete the failing virtual device ii. follow the procedure from figure 2f on, to re-create the same virtual tape device, iii. however, when you come to the screen in Figure 2i (system command CRTDEVTAP), in parameter Resource name, instead of leaving *VRT, enter a specific resource name, VRTTAPnn, where nn is a value in the range 01-35. NOTE 2 - In this page we have documented a set up process that starts with command vrtsav/wrkimg and goes through command vrtsav/wrkvrttap. A setup process can also proceed the opposite way, starting with command vrtsav/wrkvrttap and completing with command vrtsav/wrkimg. NOTE 3 - You may use the setup technique documented in this page to set up several virtual tape drives. Up to 35 virtual tape drives can be defined. You can use a virtual tape drive in the same way as you would use a real tape drive, the only difference being that its tape reels are replaced by image catalog volumes. For instance you can save individual libraries on virtual tapes and perform restore operations from them.
You can copy (command DUPTAP) the virtual tapes to real tape volumes and store them safely, and you can copy real tape volumes to virtual tapes, for instance to perform restore operations.
The VTRSAV utility features a single command, vrtsavsys that allows to a. save important sections of the system on a virtual tape b. transfer the save on virtual tape (the image catalog connected to it) to a remote system via FTP c. backup the save on a real tape drive of the remote system Of course, if your system is equipped with a real tape drive, you do not need steps b) and c), you may just need step a). We shall discuss first the transfer, then the save, though they do occur in the opposite order. 31. 32. 33. 34. 35. Transferring a save to a remote system How to transmit to another system a save stored on a virtual tape Performing a save to a virtual tape A command performing multiple saves on a virtual tape Customizing save command parameters How to set your options for the multiple save command Displaying the save contents of a virtual tape Backing up virtual tape volumes to real tape volumes 31-Transferring virtual tape volumes to a remote system The VTRSAV utility includes a command, named TfrVrtDta, that allows to transfer virtual tape volumes (usually containing a save) to a remote system. This command, in order to operate, has two requirements: i. The source system (the one where the save has been performed) must know something about the remote system intended to receive the save ii. The remote system (or target system, the one intended to receive the save) must have defined a virtual tape exactly the same (same name, same image catalog, only the resource nam of the virtual tape device can be different) as it is defined on the source system. This can be easily done by installing the VRTSAV utility also on the target system and by replicating the setup done on the source system. There are 3 commands dealing with the transfer: a. To define, on the source system, the information needed for the target system, you must execute command DFNRMTSYS: Figure 3a - Command vrtsav/dfnrmtsys You need to type: 1. the IP address of the remote (target) system, or *NONE if you do not want to user the "transfer save" facility 2. the name of a user profile, and 3. its password (you are also requested to confirm the password) 4. the name of the real tape drive on the remote system that will be used to backup the transferred saves, or *NONE if you do not want to backup on tape the transferred tapes 5. the tape density that will be used on backup operations 6. the device end option 7. an optional command that you want be executed on the remote system at the end of the transfer activity. These data are used by command TfrVrtDta when starting a FTP session to the remote system. b. Command vrtsav/tfrvrtdta This command starts a FTP session to the remote system. During this session it transfers the save image into the virtual tape drive of the remote system having the same name and the same image catalog as the source virtual tape drive, and, if requested so, duplicates to real tape volumes the virtual volumes containing the save. If you use command vrtsavsys you do not need to launch the TfrVrtDta command, because that can be requested from the command vrtsavsys itself. You may want to use command TfrVrtDta, either manually or within a program, to transfer to the remote system a save performed without command vrtsavsys. Command TfrVrtDta looks as follow:
Figure 3b - Command vrtsav/tfrvrtdta You must tell The name of the virtual tape where the save was stored. Whether if the save, once transferred to the remote system, should be copied to real tape volumes. If command TfrVrtDta is executed in an interactive session, it submits a a batch job. c. Command vrtsav/tfrdsplog Use this command to display - on the source system - the FTP log generated by the FTP session started from command TfrVrtDta. This command, due to its refresh capabilities, can be used even while the transfer is active. 32-Performing a save to a virtual tape Performing a save of whatever type (commands SAVSYS, SAVLIB, SAVOBJ, SAV, etc.) to a virtual tape is no problem. Do the following: 1. Make sure that the virtual tape device is online and that the appropriate image catalog is loaded into it. You can do that by running command vrtsav/vrytapon(virtual_tape_device_name) 2. Run the save command, as an example SAVLIB LIB(QGPL) DEV(virtual_tape_device_name) 3. If you want to send the image to the remote system (and optionally copy it to real tape), run command vrtsav/tfrvrtdta The VRTSAV utility features a special command, named VrtSavSys aimed to fit most common save needs, to optionally request the transfer of the save to a remote system, and to optionally copy the save to a remote real tape drive. Command vrtsav/vrtsavsys: Figure 3c - Command vrtsav/vrtsavsys Virtual tape device (DEV) Name of the virtual device (defined via command VRTSAV/WRKVRTTAP) to be used for the save operation. Use *LAST to refer to the virtual tape device already used in the last VRTSAVSYS save, if any. Save all (SAVALL) *YES to save all the following system sections *NO to display the list of the system sections that can be saved. Save User Libraries (SAVLIBS) *YES to save all the user libraries (same as command SAVLIB LIB(*ALLUSR)) *NO to skip this save step. Save Integrated File System (SAVIFS) *YES to save all the IFS directories *NO to skip this save step. Save Document Library Objects (SAVDLO) *YES to save all the document library objects (same as command SAVDLO) *NO to skip this save step. Save Configuration Data (SAVCFG) *YES to save all the configuration data (same as command SAVCFG) *NO to skip this save step. Save Security Data (SAVSEC) *YES to save all the security data (same as command SAVSEC) *NO to skip this save step. Transfer data to remote system (TFRVRTDTA) *NO to skip the FTP transfer step. The transfer to a remote system can be started later on via command VRTSAV/TFRVRTDTA. *YES to transfer via FTP the virtual tape data to the user specified remote system. The transfer takes place via a FTP session initiated from a TFRVRTDTA issued from the program as soon as the saves have been completed. Command TFRDSPLOG may be used to browse the log of the FTP session. Prerequisites: The remote system receiving a copy of the virtual tape data must have been defined
through command DFNRMTSYS (Define the remote system). On the remote system a virtual tape unit with the same name and the same tape volumes must have been defined through commands WRKVRTTAP (Work with virtual tapes) and WRKIMG (Work with image catalogs). Duplicate tape volumes (DUPTAP) *YES to have the virtual tape volumes duplicated to real tape volumes once the transfer to the remote system is complete *NO to skip this step. The virtual tape volumes transferred to the remote system can be duplicated later on to real tape volumes through a DUPTAP command entered manually. If command vrtsavsys is executed in an interactive session, it submits a a batch job. 33-Customizing save command parameters Command vrtsav/vrtsavsys, when performing its save commands (SAVLIB, SAV, SAVDLO, SAVCFG and SAVSECDTA) does use the command default parameters. For some of these commands, you may want to change the values of given parameters. This section tells how you can do it. Command wrksavparm allows to store, for each of the supported save commands, your desired parameter values. This is how Command vrtsav/wrksavparm shows up: Figure 3d - Command vrtsav/wrksavparm - Initial screen Select the save comand you want to work with and press Enter. The currently customized parameters are shown: Figure 3e - Command vrtsav/wrksavparm - Currently customized parameters for command SAVLIB Press F4 to prompt the SAVLIB command:
Figure 3f - SAVLIB prompt Set the SAVLIB parameters according to your need and press Enter. You go back to this screen: Figure 3g - Command vrtsav/wrksavparm - Newly customized parameters for command SAVLIB Press F13 to store your new parameters and to return to the initial screen of comand vrtsav/wrksavparm (Figure 3d). 34-Displaying the save contents of a virtual tape Operate in this way: i. Use the following command to load the image catalog into the virtual tape device and to vary online the virtual tape device: vrtsav/vrytapon DEV(virtual_device_name) ii. Use the following command to display the save contents of a virtual tape: DSPTAP DEV(virtual_tape_device_name) DATA(*SAVRST) 35-Backing up virtual tape volumes to real tape volumes Operate in this way: i. Use the following command to load the image catalog into the virtual tape device and to vary online the virtual tape device: vrtsav/vrytapon DEV(virtual_device_name) ii. Use the following command to duplicate virtual tape volumes to real tape volumes: DUPTAP DEV(virtual_tape_device_name) TODEV(real_tape_device_name) Note that you may use command vrtsav/tfrvrtdta FROMDEV(virtual_tape_device_name) DUPTAP(*YES) to transfer a virtual tape to a remote system and back it up on a real tape volume.
When the time comes for recovering objects, the actions to be taken depend on the following: Whether your backup on tape was performed on the source system or on the remote system Whether you have used command vrtsav/vrtsavsys or some other procedure of yours to performs the save. Here are some possible scenarios. Scenario 1 - Restore objects from the last save on virtual tape Do the following: A. Run command vrtsav/vrytapon DEV(virtual_device_name) to make the virtual tape image catalog available. B. Run command DSPTAP DEV(virtual_tape_device_name) DATA(*SAVRST) to make sure that you are referring to the desired save contents. C. Run the appropriate restore command specifying parameter DEV(virtual_tape_device_name) Scenario 2 - Restore large amount of objects from a save tape generated on the remote system Use this approach when you need to restore a large amount of objects spread across libraries and/or IFS directories. A. Upload the appropriate virtual tape volume(s) on the remote system. There are two possible cases: a. On the source system you used command vrtsav/vrtsavsys... TFRVRTDTA(*YES) DUPTAP(*YES) to perform the save, to transfer the virtual tape image to the remote system and to backup it on tape, or you performed the save on virtual tape with your own commands, but you used command vrtsav/tfrvrtdta... DUPTAP(*YES) to transfer the virtual tape image to the remote system and to backup it on tape. In such cases, on the remote system i. Run command vrtsav/duptapvrt FROMDEV(real_device_name) TOVRTDEV(virtual_device_name) to upload the appropriate save data to the virtual tape. b. On the source system you used your own commands to perform the save on virtual tape and/or to transfer the virtual image to the remote system and to have it backed up on tape. In such a case, on the remote system i. Run command vrtsav/vrytapon DEV(virtual_device_name) to make the virtual tape image catalog available. ii. Run command DUPTAP FROMDEV(real_device_name) TODEV(virtual_device_name) to upload the appropriate save data to the virtual tape. B. Transfer the save image to the local system: run command vrtsav/tfrvrtdta FROMDEV(virtual_device_name) DUPTAP(*NO) Please note that on the remote system you must have defined the source system via command vrtsav/dfnrmtsys. C. Restore the desired objects on the local system: See Scenario 1. Scenario 3 - Restore library objects from a save tape generated on the remote system Use this approach when you need to restore a library or a subset of library objects. A. On the remote system, create a temporary library (do not use library QTEMP) B. On the remote system, restore - from the appropriate save tape- restore the desired library or set of library objects needed by the source system. In the restore command, specify the temporary library name in parameter RSTLIB. C. On the remote system, save the temporary library into a save file. D. Use the Object Distribution Facility (ODF) command ODSTR to send this save file to the source system. E. On the source system, restore the objects from the save file to the appropriate library, by specifting its name in parameter RSTLIB.
This page collects the most frequent questions asked by the users of this utility. 1. How can I shrink (reduce to a minimum size) the storage allocated by virtual volumes? Use the following procedure to initialize the virtual volumes (all data there will be lost) of a given image catalog and to reduce to a minimum the allocated storage: 1. Type command VRTSAV/WRKIMG to list all the image catalogs known to the VRTSAV utility 2. Select with option 7=Initialize_virtual_volumes the image catalog you care for, and press Enter. 2. What happens if the image catalog transferred to the remote system via command TFRVRTDTA cannot fit in the available disk space? 1. As soon as no more disk space is available, the FTP would end transferring the data. 2. A warning message would be sent to QSYSOPR, telling that a critical condition exists on the disk space. 3. On the remote system, follow the procedure in FAQ no 1 to reduce to a minimum the storage allocated by offending virtual volume(s). 3. On a partition I have defined a scheduled job to perform daily saves through command VRTSAV/VRTSAVSYS TFRVRTDTA(*YES) DUPTAP(*YES). In this way the save is sent to a second partition and stored on tape. How can I have the daily save from the second partition also saved on the same tape? On the first partition (the one sending the save to the second partition), run command VRTSAV/DFNRMTSYS (see figure 3a). On parameter Finishing command type the name of the command that you are using in the second partition to perform the daily save to tape. In this way, as soon as the transfer of the save from the first to the send partition completes and the virtual tape is copied to the real tape, the Finishing command is executed and the save is written on the same tape.