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?
:)
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
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
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
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
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
i will need to add it using slot numbers right
RE: moving/adding CD device to an LPAR
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
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
RE: moving/adding CD device to an LPAR
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
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
HTH,
p5wizard
RE: moving/adding CD device to an LPAR
As what P5 said You can always take off them later.
Regards,
Khalid
RE: moving/adding CD device to an LPAR
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
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
You can attach T15 to the VIOS and define a virtual CD drive you'll share with all your LPARS:
See reebook at http
at page 95
RE: moving/adding CD device to an LPAR
Thx
Ed
RE: moving/adding CD device to an LPAR
This is the script we use in my compnay:
CODE
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
Hope you find this useful!
Regards,
Khalid
RE: moving/adding CD device to an LPAR
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
awk is not run on HMC itself.
HTH,
p5wizard
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}')
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
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
RE: moving/adding CD device to an LPAR
RE: moving/adding CD device to an LPAR
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
Sorry i gave you the wrong email address! Just remove the 's' out!
Regards,
Khalid
RE: moving/adding CD device to an LPAR