1833788 Members
2800 Online
110063 Solutions
New Discussion

PVG questions

 
SOLVED
Go to solution
Michal Golata
Occasional Advisor

PVG questions

Hi,

I was trying to find some interesting info about PVGs on the web but in general the only valuable information I found is that PVG are useful when one wants to separate PVs during mirroring to make sure the mirror copy is being written to the mirroring and not mirrored disk. Now, I have a machine with a VG created on a disk array with 2 PVs where one of them is Altenate Link:

--- Physical volumes ---
PV Name /dev/dsk/c4t0d3
PV Name /dev/dsk/c10t0d3Alternate Link
PV Status available
Total PE 26747
Free PE 4458
Autoswitch On

For this VG there is also a PVG created:

--- Physical volume groups ---
PVG Name prim
PV Name /dev/dsk/c4t0d3
PV Name /dev/dsk/c10t0d3

My first question is: does it make any sense to create such PVG consisting of both primary and alternate devices? If my initial statement about the primary purpose of PVG was correct, I see no sense to create such PVG if we don't have mirroring between those 2 devices but they are just alternate links to the same device, as I understand. Can you correct me if I'm wrong?

The second question is: what's the simplest way to remove the PVG? Is it just like editing /etc/lvmpvg or anything else needs to be done? I know I can add a PVG or a device to the PVG using vgcreate or vgextend, but how to delete existing PVG?

Regards,

Michal
5 REPLIES 5
Gary L. Paveza, Jr.
Trusted Contributor

Re: PVG questions

First question: absolutely. However, an alternate link is not a separate device. It's the same device accessed via a second path. There is no mirroring or other replication involved.

Second: you can just edit /etc/lvmpvg.

As for why you would do this. It's an easy way to isolate a particular logical volume to a given set of disks within a volume group. I do this quite frequently. Let's say I have 4 disks and 4 logical volumes that need to be created. I typically create two PVGs within a volume group - each of 2 disks in size. I then use distrubuted allocation to create 2 logical volumes on each PVG.
Michal Golata
Occasional Advisor

Re: PVG questions

According to your answer for my first question: absolutely yes or absolutely no? :-)

I mean: does it make sense to have a PVG consisting of 2 devices where one of them is in fact the same disk but with separate path? If no mirroring (because of the disk array), do we need a PVG? What for?

Thanks,

Michal
Sundar_7
Honored Contributor
Solution

Re: PVG questions

Michal.

First Question: Makes absolutely no sense whatsoever. There is no reason to create PVG with only one disk (the other device is actually a PV link).

Second Question: Editing /etc/lvmpvg is the easiest way to deal with PVGs.

If you would like, I can give you couple of examples of when PVG can be useful

* You want the primary and the mirror to be separated at the controller level. If the primary is seen through HBA0 and the primary is through HBA1, then you can create two PVGs, one PVG listing the PVs seen through HBA0 and the other PVG listing the PVs seen through HBA1.

Now, when you create LVs, if you set the allocation policy to PVG-strict, then the LVM will make sure it will pick the primary and the mirror disks from different PVGs.

* PVG can also be used with extend-based striping or distributed allocation. With this,LVM will allocate extends from disks in one PVG before using the PVs in the next PVG and so on.

Sundar.
Learn What to do ,How to do and more importantly When to do ?
Michal Golata
Occasional Advisor

Re: PVG questions

Sundar,

Thanks a lot for the reply. This clarifies the issue for me.

Regards,

Michal
MHudec
Frequent Advisor

Re: PVG questions

As for first question:
PVG is fine, when you have set of luns from disk array, and you want to do some extent distribution (for performance), like:

LE PV PE
0000 /dev/dsk/c13t2d1 0000
0001 /dev/dsk/c13t2d2 0000
0002 /dev/dsk/c13t2d3 0000
0003 /dev/dsk/c13t2d4 0000
0004 /dev/dsk/c13t2d1 0001
0005 /dev/dsk/c13t2d2 0001
0006 /dev/dsk/c13t2d3 0001
0007 /dev/dsk/c13t2d4 0001

See? Here is example of pvg-strict/distributed allocation, where logical extents (LE) are continuously being distributed in physical volumes (PV) with their respective physical extents (PE).

Also it is fine, when you have one disk array in one datacenter and second disk array in second datacenter and you want to group disks from one array to PVG1 and from other to PVG2 and mirror PVG1 to PVG2.

As for alternate paths, all was said. It is the same disk, but visible through alternate hba (fc adapter). So if one link (first hba) goes down, LVM will switch to other link and we will be still working.

As for second question, why would you need to remove pvg? Anyway yes, editing /etc/lvmpvg is the simplest way. But I would think about that, if you have some distributed allocations, as with removed pvgs, you would create chaos in extent distribution, which can (and will) impact performance.