table of contents 1. - easy400.net · recommend that you read at least chapter 1, introduction to...

12
by Giovanni B. Perotti (Italy) Table of contents Introduction About it 11. Prerequisites 12. Installation 13. 1. Set up Defining an image catalog 21. Defining a virtual tape drive 22. Loading an image catalog into a virtual tape drive 23. 2. Save and Transfer Transferring virtual save volumes to a remote system 31. Performing a save to a virtual tape 32. Customizing save command parameters 33. Displaying the save contents of a virtual tape 34. Backing up virtual tape volumes to real tape volumes 35. 3. Restore 4. FAQ 5. A single command to Save the system on virtual tapes 1. Send the save to a remote system 2. Backup the save on tape volumes 3. 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.

Upload: others

Post on 26-Jul-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Table of contents 1. - Easy400.Net · 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:

by Giovanni B. Perotti (Italy)

Table of contentsIntroduction

About it11.Prerequisites12.Installation13.

1.

Set upDefining an image catalog21.Defining a virtual tape drive22.Loading an image catalog into a virtual tapedrive

23.

2.

Save and TransferTransferring virtual save volumes to a remotesystem

31.

Performing a save to a virtual tape32.Customizing save command parameters33.Displaying the save contents of a virtual tape34.Backing up virtual tape volumes to real tapevolumes

35.

3.

Restore4.FAQ5.

A single command toSave the system on virtualtapes

1.

Send the save to a remotesystem

2.

Backup the save on tapevolumes

3.

11-About it

While IBM System i™ blade servers are invading the iSeries market, more and more customers with multiplesystems or partitions would like to save on tape units and to have their system saves transferred to a systemequipped with tape drives.

This open source utility provides a solution based on a single command that allows to save the system on virtualtape volumes, send the tape volume images to another system, and have it copy the tape images to real tapevolumes.

12-Prerequisites

OS/400 release V6R1 or subsequentILE 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 maysave 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, werecommend that you also install also the Easy400-distributed free open-source Object DistributionFacility (ODF). ODF may be very useful for transferring back to the source system objects restored onthe 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/VRTSAVcreates modules and programs in library VRTSAVrestores IFS directory /vrtsavruns command VRTSAV/INSTALL to create and to populate library VRTSAVDATA.This library will contain local user data.Duplicates some VRTSAV commands to library QGPL.

Page 2: Table of contents 1. - Easy400.Net · 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:

Virtual tape support on IBM System i™ started with OS/400 release 5.4. You may find some detail documentationon IBM Redboook "i5/OS V5R4 Virtual Tape: A Guide to Planning and Implementation". May werecommend that you read at least Chapter 1, Introduction to virtual tape.

Basically, to define a virtual tape you have to go through three steps:define an image catalog simulating to be set of tape volumes on the Integrated File System1.define a virtual tape device2.load the virtual tape device with the image catalog.3.

1-Define an image catalog

As per the mentioned Redbook, a number of system commands are used to define virtual tapes, please refer toChapter 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 pressEnter.

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 thatwill contain your saves. This command will generate images of your virtual tape reels in an IFS directory created

Page 3: Table of contents 1. - Easy400.Net · 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:

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 willbe 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 thenumber of volumes result not enough to contain a save, the system would automatically generate newones 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/WRKVRTTAPPress 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 pressEnter.

Page 4: Table of contents 1. - Easy400.Net · 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:

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 theEnter 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:

Page 5: Table of contents 1. - Easy400.Net · 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:

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 intothe virtual tape.In such a case, do the following:

go back to the screen in figure 2j and delete the failing virtual devicei.follow the procedure from figure 2f on, to re-create the same virtual tape device,ii.however, when you come to the screen in Figure 2i (system command CRTDEVTAP), in parameterResource name, instead of leaving *VRT, enter a specific resource name, VRTTAPnn, where nn is a valuein the range 01-35.

iii.

NOTE 2 - In this page we have documented a set up process that starts with command vrtsav/WRKIMG and goesthrough command vrtsav/WRKVRTTAP.A setup process can also proceed the opposite way, starting with command vrtsav/WRKVRTTAP and completingwith command vrtsav/WRKIMG.

NOTE 3 - You may use the setup technique documented in this page to set up several virtual tape drives. Up to 35virtual 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 thatits tape reels are replaced by image catalog volumes.For instance you can save individual libraries on virtual tapes and perform restore operations from them.

Page 6: Table of contents 1. - Easy400.Net · 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:

You can copy (command DUPTAP) the virtual tapes to real tape volumes and store them safely, and you can copyreal tape volumes to virtual tapes, for instance to perform restore operations.

Page 7: Table of contents 1. - Easy400.Net · 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:

The VTRSAV utility features a single command, vrtSavsys that allows tosave important sections of the system on a virtual tapea.transfer the save on virtual tape (the image catalog connected to it) to a remote system via FTPb.backup the save on a real tape drive of the remote systemc.

Of course, if your system is equipped with a real tape drive, you do not need steps b) and c), you may just needstep a).

We shall discuss first the transfer, then the save, though they do occur in the opposite order.

Transferring a save to a remote systemHow to transmit to another system a save stored on a virtual tape

31.

Performing a save to a virtual tapeA command performing multiple saves on a virtual tape

32.

Customizing save command parametersHow to set your options for the multiple save command

33.

Displaying the save contents of a virtual tape34.Backing up virtual tape volumes to real tape volumes35.

31-Transferring virtual tape volumes to a remote system

The VTRSAV utility includes a command, named TfrVrtDta, that allows to transfer virtual tape volumes (usuallycontaining a save) to a remote system.This command, in order to operate, has two requirements:

The source system (the one where the save has been performed) must know something about the remotesystem intended to receive the save

i.

The remote system (or target system, the one intended to receive the save) must have defined a virtualtape exactly the same (same name, same image catalog, only the resource nam of the virtual tape devicecan 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 thesetup done on the source system.

ii.

There are 3 commands dealing with the transfer:

To define, on the source system, the information needed for the target system, you must executecommand DFNRMTSYS:

Figure 3a - Command vrtsav/DFNRMTSYSYou need to type:

the IP address of the remote (target) system, or *NONE if you do not want to user the "transfersave" facility

1.

the name of a user profile, and2.its password (you are also requested to confirm the password)3.the name of the real tape drive on the remote system that will be used to backup the transferredsaves, or *NONE if you do not want to backup on tape the transferred tapes

4.

the tape density that will be used on backup operations5.the device end option6.an optional command that you want be executed on the remote system at the end of the transferactivity.

7.

These data are used by command TfrVrtDta when starting a FTP session to the remote system.

a.

Command vrtsav/TFRVRTDTAThis command starts a FTP session to the remote system. During this session it transfers the save imageinto the virtual tape drive of the remote system having the same name and the same image catalog as thesource virtual tape drive, and, if requested so, duplicates to real tape volumes the virtual volumescontaining the save.If you use command vrtSavsys you do not need to launch the TfrVrtDta command, because that can berequested from the command vrtSavsys itself.You may want to use command TfrVrtDta, either manually or within a program, to transfer to the remotesystem a save performed without command vrtSavsys. Command TfrVrtDta looks as follow:

b.

Page 8: Table of contents 1. - Easy400.Net · 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:

Figure 3b - Command vrtsav/TFRVRTDTA

You must tellThe 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.

Command vrtsav/TFRDSPLOGUse this command to display - on the source system - the FTP log generated by the FTP session startedfrom command TfrVrtDta. This command, due to its refresh capabilities, can be used even while thetransfer is active.

c.

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 noproblem. Do the following:

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)

1.

Run the save command, as an exampleSAVLIB LIB(QGPL) DEV(virtual_tape_device_name)

2.

If you want to send the image to the remote system (and optionally copy it to real tape), run commandvrtsav/TFRVRTDTA

3.

The VRTSAV utility features a special command, named VrtSavSys aimed to fit most common save needs, tooptionally request the transfer of the save to a remote system, and to optionally copy the save to a remote realtape drive.

Command vrtsav/VRTSAVSYS:

Figure 3c - Command vrtsav/VRTSAVSYSVirtual tape device (DEV)Name of the virtual device (defined via command VRTSAV/WRKVRTTAP) to be used for the saveoperation.Use *LAST to refer to the virtual tape device already used in the last VRTSAVSYS save, if any.Save all (SAVALL)Type one of the following:

*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)Type one of the following:

*YES to save all the user libraries (same as command SAVLIB LIB(*ALLUSR))*NO to skip this save step.

Save Integrated File System (SAVIFS)Type one of the following:

*YES to save all the IFS directories*NO to skip this save step.

Save Document Library Objects (SAVDLO)Type one of the following:

*YES to save all the document library objects (same as command SAVDLO)*NO to skip this save step.

Save Configuration Data (SAVCFG)Type one of the following:

*YES to save all the configuration data (same as command SAVCFG)*NO to skip this save step.

Save Security Data (SAVSEC)Type one of the following:

*YES to save all the security data (same as command SAVSEC)*NO to skip this save step.

Transfer data to remote system (TFRVRTDTA)Type one of the following:

*NO to skip the FTP transfer step. The transfer to a remote system can be started later on viacommand 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 programas soon as the saves have been completed. Command TFRDSPLOG may be used to browse thelog of the FTP session.Prerequisites:

The remote system receiving a copy of the virtual tape data must have been defined

Page 9: Table of contents 1. - Easy400.Net · 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:

through command DFNRMTSYS (Define the remote system).On the remote system a virtual tape unit with the same name and the same tape volumesmust have been defined through commands WRKVRTTAP (Work with virtual tapes) andWRKIMG (Work with image catalogs).

Duplicate tape volumes (DUPTAP)Type one of the following:

*YES to have the virtual tape volumes duplicated to real tape volumes once the transfer to theremote system is complete*NO to skip this step. The virtual tape volumes transferred to the remote system can be duplicatedlater 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 andSAVSECDTA) does use the command default parameters. For some of these commands, you may want to changethe 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 parametervalues.

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:

Page 10: Table of contents 1. - Easy400.Net · 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:

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:Use the following command to load the image catalog into the virtual tape device and to vary online thevirtual tape device:

vrtsav/VRYTAPON DEV(virtual_device_name)

i.

Use the following command to display the save contents of a virtual tape:DSPTAP DEV(virtual_tape_device_name) DATA(*SAVRST)

ii.

35-Backing up virtual tape volumes to real tape volumes

Operate in this way:Use the following command to load the image catalog into the virtual tape device and to vary online thevirtual tape device:

vrtsav/VRYTAPON DEV(virtual_device_name)

i.

Use the following command to duplicate virtual tape volumes to real tape volumes:DUPTAP DEV(virtual_tape_device_name) TODEV(real_tape_device_name)

ii.

Note that you may use commandvrtsav/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.

Page 11: Table of contents 1. - Easy400.Net · 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:

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 systemWhether you have used command vrtsav/VRTSAVSYS or some other procedure of yours to performs thesave.

Here are some possible scenarios.

Scenario 1 - Restore objects from the last save on virtual tapeDo the following:

Run commandvrtsav/VRYTAPON DEV(virtual_device_name)

to make the virtual tape image catalog available.

A.

Run commandDSPTAP DEV(virtual_tape_device_name) DATA(*SAVRST)

to make sure that you are referring to the desired save contents.

B.

Run the appropriate restore command specifying parameterDEV(virtual_tape_device_name)

C.

Scenario 2 - Restore large amount of objects from a save tape generated on the remotesystemUse this approach when you need to restore a large amount of objects spread across libraries and/or IFSdirectories.

Upload the appropriate virtual tape volume(s) on the remote system. There are two possible cases: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 ontape, 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

Run commandvrtsav/DUPTAPVRT FROMDEV(real_device_name) TOVRTDEV(virtual_device_name)

to upload the appropriate save data to the virtual tape.

i.

a.

On the source system you used your own commands to perform the save on virtual tape and/or totransfer the virtual image to the remote system and to have it backed up on tape.In such a case, on the remote system

Run commandvrtsav/VRYTAPON DEV(virtual_device_name)

to make the virtual tape image catalog available.

i.

Run commandDUPTAP FROMDEV(real_device_name) TODEV(virtual_device_name)

to upload the appropriate save data to the virtual tape.

ii.

b.

A.

Transfer the save image to the local system: run commandvrtsav/TFRVRTDTA FROMDEV(virtual_device_name) DUPTAP(*NO)

Please note that on the remote system you must have defined the source system via commandvrtsav/DFNRMTSYS.

B.

Restore the desired objects on the local system:See Scenario 1.

C.

Scenario 3 - Restore library objects from a save tape generated on the remote systemUse this approach when you need to restore a library or a subset of library objects.

On the remote system, create a temporary library (do not use library QTEMP)A.On the remote system, restore - from the appropriate save tape- restore the desired library or set of libraryobjects needed by the source system. In the restore command, specify the temporary library name inparameter RSTLIB.

B.

On the remote system, save the temporary library into a save file.C.Use the Object Distribution Facility (ODF) command ODSTR to send this save file to the source system.D.On the source system, restore the objects from the save file to the appropriate library, by specifting itsname in parameter RSTLIB.

E.

Page 12: Table of contents 1. - Easy400.Net · 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:

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 virtualvolumes?

Use the following procedure to initialize the virtual volumes (all data there will be lost) of a given image catalogand to reduce to a minimum the allocated storage:

Type command VRTSAV/WRKIMG to list all the image catalogs known to the VRTSAV utility1.Select with option 7=Initialize_virtual_volumes the image catalog you care for, and press Enter.2.

2. What happens if the image catalog transferred to the remote system via commandTFRVRTDTA cannot fit in the available disk space?

As soon as no more disk space is available, the FTP would end transferring the data.1.A warning message would be sent to QSYSOPR, telling that a critical condition exists on the disk space.2.On the remote system, follow the procedure in FAQ no 1 to reduce to a minimum the storage allocated byoffending virtual volume(s).

3.

3. On a partition I have defined a scheduled job to perform daily saves throughcommand

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 sametape?

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 thesecond 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 iscopied to the real tape, the Finishing command is executed and the save is written on the same tape.