On "lvs -a -o +devices " you could add specific VG so it does it only to the specific VG.
If you nested your existing commands within a larger loop you could do that dynamically and insure your script only seeing the LVs specific the VG the loop is currently processing. e.g.
Code:
for vg in $(vgs --noheadings |awk '{print $1}')
do lvs -a -o +devices $vg ... rest of line
etc... (being sure to add the $vg to any lvs -a line you're doing)
done
I'm curious though. Are your EMC disks not already LUNs (RAID sets) defined within the EMC storage array itself? If so why do you need to mirror at host level? The main point of getting storage arrays is to let them handle the disk redundancy for you.
It sounds as if you're using mirroring in place of multipathing. The latter is designed to insure different paths to the same storage are combined. Since you're using mpath devices it appears you have multipathing turned on and if so each multipath device should be a combination of separate paths to the same disk from the storage array. Assuming that same disk is redundant within the array one mpath to each unique disk within the array should represent the various paths already so you shouldn't need to mirror 2 separate mpaths together.