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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VIO mkvdev and LPAR hdisks names

Status
Not open for further replies.

MoreFeo

Technical User
Nov 29, 2002
547
ES
Hi,

We have some existing p5 servers, with VIO Servers, and all the LPARs volumes virtualized. Each LPAR has just one virtual scsi, so all VIO mappings are done to one vhost only for each LPAR.

We need to map a lot of new volumes to each LPAR, using the existing vhosts.

If I map to a LPAR all the new volumes, and then issue cfgmgr in the client LPAR, what will be the order in which the new hdisks will be configured and named?
Is there a way to ensure the new hdisks will follow the sequence I want?

Thanks.
 
Hello,

Are you using logical volumes in vg to assign to new lpar or assiging disk to vio then assigning that disk to lpar ?

If you are using hdisk on VIO then assiging to lpar you can assign what ever diskx you want to assign to client.
In client lpar itself it takes it's own sequence, say for instance you have already one disk hdisk0, next would be hdisk1 , unless you want to have different.
 
We are using SAN luns, assigned as whole disks to client lpars.

When assigning the luns to the VIO Server, it configures them in the lun id order.

Let's say VIO already has a lot of hdisks (hdisk0 --> hdisk200). The new SAN luns will configured as hdisk201, hdisk202, hdisk203, etc... based on lun id number (hdisk201 is the lowest new lun id, then the second, etc...)

These luns must now be mapped to the client lpars.
So I have to map the hdisks to the corresponding vhosts.

LPAR1:
Code:
mkvdev -vdev hdisk201 -vadapter vhost0 -dev name1
mkvdev -vdev hdisk202 -vadapter vhost0 -dev name2
...
mkvdev -vdev hdisk210 -vadapter vhost0 -dev name10

Now if I run cfgmgr in LPAR1 it will detect and configure these new hdisks, but I don't now in which order.

What I usually do is to run cfgmgr in the client lpar just after each mkvdev, so the hdisks are named in the order I want (hdisk8, hdisk9, hdisk10, ...).

But this time there are a lot of luns, so it would be better if I could run all the mkvdevs inside a script, and then run cfgmgr in client lpars, but I need to have a way to control the order of the new hdisks.

Thanks
 
you need to track based on your hdiskx (x is hdisk number on VIO & mapping i.e output of lsmap -all or " lsmap -vadapter vhost0" say for vhost0 you have 5 disks. , from that you know disk's number & LPAR to which it associated.
 
I think I'm not clear.

In the VIO Server I know the hdisk number and the vhost I will map it to.

If I map all the new hdisks to the client lpar, and then run cfgmgr in the lpar, it will detect them and configure them, but I don't know if these new disks will follow the same order or not.

Lets put an example:

I've got in a LPAR this disks:
Code:
# lspv
hdisk0          00c5d442507e461e                    rootvg          active
hdisk1          00c5d4424f2785ec                    data1vg         active
hdisk2          00c5d442275cf909                    data2vg         active

Now in the VIO I map some new hdisks to this LPAR, using the same vhost:
Code:
$ mkvdev -vdev hdisk200 -vadapter vhost0 -dev v2name
v2name Available
$ mkvdev -vdev hdisk201 -vadapter vhost0 -dev v2othername
v2othername Available
$ mkvdev -vdev hdisk202 -vadapter vhost0 -dev v2anothername
v2anothername Available

So now if I run cfgmgr in the client lpar it will detect 3 new disks hdisk3, hdisk4 and hdisk5.

But how can I know that hdisk3 is hdisk200 in the VIO, hdisk4 is hdisk201 and hdisk5 is hdisk202?

Is there a way to force this?

Thanks
 
In that case by pvid's number, that's NOT only source though, Is that your LUN's are through SVC ? than there another manged disk number.
 
Well, with PVID I can identify the hdisk after it has been mapped and configured, but is not exactly what I was looking for.

What I was looking for is a way to force/ensure that the lpar configures the hdisks in the order I want.

In the SAN to VIO mapping I can ensure the VIO will configure the luns in the order I want with the lun id.
If I give my luns the following ids 100, 101, 102, 103, 104 then the VIO will first configure and name lun 100, then lun 101, then 102, etc...

I am looking for a way to do the same thing in the VIO to LPAR mapping.
 
My understanding , without any place to test is cfgmgr will name them in the order of the bus, 1st device on vscsi0 will be hdisk9, next hdisk10. Or are you trying to force hdisks to match the vio numbers, ie vio-a hdisk200 lpar hdisk200, this is not easy, and usually not worth it.

Tony ... aka chgwhat

When in doubt,,, Power out...
 
No, I don't want them to match the VIO numbers. What I don't know is what is the order of the bus.

If they were mapped to different vhosts I know they would be named in the order of the virtual scsi client adapters (first vscsi0, second vscsi1, etc...).

But in this case, with only one vhost I don't know which order they will take. Is it in the order I did the mappings? Or maybe a sort of alphabetical order, based on vtd names? Don't have right now a server to test with, but as far as I remember it's neither of these options (but I may be wrong).

Thanks
 
You can try to just run cfgmgr and discover the disks (which will probably be in disorder), then saving the connwhere info (which will be the virtual SCSI-ID I believe) of all the disks ([tt]lsattr -El hdiskXX[/tt]), then removing the new disks and [tt]mkdev[/tt]-ing the disks one by one using the connwhere info you saved. Then after you have thus named the disks in the order of your choice, just run cfgmgr to discover the second paths.

I'm not at a POWER-5/6/7 box right now so I can't verify, but it *might* work.

But it seems to me a lot of work for cosmetics only. And I'm not *sure* this will work either, just thinking out loud.

HTH,

p5wizard
 
If I'm not able to determine the order, I'm thinking about a script that runs in the VIO, from the AIX shell.

What I am thinking is to configure ssh whit rsa keys in VIO and in the LPARs, and then in the VIO run a script that connects to the LPARs after each mapping to run cfgmgr.

Something like:
Code:
ioscli mkvdev -vdev hdisk201 -vadapter vhost0 -dev v2name
ssh -n root@LPAR1 cfgmgr
ioscli mkvdev -vdev hdisk202 -vadapter vhost0 -dev v2othername
ssh -n root@LPAR1 cfgmgr
ioscli mkvdev -vdev hdisk203 -vadapter vhost0 -dev v2anothername
ssh -n root@LPAR1 cfgmgr
...
ioscli mkvdev -vdev hdisk230 -vadapter vhost1 -dev v3name
ssh -n root@LPAR2 cfgmgr
...

This way after each mapping I run a cfgmgr in the client lpar, so it gives the hdisk number in the order I want.

Has anybody done something similar? Do you think it's a good idea, or not?

Thanks
 
I've seen in some documentation that the VIO Server assigns a LUN ID when mapping the hdisk:

Code:
VTD                   lpar1_map1
Status                Available
[b]LUN                   0x9100000000000000[/b]
Backing device        hdisk101
Physloc               U787B.001.DNW6B76-P1-C5-T2-W202500A0B8470E24-L17000000000000

And in the client lpar this lun id appears when doing lscfg, something like:
Code:
hdisk0 U9117.MMA.6534BE4-V3-C2-T1-[b]L910000000000[/b]

So what seems logic is that the lpar should detect and configure the disks in this lun order.
But as far as I remember last time I mapped a lot of disks it didn't assign them in the order I did the mappings, so I don't know if the VIO doesn't assign this lun ids in sequence, or perhaps it's the AIX lpar that doesn't detect them in sequence.

Anyway, I will do several tries to see if I can figure out what happens, and will post here the results (if any).
If I can't I will try running the script to run cfgmgr after each mapping.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top