ENTERPRISE

Bare-Metal Recovery : Solaris Bare-Metal Recovery - Setup of a Noninteractive Restore (part 1) - Noninteractive Setup Files, Creating a Noninteractive Tape Image

2/1/2015 8:44:40 PM

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.

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.

profile

A profile file specifies the filesystems to be created, the disks they are created on, and the install method used during the 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.

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}

Tip

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.

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.

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

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 .

Tip

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 1–4, 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
Other  
  •  Bare-Metal Recovery : Solaris Bare-Metal Recovery - Preparing for an Interactive Restore (part 2) - Bare-Metal Recovery with Flash Archive
  •  Bare-Metal Recovery : Solaris Bare-Metal Recovery - Preparing for an Interactive Restore (part 1) - Creating Flash Archive Images
  •  Bare-Metal Recovery : Solaris Bare-Metal Recovery - Using Flash Archive
  •  Commercial Backup Utilities (part 1) - Full Support of Your Platforms, Backup of Raw Partitions
  •  Programming WCF Services : Instance Management - Behaviors
  •  SAP Planning : Best Practices Approach to Staffing the SAP TSO
  •  Creating Interactive Windows Services : Services and Polling - Using Configuration Files
  •  Creating Interactive Windows Services : Services and Polling - Updating Tutorials.ThreadFunc
  •  Windows System Programming : Exception Handling - Vectored Exception Handling
  •  Windows System Programming : Exception Handling - Example: A Console Control Handler
  •  
    Video
    Video tutorials
    - How To Install Windows 8

    - How To Install Windows Server 2012

    - How To Install Windows Server 2012 On VirtualBox

    - How To Disable Windows 8 Metro UI

    - How To Install Windows Store Apps From Windows 8 Classic Desktop

    - How To Disable Windows Update in Windows 8

    - How To Disable Windows 8 Metro UI

    - How To Add Widgets To Windows 8 Lock Screen

    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010
    programming4us programming4us
    Top 10
    Free Mobile And Desktop Apps For Accessing Restricted Websites
    MASERATI QUATTROPORTE; DIESEL : Lure of Italian limos
    TOYOTA CAMRY 2; 2.5 : Camry now more comely
    KIA SORENTO 2.2CRDi : Fuel-sipping slugger
    How To Setup, Password Protect & Encrypt Wireless Internet Connection
    Emulate And Run iPad Apps On Windows, Mac OS X & Linux With iPadian
    Backup & Restore Game Progress From Any Game With SaveGameProgress
    Generate A Facebook Timeline Cover Using A Free App
    New App for Women ‘Remix’ Offers Fashion Advice & Style Tips
    SG50 Ferrari F12berlinetta : Prancing Horse for Lion City's 50th
    Popular Tags
    Video Tutorail Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Exchange Server Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe Photoshop CorelDRAW X5 CorelDraw 10 windows Phone 7 windows Phone 8 Iphone