dummydisk

In AIX, you can create devices by simply running the ‘cfgmgr’ command which walks the bus or virtual bus and starts defining a new structure of adapters and disks, or tapes or whatever. And sometimes it is really advantageous to have the numbering of the devices skip a little bit, to sync with another system that sees the same disks. ‘dummydisk’ is a small self-referencing command that creates bogus ODM entries that look however you want them. Then you simply run ‘cfgmgr’ and devices that you want to skip will appear taken. So far I don’t have a version or an installp package and they can only be removed with the dummydev command, but that is what version 0.1 is all about:


#!/bin/ksh

###############################################################
# Title         :  dummydisk - Creates a placeholder disk
# Author        :  John Rigler
# Date          :  7/31/2008
# Requires      :  ksh
# Web           :  http://deadlycoffee.com/?p=12
###############################################################
# This script creates phantom disks that don't actually do
# anything but makes it easier to line up disk names on
# different servers.  Just create dummy disk up to the actual
# disk that you need, then when you run cfgmgr, your new disk
# or disks will be created with the correct id.  It is possible
# to create your disks with mkdev, but who the heck does that?
# You can't yet delete these disks with rmdev because the config
# method is wrong. Once I get some time, I will add entries to
# the Pd tables to make rmdev -dl work.
################################################################



case $1 in

        -a )  grep "^##S" $0 | cut -c 4- | sed "s/REPLACENAME/$2/g" | odmadd ;;
        -d )  odmdelete -o CuDv -q "name = $2" ;
              odmdelete -o CuAt -q "name = $2" ;;
         * )  echo;
              echo "To add a dummy device:              $0 -a devicename";
              echo "To delete a dummy devices:  $0 -d devicename"  ;
              echo ;;

esac

##SCuDv:
##S        name = "REPLACENAME"
##S        status = 1
##S        chgstatus = 2
##S        ddins = "dummydev"
##S        location = "FF-FF-FF-FF,F"
##S        parent = "scsi2"
##S        connwhere = "FF,F"
##S        PdDvLn = "disk/scsi/scsd"
##S
##SCuAt:
##S        name = "REPLACENAME"
##S        attribute = "unique_id"
##S        value = "deadlyc0ffee000000000000"
##S        type = "R"
##S        generic = ""
##S        rep = "n"
##S        nls_index = 0
##S
##SCuAt:
##S        name = "REPLACENAME"
##S        attribute = "pvid"
##S        value = "000dummydisk0000            "
##S        type = "R"
##S        generic = "D"
##S        rep = "s"
##S        nls_index = 11
##S
##SCuDvDr:
##S        resource = "devno"
##S        value1 = "99"
##S        value2 = "0"
##S        value3 = "REPLACENAME"

Leave a Reply

Your email address will not be published. Required fields are marked *