Section 10.3. Setup of a Noninteractive Restore


10.3. Setup of a Noninteractive Restore

Setting up a noninteractive restore entails more work, but it can help quite a bit during recovery. In addition to allowing the recovery to complete without interaction, a noninteractive restore can also add the following features:

  • Setup of preinstallation tasks and configuration of variables prior to restoration for systems with dissimilar hardware

  • Post-installation tasks prior to the final reboot, such as software installation, boot process modifications, etc.

10.3.1. Noninteractive Setup Files

Jumpstart has been used for many years to automate the installation of Solaris. Flash archive uses some of the same technology as Jumpstart; for example, it uses the concept of the profile, rules, and sysidcfg files to provide for a noninteractive restore from a flash archive image. Therefore, in addition to creating your flash archive, you need to create these files to prepare for a noninteractive restore. After creating these files, ensure that root is the owner of each file and that permission on each is set to 644.

10.3.1.1. profile

A profile file specifies the filesystems to be backed up, the target they are backed up to, and the install method used during recovery. The profile can be named anything as long as the name of the profile is specified in the rules file. Profiles can be static or created dynamically via a begin script. Profiles that are created dynamically by a begin script are called derived profiles.

Here is an example of a static profile. A static profile contains several rows of parameters followed by values, separated by whitespace. When creating a static profile, ensure root owns the file and that permissions on the profile are set to 644. The following parameters should be included in every profile created for use with flash archive:


install_type

This should say flash_install to indicate this is a flash recovery. (Remember profiles are used for other things, such as Jumpstart.)


archive_location

Specify where this unattended restore gets its data from. This can be either local_tape device_name file_# or nfs nfserver:/path/imagefile.


partitioning

Since we are restoring from a flash archive, use explicit partitioning so that you can create filesystems that support your flash recovery as well as your overall recovery plan. When using the explicit option, use the filesys keyword to define and partition available disk space.


filesys

Specify one or more lines containing the names of the filesystems (and swap) partitions. Each line must contain the keywords filesys diskname size mountpoint:

install_type    flash_install archive_location        local_tape      /dev/rmt/0n 1 partitioning    explicit filesys c0t0d0s0        7000 / filesys c0t0d0s1        2000 swap

While this example shows an existing static profile that is copied to tape, a begin script that can create a derived or custom profile on the fly during the recovery process provides increased flexibility when restoring to systems with dissimilar hardware. Examples of this flexibility include probing system devices, prompting for user input when selecting and partitioning disks, and selecting which tape drive will be used.

Here is a basic begin script that creates a derived profile that looks like the static profile shown later in this chapter. Like the profile, this script can be named anything; it just has to be named in the rules file.

#!/bin/sh echo "install_type    flash_install"                              > ${SI_PROFILE} echo "archive_location         local tape    /dev/rmt/0n 1" >> ${SI_PROFILE} echo "partitioning     explicit"                                   >> ${SI_PROFILE} echo "filesys       c0t0d0s0        7000    / "                >> ${SI_PROFILE} echo "filesys       c0t0d0s1        2000    swap"            >> ${SI_PROFILE}

When creating a begin script, you must use the ${SI_PROFILE} variable as shown here.


Again, this is very basic, and there wouldn't be much point to creating a script like this one because it creates a profile just like our static example. However, with a little creative scripting, you can turn a begin script into a very useful tool that can probe system devices, check minimum disk sizes, and request user input for unknown variables. For example, it can display a list of tape drive devices and ask the user to specify which one she wants to use. More information on creating a begin script can be found in the flash archive recovery documentation.

10.3.1.2. The rules file

The rules file specifies which profile, begin scripts, and finish scripts are used during the restore process. A rules.ok file is created automatically after running the check command against your rules file. The layout of this file is as follows:

[keyword(s)]    [keyword(s) value]     [begin script]  [profile]    [finish script]

For example:

any            -            -        standard        -

This example states that any (or every) system should use the standard profile to configure the restored system, with no begin or finish scripts. Jumpstart rules files can be a lot more complex and powerful. While a rules file requires only one rule, you can specify many rules for setting up systems based on configuration, architecture, and more.

10.3.1.3. The sysidcfg file

The sysidcfg file contains information used to configure the system during the restore process. Though not shown in the following example (and generally not recommended from a security perspective), an encrypted root password can also be included in the sysidcfg file. For more information on using this option, refer to the Solaris Installation documentation.

Here is an example of a sysidcfg file. The keywords and their meanings are relatively straightforward.

        system_locale=C         timezone=US/Pacific         network_interface=primary {hostname=sun2                 default_route=192.168.1.253                 ip_address=192.168.1.34                         netmask=255.255.255.0                     protocol_ipv6=no}         security_policy=NONE         name_service=NONE         timeserver=localhost

Once these setup files are created, you can integrate them with the flash archive image created in the section "Preparing for an Interactive Restore," earlier in this chapter.

10.3.2. Creating a Noninteractive Tape Image

Once the image has been created, you can create a tape that can be used to perform a bare-metal recovery. The following steps create a flash archive image on disk and copy it to tape:

  1. Create sysidcfg, rules, and profile (or begin script) files.

  2. Run check against the rules file to create rules.ok.

  3. Create flash image on disk, using flar create (see the earlier section "Preparing for an Interactive Restore").

If the check script is not on your local server, it can be run from or copied from the Solaris CD/DVD.


  1. tar sysidcfg, rules, rules.ok, and profile (or begin script) files to the tape.

  2. dd the flash image to tape. Alternatively, you can follow steps 14, then create the flash archive image directly to tape using the flar create command.

The following is an example of this process starting with step 4:

# tar cvf /dev/rmt/0n rules rules.ok sysidcfg standard.profile a rules 1 tape blocks a rules.ok 1 tape blocks a sysidcfg 1 tape blocks a standard.profile 1 tape blocks # dd if=sun2.flar of=/dev/rmt/0n obs=1024000

10.3.3. Creating a Noninteractive Disk Image

If you wish to perform a noninteractive restore from an NFS mount, you should have a properly configured Solaris network boot server configured on your network and boot using the boot net install command. In this case, how your individual environment is set up dictates where the server configuration files (profile, rules, and sysidcfg) should be stored.

Building and booting from a custom Solaris CD/DVD that restores using an existing Jumpstart server over the network is also possible but is not covered in depth in this chapter.

To perform a noninteractive restore:

  1. First, ensure that the system is powered on and that it is at the ok> prompt.

  2. Check whether your boot and recovery devices are available by performing a probe:

  3. ok> probe-scsi-all                      

  4. A list of locally attached devices should be displayed. Ensure that, at a minimum, the local boot disk, a CD/DVD drive (if applicable), and the correct SCSI tape drives are listed.

  5. If you plan to restore from tape, insert the tape into a local tape drive.

In the example profile file, there is one tape drive connected to the server (/dev/rmt/0n). If a tape drive is hardcoded into the profile file, that same drive must be used here. To avoid this requirement, use a begin script to create a profile, on the fly, during the restore process.


  1. Boot the system.

    1. If you are restoring from tape, insert the Solaris Installation CD into the appropriate device on the system you want to restore. At the ok> prompt, enter:

    2.                                boot cdrom - install tape=/dev/rmt/0n                             

    3. The system boots, and the installation process starts. The system boots from the CD/DVD and looks for the required files on tape. If present, any prerecovery scripts execute, and the archive extraction begins. The extracted rules.ok, profile, and sysidcfg files are used to configure the server.

    4. If you are restoring from an NFS mount, you need to have a network boot server configured and boot from the network using the boot net install command. The system looks for the network boot server to provide the location of the required configuration files and flash image.

Here's the output from a noninteractive restore:

ok boot cdrom - install tape=/dev/rmt/0n Resetting ...  SPARCstation 5, No Keyboard ROM Rev. 2.15, 96 MB memory installed, Serial #7760400. Ethernet address 8:0:20:76:6a:22, Host ID: 80766a00. Rebooting with command: cdrom - install tape=/dev/rmt/0n               Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@6,0:d   File and args: - install tape=/dev/rmt/0n SunOS Release 5.9 Version Generic_118558-11 32-bit Copyright 1983-2003 Sun Microsystems, Inc.  All rights reserved. Use is subject to license terms. Configuring /dev and /devices Using RPC Bootparams for network configuration information. Skipping interface le0 Skipping interface hme0 Searching for configuration file(s)... Using sysid configuration file from /dev/rmt/0n position 0 Search complete. The system is coming up. Please wait. Begin system identification... Starting remote procedure call (RPC) services: sysidns done. System identification complete. Generating software table of contents [this may take a few minutes...] Table of contents complete. Starting Solaris installation program... Searching for JumpStart directory... Using rules.ok from tape. Checking rules.ok file... Using profile: standard.profile Executing JumpStart preinstall phase... Searching for SolStart directory... Checking rules.ok file... Using begin script: install_begin Using finish script: patch_finish Executing SolStart preinstall phase... Executing begin script "install_begin"... Begin script install_begin execution completed. Processing profile         - Opening Flash archive         - Validating Flash archive         - Selecting all disks         - Configuring boot device         - Configuring / (c0t1d0s0)         - Configuring swap (c0t1d0s1)         - Configuring /export/home (c0t3d0s7) Verifying disk configuration         - WARNING: Unused disk space (c0t1d0)         - WARNING: Unused disk space (c0t3d0) Verifying space allocation         NOTE: 1 archives did not include size information Preparing system for Flash install Configuring disk (c0t1d0)         - Creating Solaris disk label (VTOC) Configuring disk (c0t3d0)         - Creating Solaris disk label (VTOC) Creating and checking UFS file systems         - Creating / (c0t1d0s0)         - Creating /export/home (c0t3d0s7) Beginning Flash archive processing Predeployment processing 8 blocks 16 blocks 8 blocks No local customization defined Extracting archive: sun2.flar         Extracted    0.00 MB (  0% of  448.73 MB archive)         Extracted    1.95 MB (  0% of  448.73 MB archive)                ~truncated~                 Extracted  448.72 MB ( 99% of  448.73 MB archive)         Extraction complete Postdeployment processing No local customization defined Customizing system files         - Mount points table (/etc/vfstab)         - Network host addresses (/etc/hosts) Cleaning devices Customizing system devices         - Physical devices (/devices)         - Logical devices (/dev) Installing boot information         - Installing boot blocks (c0t1d0s0) Installation log location         - /a/var/sadm/system/logs/install_log (before reboot)         - /var/sadm/system/logs/install_log (after reboot) Flash installation complete Executing JumpStart postinstall phase... The begin script log 'begin.log' is located in /var/sadm/system/logs after reboot. syncing file systems... done rebooting... Resetting ... 

Once the restore completes successfully, any post-recovery scripts are then executed, and the system reboots. If you did not specify an encrypted root password in the sysidcfg file, you are prompted to enter a root password during the next boot. The recovery is now complete.

10.3.4. Post-Recovery Procedures

Regardless of the method you use (interactive or noninteractive), once the flash archive has been restored, some post recovery work may need to be completed. How much and how complex that work is varies depending on the system configuration. It is very important to understand how your systems are set up to allow for the building of a successful end-to-end recovery procedure.

For example, if a system with a VxVM encapsulated root disk has been restored, the system will not boot following the flash recovery. It doesn't boot because Veritas Volume Manager is expecting to find an encapsulated root disk, which no longer exists. In this scenario, you must boot from the Solaris CD into single-user mode and make the necessary changes to disable the loading of VxVM for the system to boot properly.

If you restore to a system with a different root disk, you may need to reconfigure the boot device EEPROM:

    Original Server Root Disk        Target Server Root Disk         c0t0d0s0                                   c1t0d0s0




Backup & Recovery
Backup & Recovery: Inexpensive Backup Solutions for Open Systems
ISBN: 0596102461
EAN: 2147483647
Year: 2006
Pages: 237

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