z/OS DFSMS

z/OS DFSMS

z/OS DFSMS

z/OS Data Subsystem that delivers core Data, Data Resiliency and Data Lifecycle Management Solutions for your Enterprise.

 View Only

Put DFSMShsm To Work With Targeted UNIX File Processing

By Sam Meredith posted Fri July 26, 2024 01:01 PM

  

The introduction of DFSMShsm Java hbackup host ID support brings in a new opportunity to take advantage of your DFSMShsm resources. With this support, you can now direct UNIX file backup requests to specific DFSMShsm hosts within a Multiple Address Space HSM (MASH) environment. This makes it possible to put any and all of the DFSMShsm hosts on your system to work for UNIX file backup which was, at best, a tiring and cumbersome task to tackle in the past. Incorporating this support into your environments will enable you to better balance your heavy UNIX file workloads, and in a way that is flexible and easy to manage. Simply apply the PTFs for OA65319, available on z/OS 2.5 and later, and you will be ready to get started. 

To use the new Java hbackup host ID support, you can add the new command line option -i to any of your existing Java hbackup jobs: 

Java hbackup -i 2 /SYS1/u/user1/

The -i option accepts a single character A-Z, 0-9, @, $, or # that correlates to the host ID of an active DFSMShsm host you would like the request directed to. Aside from a few considerations (detailed in the documentation), that is really all there is to it: specify the desired host ID and Java hbackup will direct the request to that host, or let you know if there was an issue.

Now using the new command line option is straight forward enough, but how do you balance your UNIX file workloads – the truly valuable potential of this support, right? To ensure the support was flexible for users, we kept it simple and focused on the functionality to direct your requests to specific hosts. However, balancing workloads is a nontrivial effort, so here I would like to share some ideas we have on how you could approach this effort.

Below is a bash script you could use to split the backup of a target directory across multiple DFSMShsm hosts. If you don't have bash installed on your systems, we recommend checking out z/OS Open Tools.

target_dir=/SYS1/u/  # target directory
host_ids=(1 2 A $)  # list of host ids to add to queue 
fd=7  # file descriptor for queue, can be anything 3-9

# get a list of all the non-empty subdirectories immediately below the target directory
dirs=( $(find ${target_dir} -level 0 -type d -size +0) )  

# create a 'queue' for hosts ready for work
rm -f queue && mkfifo queue 

# open a file descriptor for the queue so we can read from it
exec {fd}<>queue  

# queue up all hosts, they're initially ready for work
printf "%s\n" "${host_ids[@]}" >> queue

# loop through our list of directories 
for dir in "${dirs[@]:1}"; do 
    # get next host ready for work from the queue 
    read -ru $fd host  
    
    # send directory to host for backup in the background
    # when the host is done, it will be added back to the queue 
    java hbackup -R -e /.../user7/ -i "${host}" "${dir}" && echo ${host} >> queue &

done

# wait for all hosts to complete their work
wait

rm queue

The above bash script loops through an array of directories and passes each to Java hbackup, which is run as a background process. Each invocation of Java hbackup is directed to a host from a 'queue' of hosts ready for work. As each backup request is completed, the associated host is put back on the queue and when all hosts are busy we wait for one to become available. It is a simple example but, with a little creativity, could be expanded to do some powerful workload balancing. And, the great thing is, this all runs in the z/OS UNIX shell which means you can draw on ideas from UNIX users worldwide. In fact, this very example was inspired by a question we found on stack overflow

The DFSMShsm Java hbackup host ID enhancement adds a missing piece of unity between two of our great optimization functions, the Java hbackup command the MASH configuration. Putting these two together, with a little cleverness in execution, has the potential to significantly reduce your backup time frames and increase the availability of your resources. We would love to hear about your experience with this new support and any clever ideas you come up with to exploit it! We are always looking for feedback and are eager for your requests on how we can improve your experience with DFSMShsm UNIX File backup. 

tags: DFSMS

0 comments
63 views

Permalink