Operating System - HP-UX
1833770 Members
2463 Online
110063 Solutions
New Discussion

VGSPLIT - Split LVOLS to Different VG

 
Alzhy
Honored Contributor

VGSPLIT - Split LVOLS to Different VG

Is there such? split the mirror LVOLS and move the PV out and rebuild onto a different VG?


With VxVM, we can split a Volume's mirror-plex (up to 32 allowed). Then move the disks/luns comprising those mirror plex to another Diskgroup (which could be on another server) and rebuild the DiskGroup, the volumes and mount.

Is there a similar thing in LVM? Or do I need to have Cluster LVM for this purpose?

Hakuna Matata.
15 REPLIES 15
Patrick Wallek
Honored Contributor

Re: VGSPLIT - Split LVOLS to Different VG

When a mirror is split, it still resides within the same VG. The name of the split off LV, but default, is /dev/vg??/lvol?b (the letter 'b' is just appended to the lvol name).

Based on this, I don't think it would be possible to move a particular PV with a split mirror to a different VG. I think that would go against HP's intended use of splitting mirrors.

I think the main intention is to split a mirror, mount a backup the split copy, and then merge the mirrors back. The merge task would be quite difficult, if not impossible, if the split mirror were in a different VG.

Patrick

P.S. Do you have your new Harley yet? :)
Sundar_7
Honored Contributor

Re: VGSPLIT - Split LVOLS to Different VG

As far as I can tell, nope you dont need CLVM for this. But yes ofcourse you need MirrorDisk/UX to mirror the logical volumes

This is how you can do it

1) Mirror the Logical volumes. Here is the trick. The allocation policy for ther logical volumes should be PV strict or PVG-strict. Otherwise, you dont have control over which PV the logical volume will be mirrored to.

It would be a good idea to define all the primary PVs in one PVG, the mirror PVs (that are going to be taken out) as another PVG and mention the allocation policy for the LV as PVG-Strict.

2) Split the LVs. This will create the logical volume device files in the system. By default "b" is appended to the logical volume device file.

3) Deactivate the volume group.

4) Export the volume group and re-import with only the primary PVs.

5) If you are going to mount in the same node, then you need to execute vgchgid commands on the mirror PVs. This is because these mirror PVs will have the same VGID as the primary PVs and the kernel will not allow more then one VG with the Same VGID
be activated.

If you are going to mount the mirror PVs in a different node, then this step is not required.

6) Once vgchgid is successful, Create a new volume group directory, group file and vgimport with the mirror PVs.

7) fsck the file system and mount them.


Hope this helps

-- Sundar.

Learn What to do ,How to do and more importantly When to do ?
Sundar_7
Honored Contributor

Re: VGSPLIT - Split LVOLS to Different VG

hmm... You might have to override the quorum while activting the original volume group again.

Learn What to do ,How to do and more importantly When to do ?
Patrick Wallek
Honored Contributor

Re: VGSPLIT - Split LVOLS to Different VG

Good suggestion Sundar. I didn't think of that. The only issue I can see is that it would require downtime since you would have to export and reimport the VG.

Sundar_7
Honored Contributor

Re: VGSPLIT - Split LVOLS to Different VG

That is true Patrick. It requires downtime. But if you execute vgreduce on the primary VG, the LVM headers will be stripped off the disks that are removed and thus you cannot use the mirror PVs anymore.

I cannot think of any other way of doing this.
Learn What to do ,How to do and more importantly When to do ?
Alzhy
Honored Contributor

Re: VGSPLIT - Split LVOLS to Different VG

Thanks both Patrick and Sundar.

The split LUNs containing the mirror LVOLS will need to be on a different VG on a different server (we use LUN multi-hosting/pathing btw..)

And there can never be downtime on the Main/Primary Volume Group...

Hakuna Matata.
Patrick Wallek
Honored Contributor

Re: VGSPLIT - Split LVOLS to Different VG

If there can't be any downtime, I don't see a way to do it via mirror splits.

Since you mention LUNs I assume you are on a disk array of some sort? If so, what kind? Does it have the capability to do BCV's (Business Copy Volumes) or something similar? If you can do BCV's then you could create a business copy on another LUN and then mount that on a different server. Since BCV's are created at the disk array level, LVM never enters the picture, hence you can take a BCV lun and mount it on another system.
Alzhy
Honored Contributor

Re: VGSPLIT - Split LVOLS to Different VG

Patrick..

Well we actually use Business Copy on the EVA's but it's been plagued with problems and cannot mirror to a different EVA. Besides, the "levelling" processes during the snapclone and the undo process can be quite taxing on the EVA.

That is why we're looking at host based (software) solutions like VxVM. VxVM's mirroring which is multi-treaded btw, (plus FlashSnap) only has a minor effect if done right. Since we only need weekly refreshes of our large Oracle instances, it does not matter if the synch-up/mirroring happen over a span of several days -- as long as on saturday we get "several" copies of our production environments. VxVM allows up to 32 mirrors. And we're already doing this on our Solaris environments albeit using a moer powerful array than the EVA...

BTW, I have'nt got the Harley yet... am still in the process of gettin my License.

Can send pictures once I get it...
Hakuna Matata.
Sundar_7
Honored Contributor

Re: VGSPLIT - Split LVOLS to Different VG

I dont believe it is possible without any downtime.

We can try a crude method here. But not sure if this is going to work.

1) Split the mirrors

2) Have a copy of the LVM configuration file./etc/lvmconf/vgXX.conf

3) vgreduce the PVs

4) vgcfgrestore using the "saved" lvmconf file to the PVs that contain the mirror copy

5) Import them in the another node as a VG

6) fsck and mount the lvs.

As I said, not sure if this is going to work. :-)

-- Sundar
Learn What to do ,How to do and more importantly When to do ?
Alzhy
Honored Contributor

Re: VGSPLIT - Split LVOLS to Different VG

Again .. this shows the major difference between VxVM and LVM...

Only VxVM is the viable solution in this case .. we cannot do it on hardware - EVA Business Copy unless Contiou$ Acce$$ $oftware is purcha$ed. Problem is we're running these operations on rp8420's and SuperDOmes where Full VxVM licenses and maintenance are expensive...

I'll see what management says... as we are already using this approach on HDS (XP Storage) and Solaris 8/9 VxVM.



Hakuna Matata.
Sundar_7
Honored Contributor

Re: VGSPLIT - Split LVOLS to Different VG

Forget about my last post. Looks like you cannot execute vgreduce even if the mirror is split.
Learn What to do ,How to do and more importantly When to do ?
Sundar_7
Honored Contributor

Re: VGSPLIT - Split LVOLS to Different VG

You can use the following procedure IF you are planning to import the mirror copies on to a DIFFERENT SYSTEM.

This may not be the cleanest method, but the best I could come up with.

1) Mirror the Logical volumes. Here is the trick. The allocation policy for ther logical volumes should be PV strict or PVG-strict. Otherwise, you dont have control over which PV the logical volume will be mirrored to.

It would be a good idea to define all the primary PVs in one PVG, the mirror PVs (that are going to be taken out) as another PVG and mention the allocation policy for the LV as PVG-Strict.

2) Split the LVs. This will create the logical volume device files in the system. By default "b" is appended to the logical volume device file.

Here is the catch

3) After splitting the mirror, you need NOT deactivate the volume group and export the vg IF the mirror copies are to be mounted on a different server

On the target server

a) Create the VG dir, group file
b) Import the VG with only Mirror PVs. These PVs are already part of the VG in the Source system. But that doesnt matter.
c) FSCK and mount the logical volumes.

4) Once you are done with the copies (like backup etc), do a vgchange -a y on the source system and execute lvmerge.

This way there is no downtime involved.
Learn What to do ,How to do and more importantly When to do ?

Re: VGSPLIT - Split LVOLS to Different VG

Hmm - what Sundar is suggesting may well work, but I'll put money on it that if it is put to HP they will say 'not supported', which I suspect given your environment Nelson, may be something you can't do.

VxVM looks like your best and only real option in this scenario.

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Elmar P. Kolkman
Honored Contributor

Re: VGSPLIT - Split LVOLS to Different VG

Another solution, by using the fact you can have a volume group on multiple nodes active, but only read-write on one.
After making the splitted mirror, you activate the volume group on all other nodes in read-only mode and then copy the data from the splitted lvol to a read-write lvol to use it.

Every problem has at least one solution. Only some solutions are harder to find.
Alzhy
Honored Contributor

Re: VGSPLIT - Split LVOLS to Different VG

Sundar.. I actually have toyed and tested the idea some months back.. it works, but I would have to agree - HP won't support it if things go wrong..



Thanks all.
Hakuna Matata.