Regarding AIX volume manager & replacing a disk

First a little background: I'm working with an AIX 6.1 TL05 running two mirrored SAS disks (rootvg) and four SSDs (appvg)

All four SSDs belong to appvg and are setup to mirror as follows:
hdisk4 --> hdisk6 (containing application fs)
hdisk5 --> hdisk7 (containing database fs)

A few days ago hdisk5 went kaput. In preparation for replacing that one SSD, I did the followling:

unmirrorvg appvg hdisk5
reducevg appvg hdisk5
rmdev -dl hdisk5
rmdev -dl pdisk1 (the pdisk being what hdisk5 was mapped to; I checked)

After the disk was replaced, the system found the new disk and allocated as pdisk1/hdisk5. I then did the following:

extendvg appvg hdisk5
mirrorvg appvg hdisk5

Once the mirroring was done, I was back to my original set up. The question is, was this by design or was I just lucky? Could I have ended up with:
hdisk4 --> hdisk6 --> hdisk5
hdisk7
...or is Volume Manager smart enough to notice that the lvs on hdisk7 only had one copy and should thus be mirrored to the new hdisk5?

Thanks!

-- Mike

mirrorvg will follow the settings for the LVs to be mirrored. So if they are set to "strict", at least every PP of the mirrored LP will be placed on a different PV in a VG. If you have more than 2 PVs in a VG they can be scattered on PVs you did not intend to use. Ie. it could happen that if disks on one side get broken, it could hit both mirror copies of the LP which is what should be avoided at all costs and what you are trying to do.

# lslv root_lv| grep EACH
EACH LP COPY ON A SEPARATE PV ?: yes

But to make sure there is no mixup of PPs belonging to different mirrored LVs from the same VG, you can check this placement with for example:

# lsvg -M rootvg

You see things like:

hdisk1:280      hd4:6:2

From the man page of lsvg , specifically -M :

PVname:PPnum [LVname: LPnum [:Copynum] [PPstate]]

(PPstate is not displayed here)
So if you see the same LV name with :1 and :2, which is the copy number on the same PV (hdisk1), then you have a problem - it would mean the allocation of LP copies is not strict for that LV. If you have LP copies of one LV on the same PV as that from another mirrored LV, then you have a problem too, as from your description you want to have both LV copies on separate disks, ie. each LV mirror has his dedicated mirror disk/PV.
To rearrange the placement you will have to use the command migratelp to move the LPs to the correct PV (note that the order of arguments/parameters of migratelp is different to the order you get from the output of lsvg -M !).
That's a lot of work so a script scanning for wrong placement and then migrating to free PPs is a bit of work, but helpful.

By this you can also check if the placement is/was as wanted, before you changed the disk.