1833003 Members
2190 Online
110048 Solutions
New Discussion

PVG use in VGs

 
SOLVED
Go to solution
Stephen Keane
Honored Contributor

PVG use in VGs

Here's a scenario:

Imagine you have a VG called VG01
within the VG are 2 PVGs called PVG1 and PVG2
within PVG1 are 2 PVs called PV1 and PV2
within PVG2 is 1 PV called PV3
imagine PV1 and PV2 are two paths to the same device!

So we should do (ignoring a few flags)

vgcreate -g PVG1 VG01 PV1 PV2
vgextend -g PVG2 VG01 PV3

1. Yes?

I would expect the output of vgdisplay (-v) to show (ignoring leading path names)

--- Physical volumes ---
PV Name PV1
PV Name PV2 Alternate Link
...
PV Name PV3
...
--- Physical volume groups ---
PVG Name PVG1
PV Name PV1
PV Name PV2

PVG Name PVG2
PV Name PV3

2. Yes?

3. Assuming the above is correct, would I get the same results by doing the following

vgcreate -g PVG1 VG01 PV1
vgextend -g PVG1 VG01 PV2
vgextend -g PVG2 VG01 PV3

4. Would the o/s be smart enough to realise that PV1 and PV2 are 2 links to the same device, or do I have to explicitly tell it using the first set of commands?

5. Does anyone ever create a VG with a mix of PVGs and PV (not in a PV) or is it always either PVGs or PVs but not both?

A lot of questions (hence I numbered them) ...


6 REPLIES 6
TwoProc
Honored Contributor
Solution

Re: PVG use in VGs

1. Yes Stephen - that's how it's done. Since there are no pvg_create commands (like you'd think) - pvg's come into existence on vgcreate and vgextend.
2. Yes.
3. Yes, except which path is the primary and which is the alternate would be switched.
4. Yes, O/S will know.
5. I always do one or the other. Can't think of when I'd do just one.

Note: This is a valid way to get your stuff in. But, keep in mind that you want to optimize throughput by balancing the cards.
(If you've got all this below done already then please ignore).

So, if you had two i/o cards...

pv1 in PVG1 would be from i/o card one
pv2 in PVG1 would be from i/o card two
pv3 in PVG2 would be from i/o card two
pv4 in PVG2 would be frmo i/o card one

This way the system doesn't just bang on card 1 and never use card 2; instead use your alternate paths for a bit of optimization.
We are the people our parents warned us about --Jimmy Buffett
Stephen Keane
Honored Contributor

Re: PVG use in VGs

OK, thanks for that. I'm slightly concerned about (3) though. Why would the primary and alternate be swapped? I'd assumed that the first one added to the VG would be the primary and any subsequent paths pointing to the same disk would be alternate links?

Would then,

vgcreate -g PVG1 VG01 PV2
vgextend -g PVG1 VG01 PV1

Have the same effect as

vgcreate -g PVG1 VG01 PV1
vgextend -g PVG1 VG01 PV2


TwoProc
Honored Contributor

Re: PVG use in VGs

Stephen, I apologize - from looking at my response and your question - I misread your question. I was thinking you had two pvgs - each one to mirror the other (which is how I use PVG's). Man, I goofed. You are correct about what is the primary path (first one added, or when reducing - last one left).

Besides being correct in how to create it (you are - just skip my whole discussion about alternate paths). Can I ask what are you trying to accomplish with this? Are you going for a striping scenario? Are you really just putting in different PV's into the same VG so that you can cut them out later in different ways?

I've used the idea of PV's for three things
a) soft-mirroring with HPUX mirroring software (mirror one PVG onto another).
b) put a bunch of Luns into a group with PVG's to force distributed stripes across Luns (used to get a large spread across devices with large storage arrays).
c) both a and b.

What is it you're going for?

I can come up with a few things that you're trying for two different things at once.
a) one lvol or set of lvols which are hardware mirrored and you need alternate paths.
b) another lvol or set of lvols which don't have alternate path cards, and you're just going to make mount points from.

c) Or mayybee - you're going to mirror PVG1 to PVG2! I think that's probably what you're up to. If it is - it could work - if you have enough physical extents of the same size across both types in common (one type could be larger than the other - you'd just not be able to mirror them).

Anyways, if you're doing c) - then yes, you can do this. All caveats in place - right? You're not supposed to mirror to different types of disks, etc. However, if you're doing c) across different disk types, make sure that you add the disks(luns) of the larger variety first to the volume group. You'll probably have more luck that way.

Leave feedback for more info as I'm interested into hearing what it is you're trying to do ( I might learn a new idea here).
We are the people our parents warned us about --Jimmy Buffett
Stephen Keane
Honored Contributor

Re: PVG use in VGs

I'm trying to write some software that can be used generically. I am hampered by the fact that I have limited hardware to test it on. I will have the opportunity to test it at a later date, but I need to have substantially written it by then. The easiest way of describing what it is going to do would be to say it is going to clone machine A to machine B. Yes, before anyone says it, I can use Ignite!, but there are good reasons, which I'm not going in to that prevent me from so doing. I have to be able to copy the VG/PVG/PV layout from one machine to another. I could just copy the /etc/lvmpvg file across, but if you aren't using PVGs, then there isn't a file and in any case, I don't trust text files that can be edited by people. As with most commercial operations, there is a limit to what I can post without breaching NDAs etc.
TwoProc
Honored Contributor

Re: PVG use in VGs

OK, well then, yes you can certainly create PVG's of most any mixture in a vg. Just be careful when adding a disk with more PEs than that the first disk that was created with the VG in the first place. This can (but doesn't seem to always) trip you up.
We are the people our parents warned us about --Jimmy Buffett
Stephen Keane
Honored Contributor

Re: PVG use in VGs

Another stupid question, can you have more than one alternate link. i.e would you ever see something like

--- Physical volumes ---
PV Name PV1
PV Name PV2 Alternate Link
PV Name PV3 Alternate Link
PV Name PV4 Alternate Link
PV Status available
Total PE ...