×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

moving/adding CD device to an LPAR

moving/adding CD device to an LPAR

moving/adding CD device to an LPAR

(OP)
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?

:)

RE: moving/adding CD 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    

RE: moving/adding CD device to an LPAR

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

RE: moving/adding CD device to an LPAR

(OP)
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?

RE: moving/adding CD device to an LPAR

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

RE: moving/adding CD device to an LPAR

(OP)
how do i fing out what slot number the cdrom is on?

i will need to add it using slot numbers right

RE: moving/adding CD device to an LPAR

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

RE: moving/adding CD device to an LPAR

(OP)
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?

RE: moving/adding CD device to an LPAR

Yes and then do cfgmgr

RE: moving/adding CD device to an LPAR

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

RE: moving/adding CD device to an LPAR

(OP)
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

RE: moving/adding CD device to an LPAR

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

RE: moving/adding CD device to an LPAR

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

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

Regards,
Khalid

RE: moving/adding CD device to an LPAR

(OP)
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

:)

RE: moving/adding CD device to an LPAR

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

RE: moving/adding CD device to an LPAR

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

RE: moving/adding CD device to an LPAR

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

RE: moving/adding CD device to an LPAR

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.

RE: moving/adding CD device to an LPAR

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

RE: moving/adding CD device to an LPAR

look at this line of script

ssh $HMCUSER@$HMC lshwres -r io --rsubtype slot -m \"$SYSTEM\" -F drc_name:drc_index | awk -F: '$1 == "'$SLOT'" {print $2}')


This runs on HMC as this ssh to HMC there check the slot, it uses the awk command after | sign,

I just want to know how Khalid use this, on HMC as when i run awk command it gives "bash: awk: command not found"

Thanks and Regards to all

RE: moving/adding CD device to an LPAR

First of all, this script was provided by the IBM consultant who came to configure our P5 570s machines (abubasim) just to give him credit on that.

It seems that the awk command runs on the LPAR not on the HMC! I just tested it again with different command:

DRC=$(ssh hscroot@p5hmc ls -al | awk '{ printf $9 }')

Then i echoed $DRC and i got the list of the files!

Regards,
Khalid

RE: moving/adding CD device to an LPAR

Dear Khali may be u r saying 100% correct. i will check it and  can u give me your email if u don't mind

RE: moving/adding CD device to an LPAR

Dear Khalid may be u r saying 100% correct. i will check it and  can u give me your email if u don't mind

RE: moving/adding CD device to an LPAR

I'm not sure if it is allowed to give away email addresses but you can email me on this:

khalidtektips@alayam.com

Regards,
Khalid

RE: moving/adding CD device to an LPAR


ssh $HMCUSER@$HMC lshwres -r io --rsubtype slot -m \"$SYSTEM\" -F drc_name:drc_index | awk -F: '$1 == "'$SLOT'" {print $2}')



ssh user@hmc lshwres ...# this part runs from a machine via an ssh session on the hmc
| awk 'awkprogram'      # this part runs on the machine that you ssh from


there is no awk necessary on the HMC
 

HTH,

p5wizard

RE: moving/adding CD device to an LPAR

aixos,

Sorry i gave you the wrong email address! Just remove the 's' out!

Regards,
Khalid

RE: moving/adding CD device to an LPAR

Thanks to all of you, its my pleasure that all of u help a lot

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close