Archive for

June 21st, 2012

...

Moving the DVD-RAM Between LPARs using the VIO server

Comments Off

Question

Is there a method to share the DVD-RAM or DVD-ROM device on System p servers that does not require a dynamic logical partition (DLPAR) action?

Cause

Limitations of the hardware

Answer

One of the common features normally available with HMC attached System p servers is the ability to use Dynamic Logical Partitioning (DLPAR) to add/move/remove I/O devices such as the CDROM or DVD controller between LPARs without taking an outage. The functionality required for DLPAR actions includes an active network connections between the LPARs and the HMC over port 657. If you have a virtual I/O (VIO) server partition that owns the DVD controller then you can run a few simple commands on the VIO server to allow you to map cd0 from one client LPAR to another using virtual SCSI.

The process to move cd0 from one logical partition to another using VIO server commands is illustrated below. The example assumes the user is logged in as padmin on VIO server:

- Determine if the VIO server owns an optical device we use the lsdev command.
$ lsdev -type optical
name status description
cd0 Available IDE DVD-ROM Drive

 

- Determine if cd0 is already mapped to a client LPAR we use the lsmap command.
$ lsmap -all |more
SVSA Physloc Client Partition ID
————— ——————————————– ——————
vhost0 U9111.520.104797E-V1-C11 0×00000002

VTD vtscsi0
LUN 0×8100000000000000
Backing device rootvg2a
Physloc

SVSA Physloc Client Partition ID
————— ——————————————– ——————
vhost1 U9111.520.104797E-V1-C13 0×00000003

VTD vtscsi1
LUN 0×8100000000000000
Backing device rootvg3a
Physloc

VTD vtscsi2
LUN 0×8200000000000000
Backing device datavg3a
Physloc

- Looking through the “Backing device” section of each vhosts we do not see cd0 listed. We could have run “lsmap -all | grep cd0″ as a quick check as well.

- To assign device cd0 to LPAR ID 2 we first need to locate its associated virtual SCSI server (vhost) device from the output listed above. If you look at the “Client Partition ID” section of the lsmap output you can see that vhost0 is associated with partition ID 2 (hex 0×00000002).

- To make the virtual SCSI map of cd0 to LPAR ID 2, we use mkvdev as follows:

$ mkvdev -vdev cd0 -vadapter vhost0
vtopt0 Available

- To check to see if cd0 and vtopt0 show up under vhost0 resources we use lsmap.

$ lsmap -vadapter vhost0
SVSA Physloc Client Partition ID
————— ——————————————– ——————
vhost0 U9111.520.104797E-V1-C11 0×00000002

VTD vtopt0
LUN 0×8200000000000000
Backing device cd0
Physloc U787A.001.DPM06E2-P4-D2

VTD vtscsi0
LUN 0×8100000000000000
Backing device rootvg2a
Physloc

By virtually mapping the DVD device cd0 to LPAR 2′s vhost, there is no need to make changes to the LPAR’s profile or perform further actions such as DLPAR functions from the HMC. The cd0 device is now ready for the client LPAR to use. If the LPAR is already in a running state, the cfgmgr command would need to be run as root on the client LPAR so the new device could be configured. If the LPAR is not activated then once it is started, the DVD device will be available for performing installation or maintenance functions on the LPAR.

Once LPAR 2 is finished using the DVD, it can then be removed and mapped to a different LPAR if desired. For example, suppose that LPAR ID 3 needed the DVD for maintenance, by removing the VTD name from vhost0 and making a new virtual SCSI map to vhost1, we would be giving LPAR 3 access to the DVD. Following commands illustrate the actions required.

$ rmdev -dev vtopt0 -recursive
vtopt0 deleted

$ mkvdev -vdev cd0 -vadapter vhost1
vtopt0 Available

$ lsmap -vadapter vhost1

SVSA Physloc Client Partition ID
————— ——————————————– ——————
vhost1 U9111.520.104797E-V1-C13 0×00000003

VTD vtopt0
LUN 0×8500000000000000
Backing device cd0
Physloc U787A.001.DPM06E2-P4-D2

VTD vtscsi1
LUN 0×8100000000000000
Backing device rootvg3a
Physloc

VTD vtscsi2
LUN 0×8200000000000000
Backing device datavg3a
Physloc

The process of virtual mapping of the optical device, cd0, between client LPARs of a VIO server is much simpler than trying to perform DLPAR related functions to achieve the same result since all the interaction takes place on the VIO server command line.

Comments Off

My AIX client LPAR has error ED995F18 VSCSI_ERR3 logged against my vscsi client adapter.

Comments Off

Question

Why does my AIX client LPAR log errors against my vscsi client adapter when I move my DVD-RAM between LPARs ?

Cause

The DVD-RAM drive is the ONLY backing device mapped through a vhost to a vscsi client adapter. Then cd0 backing device is removed from the vhost adapter that is mapped to the vscsi adapter before removing the vscsi client adapter and cd0 from the ODM definitions on the client LPAR.

Answer

To properly move a DVD-RAM drive from a client LPAR to another client LPAR when the DVD-RAM is the only backing device of the vhost adapter that is mapped to the owning client LPAR’s vscsi client adapter, you must first remove the cd0 and vscsi client adapter definitions from the owning LPAR’s ODM.

Example:

VIO1, vhost2 (V1-C12) is mapped to LPAR ID 3, vscsi2 (V3-C99)

(V3-C99) is mapped backed to VIO1, vhost2 (V1-C12)

cd0 is the ONLY backing device for vhost2:
$ lsmap -vadapter vhost2
SVSA Physloc Client Partition ID
————— ——————————————– ——————
vhost0 U9111.520.104797E-V1-C12 0×00000003

VTD vtopt0
LUN 0×8200000000000000
Backing device cd0
Physloc U787A.001.DPM06E2-P4-D2

 

If cd0 is removed from vhost2, this will cause the VSCSI_ERR3 on client LPAR ID 3 because the system assumes the device is lost and therefore, the vscsi path is now in a defined state and no longer available.

# lsdev -Cc adapter

vscsi2 defined

 

To prevent this error, you must first remove the ODM device definitions from the client LPAR before you remove cd0 from vhost2 :

# rmdev -Rdl vscsi2

 

Once the cd0 and vscsi2 device definitions are removed from the client LPAR’s ODM database, the vscsi path is no longer “live” or mapped and the cd0 backing device can now be moved to another vhost without causing the ED995F18 VSCSI_ERR3 errors to be logged on the client LPAR ID 3.

Comments Off

Creating and restoring a savevg backup without preserving mirrors

Comments Off

Question

How to create and/or restore an existing savevg backup without preserving mirrors.

Answer

This document describes how to restore a savevg image without preserving
mirrors.

WARNING: This procedure is valid only with a savevg image and
will not work with a Sysback 6000 system backup.

Creating a savevg without mirroring
Breaking mirrors on an existing savevg


Creating a savevg without mirroring

 

If the ability to rerun the savevg is available, the following procedure
will
allow you to create a savevg without preserving mirroring.

    1. To create a new
      /tmp/vgdata/<vgname>/<vgname>.data file,
      execute the following
      command.
            mkvgdata <vgname>

<vgname> is the name of the volume group to be backed
up.

  1. Change directories to /tmp/vgdata/<vgname> and, using
    your favorite editor, edit the <vgname>.data file.

    For example:

            cd /tmp/vgdata/<vgname>
            vi <vgname>.data

 

  • The following examples show an lv_data stanza of a
    <vgname>.data
    file. The first example is with mirroring, while the second example shows
    the
    edited version without mirroring. The lines that need changes are marked by
    –>.
    In the second example, the changes are made to those
    lines.

 

To view and edit the file, using your favorite editor, open
<vgname>.data:

   Example 1
                        lv_data:
                                VOLUME_GROUP= <vgname>
                                LV_SOURCE_DISK_LIST=  hdisk1
                                LV_IDENTIFIER= 00000001113f3c62.5
                                LOGICAL_VOLUME= lv00
                                VG_STAT= active/complete
                                TYPE= jfs
                                MAX_LPS= 512
                       -->      COPIES = 2
                                LPs = 70
                                STALE_PPs= 0
                                INTER_POLICY= minimum
                                INTRA_POLICY= center
                                MOUNT_POINT= /apps
                                MIRROR_WRITE_CONSISTENCY= on
                                LV_SEPARATE_PV= yes
                                PERMISSION= read/write
                                LV_STATE= opened/syncd
                                WRITE_VERIFY= off
                                PP_SIZE= 4
                                SCHED_POLICY= parallel
                       -->      PP = 140
                                BB_POLICY= relocatable
                                RELOCATABLE= yes
                                UPPER_BOUND= 32
                                LABEL= /apps
                                MAPFILE=
                                LV_MIN_LPS= 68
   Example 2
                        lv_data:
                                VOLUME_GROUP= <vgname>
                                LV_SOURCE_DISK_LIST=  hdisk1
                                LV_IDENTIFIER= 00000001113f3c62.5
                                LOGICAL_VOLUME= lv00
                                VG_STAT= active/complete
                                TYPE= jfs
                                MAX_LPS= 512
                       -->      COPIES = 1
                                LPs = 70
                                STALE_PPs= 0
                                INTER_POLICY= minimum
                                INTRA_POLICY= center
                                MOUNT_POINT= /apps
                                MIRROR_WRITE_CONSISTENCY= on
                                LV_SEPARATE_PV= yes
                                PERMISSION= read/write
                                LV_STATE= opened/syncd
                                WRITE_VERIFY= off
                                PP_SIZE= 4
                                SCHED_POLICY= parallel
                        -->     PP = 70
                                BB_POLICY= relocatable
                                RELOCATABLE= yes
                                UPPER_BOUND= 32
                                LABEL= /apps
                                MAPFILE=
                                LV_MIN_LPS= 68

NOTE: In Example 2, the COPIES value has been changed to 1,
and
the PP value is set equal to the LPs value. Make these changes
to each of the lv_data stanzas in the
<vgname>.data file. Once you make the changes, save the
file and exit.

 

  • Run another savevg from the command line that will utilize your
    edited
    <vgname>.data file.

 

                savevg -f /dev/rmtX <vgname>

X is the number of your tape device. You may also use a filename.

WARNING: Do not run the savevg in SMIT because this will
update
the <vgname>.data file and overwrite any changes made.

WARNING: Do not run the savevg with the -i flag
because this
will update the <vgname>.data file as well.


Breaking mirrors on an existing savevg

 

If another savevg cannot be run, the following procedure can be used to
restore
a savevg without mirroring.

All references to the tape device in the next section are as rmt0. You may also write the savevg backup to file.

  1. On the target system, place the savevg tape in the tape drive.

 

  • Remove the /tmp/vgdata directory:

 

                rm -r /tmp/vgdata

 

  • Restore the /tmp/vgdata directory from the savevg tape:

 

               cd /
               restore -xqvdf /dev/rmt0 ./tmp/vgdata

 

  • Edit the
    /tmp/vgdata/<vgname>/<vgname>.data file, and
    make
    changes to each of the lv_data stanzas as indicated in the examples
    that follow.
    The lines that need changes are marked by a –>.
    In Example 4, the changes are made to those lines.

 

To view and edit the file, using your favorite editor,
open
/tmp/vgdata/<vgname>/<vgname>.data:

     Example 3
                        lv_data:
                                VOLUME_GROUP= <vgname>
                                LV_SOURCE_DISK_LIST=  hdisk1
                                LV_IDENTIFIER= 00000001113f3c62.5
                                LOGICAL_VOLUME= lv01
                                VG_STAT= active/complete
                                TYPE= jfs
                                MAX_LPS= 512
                        -->     COPIES = 2
                                LPs = 120
                                STALE_PPs= 0
                                INTER_POLICY= minimum
                                INTRA_POLICY= center
                                MOUNT_POINT= /apps2
                                MIRROR_WRITE_CONSISTENCY= on
                                LV_SEPARATE_PV= yes
                                PERMISSION= read/write
                                LV_STATE= opened/syncd
                                WRITE_VERIFY= off
                                PP_SIZE= 4
                                SCHED_POLICY= parallel
                        -->     PP = 240
                                BB_POLICY= relocatable
                                RELOCATABLE= yes
                                UPPER_BOUND= 32
                                LABEL= /apps2
                                MAPFILE=
                                LV_MIN_LPS= 68
     Example 4
                        lv_data:
                                VOLUME_GROUP= <vgname>
                                LV_SOURCE_DISK_LIST=  hdisk0
                                LV_IDENTIFIER= 00000001113f3c62.5
                                LOGICAL_VOLUME= lv01
                                VG_STAT= active/complete
                                TYPE= jfs
                                MAX_LPS= 512
                        -->     COPIES = 1
                                LPs = 120
                                STALE_PPs= 0
                                INTER_POLICY= minimum
                                INTRA_POLICY= center
                                MOUNT_POINT= /apps2
                                MIRROR_WRITE_CONSISTENCY= on
                                LV_SEPARATE_PV= yes
                                PERMISSION= read/write
                                LV_STATE= opened/syncd
                                WRITE_VERIFY= off
                                PP_SIZE= 4
                                SCHED_POLICY= parallel
                        -->     PP = 120
                                BB_POLICY= relocatable
                                RELOCATABLE= yes
                                UPPER_BOUND= 32
                                LABEL= /apps2
                                MAPFILE=
                                LV_MIN_LPS= 120

NOTE: In Example 4 the COPIES value has been changed to 1, and
the PP value is set equal to the LPs value. Make these changes to each of
the lv_data stanzas in the <vgname>.data file.
Once you make
the changes, save the file and exit.

  • After making the changes to the <vgname>.data file,
    create a
    backbyname of /tmp/vgdata to run restvg against.
                cd /
  find ./tmp/vgdata -print |backup -iqvf /tmp/vg.back

This should back up the following files:

                ./tmp/vgdata
  ./tmp/vgdata/vgdata.files
  ./tmp/vgdata/<vgname> 
  ./tmp/vgdata/<vgname>/filesystems
  ./tmp/vgdata/<vgname>/<vgname>.data

<vgname> is the name of your volume group.

  • Verify that the files were backed up, and that the file can be read:
                restore -Tqvf /tmp/vg.back
  • Run the restvg command to recreate the volume group on the hdisks
    you want:
  restvg -f /tmp/vg.back hdisk# hdisk#
  • This should complete fairly quickly (depending on how many logical
    volumes and file systems are being created) and return to the command line.
    Verify that the volume group and file systems were re-created:
  lsvg -l <vgname>

And verify the file systems mounted:

  mount
  • If all looks good, restore the files from the tape:
  cd /
  restore -xqvdf /dev/rmt0
Comments Off