zPET - IBM Z and z/OS Platform Evaluation and Test - Group home

CFRM Policy Updates Made Easy With the z/OSMF CFRM Policy Editor

  

The Coupling Facility Resource Management (CFRM) policy describes the definition and properties of Coupling facilities (CF) and CF structures that can be used in a Parallel Sysplex. The CFRM policy is stored in a Couple Data Set (CDS). Traditionally, when the definitions of CFs or structures needed to be modified, a z/OS system programmer had to modify the CFRM policy’s text and then submit the administrative data utility, IXCMIAPU, via JCL to write the policy to the CFRM CDS. This method, which has been used for decades, requires the system programmer write the corresponding CF or CF structure attribute definition very carefully. It is easy to introduce human error, and it is not efficient when many changes need to be made.

Recently, IBM z/OSMF released an important feature, the CFRM Policy Editor, that provides support for modifying CFRM policy definitions through the graphical user interface of z/OSMF, without having to know or understand JCL or CFRM policy control syntax. As you work, the editor checks your changes for correct syntax. This feature can help simplify CFRM policy modification operations by providing easy-to-use options for viewing and modifying CFRM policies as well as allowing more efficient batch modifications of structure definitions and thereby reducing the opportunity to make human errors.

To see more details about CFRM Policy Editor, please refer to https://www.ibm.com/docs/en/zos/2.5.0?topic=policies-cfrm-policy-editor

In this article, we will share some insights from our test team on using the CFRM Policy Editor.

1. Modifying the properties of multiple CF structures in batch

Typically, the properties of structures will be modified (or defined) by a user in small amounts at a time, but in some cases, it may be necessary to modify many structure properties at once. For example, when the newly released z16 was deployed to our integration test environment, we replaced an older generation CEC with a new z16 and defined new CFs on it. In order to evaluate the advantages of the new hardware, we moved some of the most important systems structures and middleware structures on a new z16 CF. One way to accomplish this procedurally was to define the new CF to be first in the Preference List (preflist) property of those structures, which would result in their allocation to the new CF when first allocated or rebuilt. In fact, for this scenario, we typically would update the preflist of all affected structures, and then use the CF REALLOCATE process to move the structures to our preferred CFs based on their preflist property.

If we had to modify the structure preflist property using the traditional IXCMIAPU utility and JCL, we would first need to carefully modify the Preflist property of each structure in our CFRM policy definition data set, essentially a flat text file, which as you can imagine could easily result in editing errors.
 
Now, by using the new z/OSMF CFRM Policy Editor, we can easily put the newly added CF in the first place of the Preflist of all suitable structures, within the same dialog we use to add the new CF definition. The following steps show exactly how easy this is. Let’s start from the Sysplex Management Plugin CFRM Policy list view.

(1) First, click the Add button in the Coupling Facility page of the CFRM Policy Editor as follows:


(2) In the popup window, enter the properties of the new CF and click the Add button to add structures to it as follows:

(3) In the option "Select CF Structures" we select a dozen structures and then in the Preference List option, select First as follows:


(4) Click the OK button will return to the previous window with the structures we have selected listed as follows:


(5) Continue clicking the OK button and click the Submit button in the pop-up window to submit the changes as follows.

(6) The following message box will pop up after a successful submission, telling the user their selected policy has been updated:


(7) At this point, the policy modification in the CFRM CDS has been completed. To Activate, simply select policy name, then select Activate from the Actions drop-down menu. As follows:

Batch modifications to multiple structures can occur in many scenarios. For example, suppose we deployed an application a few years ago, for which we defined several CF structures. As the business grew, the amount of data increased accordingly. The structure sizes we defined before may not be able to support the growing business data adequately. Assuming the memory needs for multiple structures increased by 20% due to this growth, with the CFRM Policy Editor, we can now select these structures from within a policy and enter a 20% increase in the Modify CF Structures window’s Relative tab. We show this example below, after which simply clicking OK will increase the memory definition for all selected structures by 20%.
 
 
Activating the updated policy from the CFRM Administrative Policies page is all that is needed to make it effective, making this a simple 3 step point and click exercise versus multiple batch steps with error-probe text editing.

2. Backing up CFRM policy data

As we mentioned, the traditional way to modify a CFRM policy is to write the definitions of CF and structures in syntactically correct text form and then submit the administrative data utility, IXCMIAPU, to read this text as input via JCL to write the policy to the CFRM CDS.
However, when using z/OSMF CFRM Policy Editor to modify the policy, we directly modify the definitions of CF and structures in the CFRM CDS. If the CFRM CDS is damaged, we lose the definitions of CF and structures. We have used several methods to back up the policy definitions from the CFRM CDS which we’ll share here:

(1)  Schedule batch JCL to periodically export the policy for backup

The first way is to periodically back up the policy in CFRM CDS using JCL to run the IXCMIAPU with the REPORT(YES) option. To do this, we configured our test environment automation policy to run such JCL once a week to perform a backup of the policy's REPORT(YES) output using GDGs. The advantage of this method is that it is automatically and periodically executed without manual intervention. A new backup is saved every week. In case of problems, we can fall back to the latest saved version for recovery. The disadvantage is that changes made between the last backup and the current time are not saved. It requires the policy administrator to manually perform some adjustments after recovery to ensure full data integrity. Therefore, we require that every modification of our CFRM CDS be recorded using an established change management process, to facilitate the search of all modifications for any given timeframe.
Here is sample JCL of how we accomplish the backup:

//CFRMEXP JOB 'USER',MSGCLASS=H,CLASS=A,NOTIFY=&SYSUID,

//  MSGLEVEL=(1,1),REGION=4M                                                                 

//STEP1    EXEC PGM=IXCMIAPU                             

//SYSPRINT DD DSN=USER.DATA.CFRM.PLX1(+1),DISP=(,CATLG),

//         SPACE=(CYL,(10,5),RLSE)                       

//STDOUT   DD SYSOUT=*                                   

//STDERR   DD SYSOUT=*                                   

//SYSUDUMP DD SYSOUT=*                                   

//SYSIN    DD *                                          

       DATA TYPE(CFRM) REPORT(YES)                       

/*

//*                                                      

 

The output is put into one GDG data set and looks like:

/* XCF Format Utility Control Cards:   */                                      
  DATA TYPE(CFRM)                                                           
    ITEM NAME(POLICY) NUMBER(8)                                            
    ITEM NAME(STR) NUMBER(4096)                                             
    ITEM NAME(CF) NUMBER(10)                                                
    ITEM NAME(CONNECT) NUMBER(129)                                          
    ITEM NAME(SMREBLD) NUMBER(1)                                            
    ITEM NAME(SMDUPLEX) NUMBER(1)                                             
    ITEM NAME(MSGBASED) NUMBER(1)                                          
    ITEM NAME(ASYNCDUPLEX) NUMBER(1)                                        
  ADMINISTRATIVE DATA UTILITY:  REPORT                       DATA TYPE = CFRM  _____________________________________________________________________________                                                                                                                                                                                                                                   
  DEFINE POLICY NAME(IXCALLST)                                                
        /* Defined: 12/07/2022 14:09:54.570085 User: USER1 */                   
        /* Version: 4 */                                                        
        /* 669 Structures defined in this policy */                              
        /* 5 Coupling Facilities defined in this policy */                                     
                        
     CF NAME(CF2) DUMPSPACE(26G) PARTITION(23) CPCID(00)        
        TYPE(008561) MFG(IBM) PLANT(02) SEQUENCE(0000xxxxxxxx)
        SITE(SITE2)
                                                                                                    
     CF NAME(CF3) DUMPSPACE(26G) PARTITION(0B) CPCID(00)
        TYPE(003906) MFG(IBM) PLANT(02) SEQUENCE(0000xxxxxxxx)
        SITE(SITE2) 
                                                                                                   
     CF NAME(CF4) DUMPSPACE(52G) PARTITION(14) CPCID(00)
        TYPE(003931) MFG(IBM) PLANT(02) SEQUENCE(0000xxxxxxxx)
        SITE(SITE1)
                                                                                                   
     CF NAME(CF4DUP) DUMPSPACE(52G) PARTITION(44) CPCID(00)
        TYPE(003931) MFG(IBM) PLANT(02) SEQUENCE(0000xxxxxxxx)
        SITE(SITE1)
                                                                                                    
     CF NAME(CF5) DUMPSPACE(52G) PARTITION(01) CPCID(00)
        TYPE(008562) MFG(IBM) PLANT(02) SEQUENCE(0000xxxxxxxx)
        SITE(SITE2)
                                                                                       
     STRUCTURE NAME(APPCLOG) SIZE(15M)        
         INITSIZE(12M)                    
         FULLTHRESHOLD(90)                 
         REBUILDPERCENT(1)                        
         PREFLIST(CF4, CF2, CF5, CF3, CF4DUP)     
         ENFORCEORDER(YES)                                                           

     STRUCTURE NAME(CICS_USERJRN_001) SIZE(90000K)
         INITSIZE(80000K)                       
         PREFLIST(CF5, CF3, CF4, CF2, CF4DUP)
                                              
     STRUCTURE NAME(COUPLE_CKPT1) SIZE(125M)
         FULLTHRESHOLD(95)                   
         DUPLEX(ENABLED)                      
         PREFLIST(CF4, CF2, CF5, CF3, CF4DUP)
         ENFORCEORDER(YES)                     
         RECPRTY(1)                                             
   ……

 

(2) Use the Export function to back up the CFRM policy

The second method is to use the Export function of z/OSMF CFRM Policy Editor to export the policy definition directly from the CDS to a data set or a USS file.
Simply select Export from the Actions and provide the output data set name or USS filename from the popup window as below
.

 It is important to note that either the data set or the file under USS must be manually predefined in advance. Here is an example of a data set defined in our test environment.

Data Set Name  . . . : USER.DATA.CFRM.EXPORT.POLICY2.PS                                                                                              

 Management class . . . STANDARD       (Blank for default management class)  

 Storage class  . . . . STANDARD       (Blank for default storage class)     

  Volume serial . . . . TSO026         (Blank for system default volume) **  

  Device type . . . . .                (Generic unit or device address) **   

 Data class . . . . . .                (Blank for default data class)        

  Space units . . . . . BLOCK          (BLKS, TRKS, CYLS, KB, MB, BYTES      

                                        or RECORDS)                          

  Average record unit                  (M, K, or U)                          

  Primary quantity  . . 120            (In above units)                      

  Secondary quantity    50             (In above units)                      

  Directory blocks  . . 0              (Zero for sequential data set) *      

  Record format . . . . FB                                                   

  Record length . . . . 80                                                   

  Block size  . . . . . 3120                                                 

  Data set name type                   (LIBRARY, PDS, LARGE, BASIC, *        

  Data set version  . :                 EXTREQ, EXTPREF or blank)            

  Num of generations  :                                                  

 

Specifying the data set name in the Export panel will successfully export the policy definition.

 

Pre-creating files under USS is as simple as using the touch command, as shown in the following example:

$ touch /u/user/user.data.cfrm.export.policy1

 

The policy definition in CFRM CDS can be successfully exported to this file by naming the USS file in the Export panel. The contents of the exported file will look like this, the same as the contents of the exported data set.

$ cat user.data.cfrm.export.policy1|more
DATA TYPE(CFRM) REPORT(NO)
DEFINE POLICY NAME(TEST) REPLACE(YES)
       /* Defined: 01/12/2022 17:08:22.768481 User: USER2 */
       /* Version: 4 */
       /* 668 Structures defined in this policy */
       /* 6 Coupling Facilities defined in this policy */
   CF NAME(CF2) DUMPSPACE(26G) PARTITION(23) CPCID(00)
      TYPE(008561) MFG(IBM) PLANT(02) SEQUENCE(0000xxxxxxxx)     
      SITE(SITE2)
   CF NAME(CF3) DUMPSPACE(26G) PARTITION(0B) CPCID(00)     
      TYPE(003906) MFG(IBM) PLANT(02) SEQUENCE(0000xxxxxxxx)     
      SITE(SITE2)
   CF NAME(CF4) DUMPSPACE(52G) PARTITION(14) CPCID(00)     
      TYPE(003931) MFG(IBM) PLANT(02) SEQUENCE(0000xxxxxxxx)     
      SITE(SITE1)
  STRUCTURE NAME(SYSZWLM_83B83931) SIZE(102400K)     
      INITSIZE(76800K)
      FULLTHRESHOLD(90)
      ALLOWAUTOALT(YES)
      DUPLEX(ENABLED)
      PREFLIST(CF5, CF2, CF4, CF3, CF4DUP)
      ENFORCEORDER(YES)
      ENCRYPT(YES)  /* Key Generated: 01/06/2022 13:29:21.618339 */  
  STRUCTURE NAME(APPCLOG) SIZE(15M)
      INITSIZE(12M)
      FULLTHRESHOLD(90)
      REBUILDPERCENT(1)
      PREFLIST(CF4, CF2, CF5, CF3, CF4DUP)
      ENFORCEORDER(YES)
  STRUCTURE NAME(CICS_USERJRN_001) SIZE(90000K)     
      INITSIZE(80000K)
      PREFLIST(CF5, CF3, CF4, CF2, CF4DUP)
  STRUCTURE NAME(COUPLE_CKPT1) SIZE(125M)     
      FULLTHRESHOLD(95)
      DUPLEX(ENABLED)
      PREFLIST(CF4, CF2, CF5, CF3, CF4DUP)
      ENFORCEORDER(YES)
      RECPRTY(1)
--More--

 

Similarly, when needed, select Import from the Actions and provide the input data set name or USS filename from the popup window and it then can import the policy successfully.

A very important tip that we’ve learnt using these first 2 methods: we all know that technology cannot solve every problem, and strict change management is of great importance to the resilience of enterprise systems like z/OS. Adopting the use of the Export function to back up the definition of the policy in CFRM CDS requires that each policy administrator export the policy according to the predefined change management rules established by your team after modifying the policy using the CFRM Policy Editor, so that in case of problems, you can use this newly exported data set or USS file for recovery.

(3) Use modern REST APIs for backups

Another option is to back up the policy is to use the z/OSMF-provided REST APIs for Sysplex management services. You can find the complete reference for the Sysplex management services at https://www.ibm.com/docs/en/zos/2.5.0?topic=services-sysplex-management.

For example, we can use the GET method /zosmf/sysplex/rest/v1/policies/CFRM/<pol- name> to programmatically make a backup of the CFRM policy called pol-name.
Here is a partial example of the output of GET policy call:

{

    "data type": "CFRM",

    "_version_supported": "4",

    "policy": [

        {

            "name": "TEST",

            "_defined": "11/05/2021T07:01:30.250986Z",

            "_user": "USER",

            "_version": "4",

            "cf": [

                {

                    "name": "CF4",

                    "type": "003931",

                    "mfg": "IBM",

                    "plant": "02",

                    "sequence": "0000xxxxxxxx",

                    "partition": "44",

                    "cpcid": "00",

                    "dumpspace": 54525952,

                    "site": "SITE1"

                },

                {

                    "name": "CF2",

                    "type": "008561",

...

...

            "structure": [

                {

                    "name": "DSNDBAG_LOCK1",

                    "size": 2225152,

                    "duplex": [

                        "ALLOWED"

                    ],

                    "initsize": 2097152,

                    "allowautoalt": "YES",

                    "fullthreshold": 80,

                    "preflist": [

                        "CF3",

                        "CF2",

                        "CF4"

                    ],

                    "rebuildpercent": 1,

                    "enforceorder": "YES",

                    "allowreallocate": "YES"

                },

                {

                    "name": "DSNDBAG_GBP0",

                    "size": 25000,

                    "duplex": [

                        "ENABLED"

                    ],

                    "initsize": 10000,

                    "allowautoalt": "YES",

                    "fullthreshold": 80,

                    "preflist": [

                        "CF3",

                        "CF2",

                        "CF4"

                    ],

                    "rebuildpercent": 1,

                    "enforceorder": "YES"

                },

...

 

You can see that the output is in JSON format . We then can use the REST POST service to recover using this exported JSON as input when needed.

Finally, the Sysplex management REST services method not only allows
for easily backing up our policy, but also provides fully equivalent support for an application or automation tool to programmatically edit and modify the policy using the POST method.

The examples and tips we shared above are just some of the use cases we’ve found useful with the z/OSMF CFRM Policy Editor, and we have embraced them all for managing our zPET CFRM policies. We hope that they show how the CFRM Policy Editor and Sysplex management services allow for multiple ways to easily update the policy definition in CFRM CDS with zOSMF. We welcome your feedback and want to hear about your usage of the CFRM Policy Editor, so please reach out.

 

Authors:

Zhao Yu Wang

wangzyu@cn.ibm.com

Kieron Hinds

kdhinds@us.ibm.com