Symantec logo

vxchg_rootid

NAME

vxchg_rootid - set up VxVM root disk that has been cloned or copied from another operational VxVM root disk

SYNOPSIS

/etc/vx/bin/vxchg_rootid [-g new_dg] [-N] [-R] [-S]
[-s script_path] [-v] new_host_name new_root_da

DESCRIPTION

The vxchg_rootid command sets up a VxVM root disk that has been freshly cloned by using the dd command, or by using a hardware-based procedure such as EMC Symmetrix BCV cloning. The disk ID and disk group ID fields in the private region header and the configuration records are changed from their cloned values to ensure that they are unique. The new host name is written to the host ID fields of the private region header and to the /etc/vx/volboot file. Script files in /etc, /usr and /var, that contain hard-coded host name values, are modified to use the new host name (new_host_name).

If no options are specified, values in the /etc/rc.config.d/netconf file are initialized such that when the new root disk is first booted, the "set_parms initial" dialog menu is displayed. This allows you to enter the system host name and network parameters manually.

OPTIONS

-g new_dg

Specifies the name of the disk group for the new root disk. If this option is not used, the new root disk remains in the same disk group as the source disk.

-N

Provides a method of updating a current host for a new release of the HP-UX operating system.

The command attempts to use NFS to mount the root directory of the current root disk from which new_host_name was booted. This assumes that the specified host already exists and is accessible over the network. The root directory is temporarily mounted using the new_host_name:/ syntax. For this to work, the /etc/exports file on the target system must have been edited to contain an entry for /, and the exportfs command must have been run to give root permission to the host on which the vxchg_rootid command is to be invoked.

When the old root file system has been mounted, and the freshly cloned root file system has also been temporarily imported and mounted, system-specific files are copied from the old to the new root file system. The files that are copied include:

/etc/exports

/etc/fstab

/etc/hosts

/etc/lvmtab

/etc/passwd

/etc/rc.config.d/netconf

/etc/resolv.conf

/etc/vx/elm/*

/etc/vx/licenses/*

-R

Provides a method of obtaining and updating machine-specific information on a remote target host. When the new disk ID and disk group ID fields have been changed on the cloned disk, the command uses remsh to execute appropriate commands to find the new root disk as it is enumerated on the remote host. Once a match has been found, the name and hardware path of the new disk as it exists on the remote host are extracted. The disk name information is used to update the /stand/bootconf file with the correct value. The hardware path information is used with the setboot command to set the boot device in the target host's NVRAM.

The criteria for making the setboot changes are as follows:

Starts an interactive Bourne shell when the new root file system has been temporarily mounted. This allows manual changes to be made to the configuration before it is booted on the new host. When the changes have been completed, exit the shell to allow the vxchg_rootid command to continue to completion. Immediately before starting the shell, a message is output to indicate the mount point of the temporarily mounted new root file system.

-s script_path

Runs the specified shell script after the new root file system has been temporarily mounted. This allows you to make any automated changes to the configuration files that are required. When the script exits, the vxchg_rootid command continues to completion if a 0 exit status is received, or aborts if a non-zero exit status is received.

If any command arguments are required to the script, place script_path and its arguments in quotes.

To allow operational control from the invoked shell script, the new host name and the temporary mount point of the new root file system are passed to the script as the last two arguments. Thus, the calling sequence for the invoked shell script is:

user_script script_arguments host_name mount_point

For example, the calling sequence for the script, patch_db, which takes the internal arguments db_path and token would be:

patch_db db_path token newhost temp_mount

-v

Outputs verbose messages, including a time stamp, which indicates the major operations that are being performed.

ARGUMENTS

new_host_name

The host name of that target machine that is to inherit the newly cloned disk as its root disk when accessed via a SAN boot.

new_root_da

The disk access name (CTD name) of the freshly cloned root.

NOTES

The order in which any optional operations are completed is important as it may determine what can be accomplished in a script, or what must be done manually. This is the order of operations that are performed by vxchg_rootid:

1.

Perform sanity checks on the arguments and options specified. These checks include:

If the -N option was specified, attempt to mount the current root file system over NFS. If the target host does not grant access, the mount is unsuccessful and the vxchg_rootid command exits without performing any configuration operations.

3.

The main operations of the vxchg_rootid command are accomplished up to the unmounting of the file systems on the new root. These operations include:

If the -N option was specified, system-specific files (listed in the DESCRIPTION section) are copied from the old to the new root file system.

5.

If the -s option was specified, the script file is executed.

6.

If the -S option was specified, start an interactive Bourne shell. This allows the contents of the new root file system and all of its subordinate file systems to be inspected, and any required manual operations to be performed. When the shell exits, the vxchg_rootid command runs to completion.

7.

All temporarily mounted file systems are unmounted.

8.

The new root disk clone is deported.

9.

The host ID value in the new root disk clone's private region is patched with the specified value.

10.

The vxchg_rootid command exits.

When the vxchg_rootid command is executed, messages similar to the following may be displayed on the system console:

vxvm:vxconfigd: WARNING: Group rootdg: \

Duplicate virtual device number(s):

Volume standvol remapped from 2,5 to 2,8388607

Volume swapvol remapped from 2,1 to 2,8388606

Volume rootvol remapped from 2,0 to 2,8388605

Volume tmpvol remapped from 2,6 to 2,8388604

Volume homevol remapped from 2,7 to 2,8388603

Volume optvol remapped from 2,8 to 2,8388602

Volume usrvol remapped from 2,9 to 2,8388601

Volume varvol remapped from 2,10 to 2,8388600

These messages are the normal consequence of temporarily importing the cloned rootdg disk group and starting its volumes. The minor device numbers of the indicated volumes are changed, but only for the period that they are temporarily imported.

EXAMPLES

This example shows the vxchg_rootid command being invoked in its simpliest form:

/etc/vx/bin/vxchg_rootid new_host c5t12d0

The next example shows the vxchg_rootid command being invoked with the -s option. Note that quoted script arguments are also specified. In this case, the test_script script echoes each of the four arguments:

vxchg_rootid -s "/test_script arg1 arg2" furnace c5t12d0

test_script: Args are arg1 arg2 furnace /tmp/tmpmnt1.6523

The next example is similar to the one above, except that the -N, -R and -v options are also specified. (The time stamp is usually placed on the line as each message, but this output has been edited for clarity.)

# cd /etc/vx/bin

# ./vxchg_rootid -RNvs "/test_script arg1 arg2" hpilb09 c8t4d4

vxchg_rootid 16:29:

Checking configuration of cloned disk and disk group

vxchg_rootid 16:29:

Mounting hpilb09:/ on /tmp/tmpmnt2.6376

vxchg_rootid 16:29:

Checking remsh remote access

vxchg_rootid 16:29:

Patching disk ID and disk group ID values on disk c8t4d4

vxchg_rootid 16:29:

Rescanning the configuration

vxchg_rootid 16:29:

Temporarily importing new root as rootdg.6376 disk group

vxchg_rootid 16:29:

Checking & mounting root FS on /tmp/tmpmnt1.6376

vxchg_rootid 16:29:

Checking & mounting stand FS on /tmp/tmpmnt1.6376/stand

vxchg_rootid 16:29:

Checking & mounting opt FS on /tmp/tmpmnt1.6376/opt

vxchg_rootid 16:29:

Checking & mounting tmp FS on /tmp/tmpmnt1.6376/tmp

vxchg_rootid 16:29:

Checking & mounting var FS on /tmp/tmpmnt1.6376/var

vxchg_rootid 16:29:

Checking & mounting home FS on /tmp/tmpmnt1.6376/home

vxchg_rootid 16:29:

Checking & mounting usr FS on /tmp/tmpmnt1.6376/usr

vxchg_rootid 16:29:

Initializing netconf & Veritas license files.

vxchg_rootid 16:29:

Setting host name into volboot and other selected files.

vxchg_rootid 16:29:

Copying selected files from NFS mounted host.

vxchg_rootid 16:29:

Finding cloned root on remote host hpilb09

vxchg_rootid 16:29:

Disk c8t4d4 will appear as c7t4d4 on target host hpilb09

vxchg_rootid 16:29:

HW path of c7t4d4 on target host is 0/4/0/0.1.3.0.0.4.4

vxchg_rootid 16:29:

Setting devpath in /stand/bootconf file to /dev/dsk/c7t4d4

vxchg_rootid 16:29:

Current setboot values for remote host hpilb09:

vxchg_rootid 16:29:

Primary: 0/4/0/0.1.3.0.0.4.3

vxchg_rootid 16:29:

Alternate: 0/4/0/0.1.3.0.0.4.2

vxchg_rootid 16:29:

Making disk c7t4d4 (0/4/0/0.1.3.0.0.4.4) the primary boot disk

vxchg_rootid 16:29:

Making Alternate boot disk old primary (0/4/0/0.1.3.0.0.4.3)

vxchg_rootid 16:29:

Calling /test_script arg1 arg2 hpilb09 /tmp/tmpmnt1.6376.

test_script: Args are arg1 arg2 hpilb09 /tmp/tmpmnt1.6376

vxchg_rootid 16:29:

Unmounting temporarily mounted file systems.

vxchg_rootid 16:29:

Deporting rootdg.6376 disk group

vxchg_rootid 16:29:

Patching Private Region hostid to hpilb09 on disk c8t4d4.

vxchg_rootid 16:29:

Disk c8t4d4 is now suitable for booting on host hpilb09

SEE ALSO

dd(1), remsh(1), setboot(1M), hosts.equiv(4)