13.4 Making a Recovery Archive

     

A Recovery Archive is similar in some ways to a Golden Image. The major difference is that a Recovery Archive is unique to an individual machine. When used to perform an installation, it will recover that system to exactly the way it was configured when the Recovery Archive was created with no user intervention. As such, it can be viewed as a customized Ignite -UX installation device.

A Recovery Archive can be used to clone systems, in a similar way to a Golden Image, but user interaction will be required at the beginning of the installation to stop the Recovery Archive from using the hostname/IP address configuration of the node that created the Recovery Archive.

There are three options in creating a Recovery Archive. The commands are similar but subtly different:

make_recovery : Not many options to it; not highly configurable and as such not used as much these days.

make_tape_recovery : Used to create a Recovery Archive to a local tape device.

make_net_recovery : Used to create a Recovery Archive that is stored on an Ignite-UX server located on the network.

In essence, these commands are a simple interface into the make_sys_image command. We see this in the output to commands later. We look at make_net_recovery . The other commands are either similar or are not as complicated; as such, you should find them easy to navigate.

13.4.1 Allowing clients access to the configuration files

When creating a Recovery Archive, the clients will store configuration files on the Ignite-UX server under the directory /var/opt/ignite/clients while the actually Recovery Archive itself will be stored (by default) under the directory /var/opt/ignite/recovery/archives/<client >. In my experience, the Ignite/UX server and the server storing the Recovery Archive (the Archive Server) are usually the same machine, although technically they don't have to be. Both these directories need to be NFS exported to the client. In many cases, I have seen the /var/opt/ignite/recovery directory exported to everyone. While this is easier to set up, it has security implications. Ideally, we would export individual client directories to individual clients. We just need to make sure that when we create individual client directories, they are owned by user and group bin:bin :

 

 root@hpeos004[archives]  pwd  /var/opt/ignite/recovery/archives root@hpeos004[archives]  mkdir hpeos003  root@hpeos004[archives]  chown bin:bin hpeos003  root@hpeos004[archives]  ll  total 0 drwxrwxr-x   2 bin        bin             96 Oct  1 17:41 hpeos003 root@hpeos004[archives] root@hpeos004[archives]  cat /etc/exports  /var/opt/ignite/recovery/archives/hpeos003 -anon=2,access=hpeos003 /var/opt/ignite/clients -anon=2 /var/opt/ignite/archives -anon=2 root@hpeos004[archives] root@hpeos004[archives]  exportfs -a  root@hpeos004[archives] 

Again, we need to ensure that there is adequate disk space under /var to accommodate an entire tar archive of vg00 for all the clients on the network.

13.4.2 Ensure that the clients have the most up-to-date recovery commands

It is a good idea that the clients are using the most up-to-date versions of the Recovery Commands loaded on our Ignite-UX server. To assist in this, we have some commands that we can run to create a depot of the necessary Recovery Commands required on the clients. We do this on our Ignite-UX server:

 

 root@hpeos004[]  swlist -l depot  # Initializing... # Target "hpeos004" has the following depot(s):   /software/11i-PA/FooProd   /software/11i-PA/patches   /software/11i-PA/core   /software/11i-PA/IPv6   /software/11i-PA/SG11.14   /var/opt/mx/depot11 root@hpeos004[] 

This tells me that we haven't created the depot for the Recovery Commands. If we were to initiate a Network Recovery Archive from the Ignite-UX GUI running on the Ignite-UX server, it would automatically create the depot for me. Here is the command to create it by hand:

 

 root@hpeos004[]  /opt/ignite/lbin/pkg_rec_depot  * Generating the product specification file. =======  10/01/03 18:03:49 BST  BEGIN swreg SESSION (non-interactive)        * Session started for user "root@hpeos004".        * Beginning Selection        * Targets:                hpeos004        * Objects:                /var/opt/ignite/depots/recovery_cmds        * Selection succeeded. =======  10/01/03 18:03:49 BST  END swreg SESSION (non-interactive)        * Creating depot: /var/opt/ignite/depots/recovery_cmds =======  10/01/03 18:03:50 BST  BEGIN swpackage SESSION        * Session started for user "root@hpeos004".        * Source:        hpeos004:/var/tmp/rec_psf.5769        * Target:        hpeos004:/var/opt/ignite/depots/recovery_cmds        * Software selections:              *        * Beginning Selection Phase.        * Reading the Product Specification File (PSF)          "/var/tmp/rec_psf.5769".        * Reading the product "Ignite-UX" at line 5.        * Reading the fileset "BOOT-KERNEL" at line 16.        * Reading the fileset "BOOT-SERVICES" at line 46.        * Reading the fileset "FILE-SRV-11-11" at line 70.        * Reading the fileset "IGNITE" at line 93.        * Reading the fileset "IGNT-ENG-A-MAN" at line 248.        * Reading the fileset "MGMT-TOOLS" at line 309.        * Reading the fileset "OBAM-RUN" at line 391.        * Reading the fileset "RECOVERY" at line 426. NOTE:    Creating new target depot          "/var/opt/ignite/depots/recovery_cmds".        * Selection Phase succeeded.        * Beginning Analysis Phase.        * Analysis Phase succeeded.        * Beginning Package Phase. NOTE:    You have specified the "package_in_place" option.  The          software you have selected will be packaged with references to          the actual source files.  No source files will be copied into          the target depot "/var/opt/ignite/depots/recovery_cmds".        * Packaging the product "Ignite-UX".        * Packaging the fileset "Ignite-UX.BOOT-KERNEL".        * Packaging the fileset "Ignite-UX.BOOT-SERVICES".        * Packaging the fileset "Ignite-UX.FILE-SRV-11-11".        * Packaging the fileset "Ignite-UX.IGNITE".        * Packaging the fileset "Ignite-UX.IGNT-ENG-A-MAN".        * Packaging the fileset "Ignite-UX.MGMT-TOOLS".        * Packaging the fileset "Ignite-UX.OBAM-RUN".        * Packaging the fileset "Ignite-UX.RECOVERY".        * Package Phase succeeded. NOTE:    You must register the new depot          "/var/opt/ignite/depots/recovery_cmds" to make it generally          available as a source for swinstall and swcopy tasks.  To          register it, execute the command                 swreg -l depot /var/opt/ignite/depots/recovery_cmds =======  10/01/03 18:03:51 BST  END swpackage SESSION        * Registering depot: /var/opt/ignite/depots/recovery_cmds =======  10/01/03 18:03:51 BST  BEGIN swreg SESSION (non-interactive)        * Session started for user "root@hpeos004".        * Beginning Selection        * Targets:                hpeos004        * Objects:                /var/opt/ignite/depots/recovery_cmds        * Selection succeeded. =======  10/01/03 18:03:51 BST  END swreg SESSION (non-interactive)        * Creating IUX Recovery bundles. =======  10/01/03 18:03:53 BST  BEGIN swpackage SESSION        * Session started for user "root@hpeos004".        * Source:        hpeos004:/var/tmp/psf.5792        * Target:        hpeos004:/var/opt/ignite/depots/recovery_cmds        * Software selections:              *        * Beginning Selection Phase.        * Reading the Product Specification File (PSF)          "/var/tmp/psf.5792".        * Reading the bundle "Ignite-UX-11-11" at line 11. WARNING: Converting software from a source with layout_version 1.0 into          a target with layout_version 0.8 since the layout_version          option is set to 0.8.          Note by converting 1.0 software to layout_version 0.8, you          will lose any new 1.0 attributes which can corrupt the          software if it depends on 1.0 attributes.        * Selection Phase succeeded.        * Beginning Analysis Phase.        * Analysis Phase succeeded.        * Beginning Package Phase.        * Packaging the bundle          "Ignite-UX-11-11,r=B.3.6.82,a=HP-UX_B.11.11_32/64".        * Package Phase succeeded. =======  10/01/03 18:03:53 BST  END swpackage SESSION =======  10/01/03 18:03:54 BST  BEGIN swpackage SESSION        * Session started for user "root@hpeos004".        * Source:        hpeos004:/var/tmp/psf.5814        * Target:        hpeos004:/var/opt/ignite/depots/recovery_cmds        * Software selections:              *        * Beginning Selection Phase.        * Reading the Product Specification File (PSF)          "/var/tmp/psf.5814".        * Reading the bundle "IUX-Recovery" at line 11. WARNING: Converting software from a source with layout_version 1.0 into          a target with layout_version 0.8 since the layout_version          option is set to 0.8.          Note by converting 1.0 software to layout_version 0.8, you          will lose any new 1.0 attributes which can corrupt the          software if it depends on 1.0 attributes.        * Selection Phase succeeded.        * Beginning Analysis Phase.        * Analysis Phase succeeded.        * Beginning Package Phase.        * Packaging the bundle          "IUX-Recovery,r=B.3.6.82,a=HP-UX_B.11.11_32/64".        * Package Phase succeeded. =======  10/01/03 18:03:54 BST  END swpackage SESSION root@hpeos004[] 

We can now use this depot to install the Recovery Commands onto all the clients in the network. We could use this script periodically on all the clients to automatically update the Recovery Commands if the server has a newer version than the client:

 

 root@hpeos003[]  ll /usr/local/bin/check_rec_cmds.sh  -rwx------   1 root       sys            181 Oct  1 18:09 /usr/local/bin/check_rec_cmds.sh root@hpeos003[]  cat /usr/local/bin/check_rec_cmds.sh  #!/sbin/sh IUXServer=hpeos004 /opt/ignite/lbin/check_version -s ${IUXServer} if [ $? != 0 ] then         swinstall -s ${IUXServer}:/var/opt/ignite/depots/recovery_cmds \ IUX-Recovery fi root@hpeos003[] 

Once we have the updated Recovery Commands, we can proceed with using make_net_recovery .

When we run make_net_recovery , we can simply run it with a command line such as:

 

 # make_net_recovery s <IgniteServer> 

This will archive a list of files contained in /opt/ignite/recovery/mnr_essentials (and /var/opt/ignite/recovery/mnr_essentials if we have set it up). The mnr_essentials file does not contain lots of files. As the name suggests, it would just be enough for you to boot your client and perform some basic recovery, e.g., recover all your vg00 files from a backup tape. Most of the time, administrators will want their Recovery Archive to be a complete archive or vg00 and possibly other volume groups (although if your other volume groups are on separate disks and backed up regularly, having them as part of a Recovery Archive might be over kill) I am going to use the “A option to make_net_recovery , which will include all the disk and volume groups that house the files mentioned in the mnr_essentials file(s). In most instances, this is a convenient way to have vg00 backed up in its entirety.

 

 root@hpeos003[]  make_net_recovery -A -s hpeos004  * Creating NFS mount directories for configuration files. =======  10/01/03 18:27:52 BST  Started make_net_recovery. (Wed Oct 01 18:27:52 BST 2003)          @(#) Ignite-UX Revision B.3.6.82          @(#) net_recovery (opt) $Revision: 10.567 $        * Testing pax for needed patch        * Passed pax tests.        * Checking Versions of Recovery Tools        * Creating System Configuration.        * /opt/ignite/bin/save_config -f /var/opt/ignite/recovery/client_mnt/0x0          0306E5C3FF8/recovery/2003-10-01,18:27/system_cfg vg00 NOTE:    File: /var/opt/ignite/recovery/client_mnt/0x00306E5C3FF8/recovery/2003          -10-01,18:27/system_cfg is not world-readable, this may cause clients to fail to read it during an installation.        * Backing Up Volume Group /dev/vg00        * /usr/sbin/vgcfgbackup /dev/vg00 Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/ vg00.conf        * Creating Map Files for Volume Group /dev/vg00        * /usr/sbin/vgexport -p -m /etc/lvmconf/vg00.mapfile /dev/vg00 vgexport: Volume group "/dev/vg00" is still active.        * Creating Control Configuration. NOTE:    File: /var/opt/ignite/recovery/client_mnt/0x00306E5C3FF8/recovery/2003          -10-01,18:27/control_cfg is not world-readable, this may cause clients to fail to read it during an installation.        * Creating Archive File List        * Creating Archive Configuration        * /opt/ignite/bin/make_arch_config -c /var/opt/ignite/recovery/client_mn          t/0x00306E5C3FF8/recovery/2003-10-01,18:27/archive_cfg -g /var/opt/ign          ite/recovery/client_mnt/0x00306E5C3FF8/recovery/2003-10-01,18:27/flist          -n 2003-10-01,18:27 -r 64 -d Recovery\ Archive -L          /var/opt/ignite/recovery/arch_mnt -l          hpeos004:/var/opt/ignite/recovery/archives/hpeos003 -i 1 NOTE:    File: /var/opt/ignite/recovery/client_mnt/0x00306E5C3FF8/recovery/2003          -10-01,18:27/archive_cfg is not world-readable, this may cause clients to fail to read it during an installation.        * Saving the information about archive to          /var/opt/ignite/recovery/previews        * Creating The Networking Archive        * /opt/ignite/data/scripts/make_sys_image -d          /var/opt/ignite/recovery/arch_mnt -t n -s local -n 2003-10-01,18:27 -m          t -w /var/opt/ignite/recovery/client_mnt/0x00306E5C3FF8/recovery/2003-          10-01,18:27/recovery.log -u -R -g /var/opt/ignite/recovery/client_mnt/          0x00306E5C3FF8/recovery/2003-10-01,18:27/flist -a 2929740        * Preparing to create a system archive        * The archive is estimated to reach 1464870 kbytes.        * Free space on /var/opt/ignite/recovery/arch_mnt          after archive should be about 1324738 kbytes.        * Archiving contents of hpeos003 via tar to              /var/opt/ignite/recovery/arch_mnt/2003-10-01,18:27.        * Creation of system archive complete NOTE: Could not read the /etc/resolv.conf file.        * Creating CINDEX Configuration File        * /opt/ignite/bin/manage_index -q -c 2003-10-01,18:27\ Recovery\ Archive          -i /var/opt/ignite/recovery/client_mnt/0x00306E5C3FF8/CINDEX -u          Recovery\ Archive =======  10/01/03 18:44:04 BST  make_net_recovery completed successfully! root@hpeos003[] 

I can include other files, directories, and volume groups by using options such as “x include=filedir and “x inc_entire=dskvg . The archive will be created on the Ignite/Archive Server under a subdirectory named after the MAC address of my LAN card (the LAN card used can be modified using the “l <MAC> option). The configuration files generated are stored under a directory whose name reflects the time the last archive was created:

 

 root@hpeos004[recovery]  ll  total 4 drwxr-xr-x   2 bin        bin           1024 Oct  1 18:44 2003-10-01,18:27 -rw-------   1 bin        sys            290 Oct  1 18:44 client_status lrwx------   1 bin        bin             16 Oct  1 18:28 latest -> 2003-10-01,18:27 root@hpeos004[recovery]  ll 2003-10-01,18:27/  total 9110 -rw-------   1 bin        sys           3375 Oct  1 18:28 archive_cfg -rw-------   1 bin        sys             17 Oct  1 18:28 archive_content -rw-------   1 bin        sys            289 Oct  1 18:28 control_cfg -rw-------   1 bin        sys        4637951 Oct  1 18:28 flist -rw-------   1 bin        sys           8341 Oct  1 18:44 manifest -rw-------   1 bin        sys           3467 Oct  1 18:44 recovery.log -rw-------   1 bin        sys           5796 Oct  1 18:28 system_cfg root@hpeos004[recovery] 

Interestingly, make_net_recovery has created an Ignite-UX INDEX file for this client:

 

 root@hpeos004[hpeos003]  pwd  /var/opt/ignite/clients/hpeos003 root@hpeos004[hpeos003]  cat CINDEX  # CINDEX # This file is used to define the Ignite-UX configurations # and to define which config files are associated with each # configuration. See the ignite(5), instl_adm(4), and # manage_index(1M) man pages for details. # # NOTE: The manage_index command is used to maintain this file. #       Comments, logic expressions and formatting changes are not #       preserved by manage_index. # # WARNING: User comments (lines beginning with '#'), and any user #          formatting in the body of this file are _not_ preserved #          when the version of Ignite-UX is updated. # cfg "2003-10-01,18:27 Recovery Archive" {         description "Recovery Archive"         "recovery/2003-10-01,18:27/system_cfg"         "recovery/2003-10-01,18:27/control_cfg"         "recovery/2003-10-01,18:27/archive_cfg" }=TRUE root@hpeos004[hpeos003] 

Every time a new archive is created, a new entry in this file will be created and the new archive is made the default choice. By default, make_net_recovery will maintain the last two archives per client; we can modify this with the “n <num of archives> option to make_net_recovery . We can view these configurations with manage_index command as long as we specify the location of the CINDEX file:

 

 root@hpeos004[hpeos003]  manage_index l -i /var/opt/ignite/clients/hpeos003/CINDEX  2003-10-01,18:27 Recovery Archive root@hpeos004[hpeos003] 

An interesting addition to this would be to include the mirroring of your root disk after the installation was complete. Although we may install the disk mirroring software, it would take additional work to ensure that the functionality was added to the client once the archive was installed. Here, I have added an entry to the CINDEX file for this client:

 

 root@hpeos004[hpeos003]  vi CINDEX  # CINDEX # This file is used to define the Ignite-UX configurations # and to define which config files are associated with each # configuration. See the ignite(5), instl_adm(4), and # manage_index(1M) man pages for details. # # NOTE: The manage_index command is used to maintain this file. #       Comments, logic expressions and formatting changes are not #       preserved by manage_index. # # WARNING: User comments (lines beginning with '#'), and any user #          formatting in the body of this file are _not_ preserved #          when the version of Ignite-UX is updated. # cfg "2003-10-01,18:27 Recovery Archive" {         description "Recovery Archive"         "recovery/2003-10-01,18:27/system_cfg"         "recovery/2003-10-01,18:27/control_cfg"         "recovery/2003-10-01,18:27/archive_cfg"         "recovery/2003-10-01,18:27/config.local" }=TRUE root@hpeos004[hpeos003] 

I need to create the config.local file. This script will make use of the post_config_cmd variable, which is one way of performing additional tasks after the installation has completed. Here's my interpretation of this for my client hpeos003:

 

 root@hpeos004[hpeos003]  vi recovery/ 2003-10-01,18:27/config.local  ######################################################### ######## Begin user changes to add disk mirroring. ######## post_config_cmd +=" # Recreate a mirror of the boot disk. # Make sure the disk is removed from the group by using # vgreduce. Alternatively you could edit the vg00 # definition to remove the references to this disk. vgreduce /dev/vg00 /dev/dsk/c3t15d0 # Make the disk contain a boot area. pvcreate -f -B /dev/rdsk/c3t15d0 # Add the mirrored disk back to the group. vgextend /dev/vg00 /dev/dsk/c3t15d0 # Copy the boot area to the disk. mkboot /dev/rdsk/c3t15d0 # Turn off the quorum requirement on both disks mkboot -a \"hpux -lq\" /dev/rdsk/c3t15d0 mkboot -a \"hpux -lq\" /dev/rdsk/c1t15d0 # Allocate the mirrors. Mirrors must be allocated for all # logical volumes that were previously mirrored. This # example illustrates primary swap and root. You should # add others as needed. If /stand is in a separate volume, you # should do an lvextend for it first. for x in 1 2 3 4 5 6 7 8 do lvextend -m 1 /dev/vg00/lvol${x} /dev/dsk/c3t15d0 done # Update the BDRA and the LABEL file. lvlnboot -vR " ######## End user changes to add disk mirroring. ######## ######################################################### root@hpeos004[hpeos003] 

This script would need tuning for your own clients. I can check the syntax of this file with the instl_adm command.

 

 root@hpeos004[hpeos003]  instl_adm -T -f recovery/2003-10-01,18:27/config.local  root@hpeos004[hpeos003] 

I could include such a script for all my Recovery Archives, if appropriate.

At this point, I am now a little concerned that we still have some options in the INSTALLFS file that could affect a Recovery Archive. In particular, I am concerned with setting the root password even on a Recovery Archive. At this point, I would be looking at taking that option out of the INSTALLFS file and placing it in specific configuration files where it is appropriate.

 

 root@hpeos004[]  instl_adm -d  # instl_adm defaults: # NOTE: Manual additions between the lines containing "instl_adm defaults" #       and "end instl_adm defaults" will not be preserved. server="192.168.0.35" netmask[]="0xffffffe0" route_gateway[0]="" route_destination[0]="default" sd_server="192.168.0.35" # end instl_adm defaults. run_ui=false control_from_server=true disable_dhcp=true   !(cfg "Golden Image") {     root_password="sv.epmVgln4pU,.."     }   timezone="GMT0BST" is_net_info_temporary=false _hp_keyboard="PS2_DIN_US_English" root@hpeos004[] root@hpeos004[]  instl_adm -d > /tmp/instl_adm.out  root@hpeos004[] root@hpeos004[]  vi /tmp/instl_adm.out  # instl_adm defaults: # NOTE: Manual additions between the lines containing "instl_adm defaults" #       and "end instl_adm defaults" will not be preserved. server="192.168.0.35" netmask[]="0xffffffe0" route_gateway[0]="" route_destination[0]="default" sd_server="192.168.0.35" # end instl_adm defaults. run_ui=false control_from_server=true disable_dhcp=true timezone="GMT0BST" is_net_info_temporary=false _hp_keyboard="PS2_DIN_US_English" root@hpeos004[] root@hpeos004[]  instl_adm -f /tmp/instl_adm.out  root@hpeos004[] 

Consequently, we can use these configuration clauses in a bootsys command if we want to install a client from this archive:

 

 root@hpeos004[hpeos003]  bootsys -f -a -i "2003-10-01,18:27 Recovery Archive"   hpeos003  Rebooting hpeos003 now. root@hpeos004[hpeos003] 

When the installation is complete, all the logical volumes in vg00 should be mirrored:

 

 root@hpeos003[]  lvlnboot -v  Boot Definitions for Volume Group /dev/vg00: Physical Volumes belonging in Root Volume Group:         /dev/dsk/c1t15d0 (0/0/1/1.15.0) -- Boot Disk         /dev/dsk/c3t15d0 (0/0/2/1.15.0) -- Boot Disk Boot: lvol1     on:     /dev/dsk/c1t15d0                         /dev/dsk/c3t15d0 Root: lvol3     on:     /dev/dsk/c1t15d0                         /dev/dsk/c3t15d0 Swap: lvol2     on:     /dev/dsk/c1t15d0                         /dev/dsk/c3t15d0 Dump: lvol2     on:     /dev/dsk/c1t15d0, 0 root@hpeos003[] 

This looks like it has been successful. I could perform a number of additional steps to check that the mirroring of all volumes in vg00 was completed successfully. You have to take my word for it that it worked perfectly well.



HP-UX CSE(c) Official Study Guide and Desk Reference
HP-UX CSE(c) Official Study Guide and Desk Reference
ISBN: N/A
EAN: N/A
Year: 2006
Pages: 434

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net