Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

moving/adding CD device to an LPAR

Status
Not open for further replies.

saucyboy

Technical User
Feb 23, 2006
78
US
Hi Guys

I have a P570 with 5 Lpars - the cd device i don't think has been added to any of them.
Phyiscally i can see the device.
How do I add the device to an LPAR?

:)
 
Hi

You DLPAR operation from HMC to add.

Before you add you have to make syre, that cd adapter is not assigned to any of your systems.

I use script:rmdhw
dev=$1

if [ "`odmget -q name=$dev CuDv |grep parent`" != "" ]
then
PARENT=`odmget -q name=$dev CuDv |grep parent \
|sed 's/"//g' |awk '{ print $3 }'`
PCIBUS=`lsslot -c slot | grep $PARENT | awk '{ print $5 }'`
rmdev -dl $PCIBUS -R > /dev/nul 2>&1
exitrc=$?
else
exitrc=8
fi
case $exitrc in
0) # Alt OK
echo "Device $dev removed OK"
echo "Device $dev redy for remove from HMC"
;;

1) # Device not allocated dynamic
echo "Device $dev can not been removed dynamic"
;;
8) # device not known
echo "Device $dev not known"
;;
*) # unknown error
echo "unknown error "

esac
exit $exitrc
 
ubihga is right! You have to go to the HMC, right-click on the LPAR you want to add the cd to then, from the drop down list, go to Dynamic logical Partitioning --> physical adapter resources --> add

then choose the cd from the IO list and click OK.

Then you have to login to the LPAR and issue cfgmgr!

As ubihga said, you have to make sure that the CD is not used on any of the LPARs.

You can simply go to the managed system, right-click, go to properties. Then to the IO tab and view all the IOs and to which each IO is assigned!

Or you can go inside each LPAR and issue the command:

lsdev -C | grep cd

(You can use the above command to make sure you had successfully added the adapter after issuing cfgmgr)

Regards,
Khalid
 
Hi

i just saw its on one of the LPARS
# lsdev -C |grep cd
cd0 Defined 0C-08-00 IDE DVD-ROM Drive

its in defined state - do i still need to remove it from this lpar from HMC or rmdev it?
 
No that's fine!

It should look like this:

# lsdev -C |grep cd
cd0 Available 0C-08-00 IDE DVD-ROM Drive

If it is Available in one of the LPARs then you have to remove it using rmdev! But not for now. You can go ahead with your DLPAR!

I will post you a script that we use for moving IO from an LPAR to another. Just go ahead with this and let me know the result!

waiting for your "Done" word :)

Regards,
Khalid
 
how do i fing out what slot number the cdrom is on?

i will need to add it using slot numbers right
 
That's the tricky part!

In my machine, i have the SCSI DVD drive named "Storage Controller" and the IDE DVDRAM as "Other Mass Storage Controller"

So i'm not sure which one is yours! Put if it helps you can write down the IOs that you have in here and i will tell you which one i suspect!

You can easily get the full list of IOs by right-clicking on the managed system from the HMC and then go to properties from the drop down list. Then you will see a tab named IO. There you will find all your IO slots!

Regards,
Khalid
 
I have it as T15 Other mas Storage Contoller

so do i now go to the LPAr i want to move it to and add it in?

 
Make sure you choose the T15 slot from the correct p5 quad (if you have more than one quad in your 570)

A p5-570 can have up to 4 quads (processor drawer) coupled together for a full 16-way machine.


HTH,

p5wizard
 
there are 2 T15 slots
both have same serial numbers

but on differnt buses -

1st is on bus 3
2nd is on bus 7

how do i know which one is correct
 
The top quad will probably have the lower numbered bus. But don't worry, you can go with trial-and-error also: if you DLPAR-add T15 slot and after cfgmgr on that DLPAR there's no CD or DVD device, it just means you should have picked the other one. So then DLPAR-remove the one T15 slot and DLPAR-add the other... No harm done with that.



HTH,

p5wizard
 
Even if you assign both! and try which is which :)

As what P5 said You can always take off them later.

Regards,
Khalid
 
hi

its was the top quad, i checked serial numbers , on the properties of the server i clicked I/O tab

each unit has a serial number, i had to move the description bar to the righ a bit and then naming convention fell into place ...doh :), easily done eh!

many thanx to all for your help

that was a great excercise

:)
 
By the way do you know how to remove the cd?

You have to follow the path to the parent and then issue a rmdev -R -l pci*

Regards,
Khalid
 
Hi Khalid, could you post your script that you have mentioned...? I would like to know how to move the adapter from one LPAR to another using HMC Command Line...

Thx
Ed
 
Hi Ed,

This is the script we use in my compnay:

Code:
#!/usr/bin/ksh

PROGNAME=${0##*/}

HMCUSER="hscroot"       # User on HMC with super admin privilege
HMC="p5hmc"             # TCP/IP host name of HMC

DEV="$1"                # Device to move
DHOST="$2"              # Destination host

function Die
{
  print -u2 "$PROGNAME: $*"
  exit 1
}

function GetManagedSystem
{
  typeset LPAR="$*" TESTLPAR= TSYSTEM=
  integer i
  ssh $HMCUSER@$HMC lssyscfg -r sys -F name |
  while read TSYSTEM
  do
    SYSTEM[${#SYSTEM[*]}]="$TSYSTEM"
  done
  (( i = 0 ))
  while (( i < ${#SYSTEM[*]} )); do
    ssh $HMCUSER@$HMC lssyscfg -r lpar -m \"${SYSTEM[i]}\" -F "lpar_id name" |
    while read TESTLPAR
    do
      if [[ $TESTLPAR = $LPAR ]]
      then
        echo "${SYSTEM[i]}"
        return
      fi
    done
    (( i += 1 ))
  done
  echo ""
}

LPAR=$(uname -L)        # ID and name of this partition
LPAR_ID=${LPAR% *}      # Extract LPAR ID

# Test ssh connectivity to HMC
[[ $(ssh $HMCUSER@$HMC whoami 2>/dev/null) = $HMCUSER ]] || Die "ssh to HMC $HMC not functional"

# Test ssh connectivity to destination host
[[ $(ssh $DHOST id -un 2>/dev/null) = $(id -un) ]] || Die "ssh to $DHOST not functional"

# Get name of managed system to which this LPAR belongs
SYSTEM="$(GetManagedSystem "$LPAR")"
[[ $SYSTEM != "" ]] || Die "not able to determine managed system"

# Get LPAR ID and name of destination host
DLPAR=$(ssh $DHOST uname -L)
[[ $DLPAR != "" ]] || Die "$DHOST not an LPAR"

# Extract LPAR ID of destination
DLPAR_ID=${DLPAR%\ *}

# Verify that destination DLPAR is on the same managed system
[[ $(GetManagedSystem "$DLPAR") = "$SYSTEM" ]] || Die "$DHOST not in the same managed system"

# Find the PCI bus device to which this device connects.
while [[ $DEV != pci* ]]; do
  SLOT=$(lscfg -l $DEV | awk '{print $2}')
  DEV=$(lsdev -C -F parent -l $DEV)
done
set -x

# Get the drc_index for the slot we want to move
DRC_INDEX=$(ssh $HMCUSER@$HMC lshwres -r io --rsubtype slot -m \"$SYSTEM\" -F dr
c_name:drc_index | awk -F: '$1 == "'$SLOT'" {print $2}')

if /usr/sbin/rmdev -R -l $DEV
then
  if ssh $HMCUSER@$HMC chhwres -r io -m \"$SYSTEM\" -o m --id $LPAR_ID --tid $DL
PAR_ID -l $DRC_INDEX
  then
    ssh $DHOST /usr/sbin/cfgmgr -s
  fi
fi

You only need to make sure you have access to your HMC using ssh!

You call this script by passing the destination LPAR name and the device to be moved:

Code:
movedevice.sh rmt0 dest_lpar_name

Hope you find this useful!

Regards,
Khalid
 
Dear Khalid
I have seen your post u have posted on 11 April regarding moving the resources between DLPAR. I want to do the same by script, but i have a problem, please tell me how "awk" is used by user of HMC, as you have used awk in your script.
Thanks.
 
As far as I can see, Khalid's script runs on an AIX LPAR and when necessary it ssh-s into the HMC to run specific HMC commands...

awk is not run on HMC itself.


HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top