10.3. Setup of a Noninteractive RestoreSetting 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:
10.3.1. Noninteractive Setup FilesJumpstart 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. profileA 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:
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}
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 fileThe 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 fileThe 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 ImageOnce 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:
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 ImageIf 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:
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 ProceduresRegardless 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 |