mirror external scsi to san

Hi,

How do I mirror an external scsi vg to one hdisk san? The vg has multiple hdisks and the san hdisk has only one.

Is this possible or do I need to create the same hdisks as the scsi? What I meant is, if the scsi vg has 10 hdisk then I need to create also 10 hdisk of san with the same size as per hdisk?

Or I can mirror a logical vg one by one?

Here's the sample of one of the vg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
lv110 jfs 3840 3840 8 closed/syncd N/A
lv102 jfs 128 128 1 closed/syncd N/A
lv68 jfs 16 16 1 closed/syncd N/A
loglv03 jfslog 1 1 1 open/syncd N/A
lvcrt01 jfs 178 178 1 open/syncd /crt01
lv106 jfs 16 16 1 open/syncd /db2replication
lv100 jfs 320 320 2 open/syncd /db2logs
paging05 paging 16 16 1 open/syncd N/A
paging06 paging 16 16 1 open/syncd N/A
paging01 paging 16 16 1 open/syncd N/A
lvcrt02 jfs 175 175 1 open/syncd /crt02
lv103 jfs 256 256 1 closed/syncd N/A

As much as possible I don't want a downtime. I don't know what is the best approach.

Thanks in advance,
itik

You can mirror this to only one LUN if that LUN is big enough. Just add lv copies with

mklvcopy <LVname> 2 hdiskXX

where hdiskXX is the LUN from the san. Do this for every LV and then sync the volume group with

syncvg -v <VGname>.

Thats about it.

Short answer: yes, you can mirror several SCSI disks to one SAN disk - but you should not do it anyways.

Long version:

  1. FS considerations
    As far as your sample vg layout goes you still use JFS(-1) filesystems. You should change that to the newer and by far better JFS2-filesystem. It will be necessary to recreate the filesystems and do a backup/restore of the data. As far as i know there is no way to convert JFS to JFS2 directly.

  2. VG considerations
    There are some limits in the LVM and one does good to stay away from any of them. The most restraining one is (in my experience) the PP size. As a PV can only hold 1019 PPs it limits directly the size of the disks you can effectively use. (Yes, there is the possibility of using a "factor" to lighten this restriction up to a certain point but at the same time it even tightens the limit on the maximum number of PVs in a VG, so i would not consider it as a long-term solution. Better stay away from that and save this option for a situation where it really *really* is your only possibility.)

As you have several SCSI PVs in the VG i suppose the PP size to be relatively small. When you add your SAN disk it probably exceeds the PP number limit and would practically enforce you to introduce a factor into the VG. The IMHO better (that is: more sustainable) solution would be recreate the VG anew and with better suited values for PP size.

Conclusion

If you still want to migrate to the new disk without recreating the VG and the FSs do the following, which can all be done without any downtime:

  1. Add the new PV to the VG, maybe first changing the VG to a "Big VG" and introducing a factor as necessary.

  2. use the "mirrorvg" facility to add mirrors to every LV, you can designate the new PV as destination for the mirror. You can do that using SMITty.

  3. wait until the synchronization is finished. This may take some time and you might want to start in an evening so this can take place over night.

  4. remove the mirror using the "unmirrorvg". You can again use SMITty and designate which mirror to remove by declaring the PVs from which the mirrors are to be removed.

  5. used "reducevg" to get the old disks out of the VG finally.

  6. use "rmdev" to remove the SCSI devices, disconnect them from the system.

Again, i would consider this as an unfortunate solution, but it *can* be done without any downtime (just the performance would be noticeably degraded during the synchronization). Better do the following:

  1. create a new VG using the SAN share as PV. Carefully choose a sensible value for the PP size as it limits the maximum size of the PVs in the VG as well as the maximum capacity of the VG as a whole. (Introducing a factor means multiplying the maximum number of PPs per PV as well as dividing the maximum number of PVs in the VG by this factor, so the maximum diskspace held by the VG is final!)

  2. create LVs/FSs using the old VG as a blueprint. Use JFS2 as filesystem. Use temporary mountpoints to mount the newly created FSs.

2a. Create a (several?) mountgroup(s) for the new filesystems. You can use "mount -t" to mount all the filesystems in such a group so this is a handy device. You do this by adding a "type = <mountgroup name>" line into the FS stanza in /etc/filesystems.

  1. Identify static content of the filesystems. This can be copied to the new FSs in advance.

  2. Get a downtime to migrate the rest of the data via copy/restore. Tip: you can do it in one pass using the following mechanism:

# cd /old/fs
# tar -cvf - * | (cd /new/fs ; tar -xf - )
  1. umount the old FSs and new , change the temporary mountpoints of the new FSs in /etc/filesystem, mount the new filesystems.

  2. let some time pass to make sure everything is ok. You can still mount the old FSs to temporary mountpoints if something is (supposed to be) missing.

  3. after a "varoffvg oldvg" and "exportvg oldvg" delete the devices of the SCSI devices and unplug them.

I hope this helps.

bakunin

Do I need to care about the closed lv (lv110, lv102,lv68,lv103)? Is that the db2 unmanaged database?

I think I will do just a copy and restore so there will be a downtime because Bakunin is right with the PPs. Can't mirror without the same PP size.

itik

These are just LVs, which are not in use at the moment, because the filesystems on them are unmounted. If you still need them or not is nothing we can find out for you - it might be a database as well as any other type of data, but the reason the LVs are "closed" is because of the FSs they contain are not mounted.

I hope this helps.

bakunin

once again, bakunin, thank you. are you related to the great mikhail of russia.

I have to open this again.

I was able to sync scsi to san with minimal downtime.

Somehow, when I got error adding hdisk-san on the scsi-multiple-hdisk, it give me errors, so I check it on google.

I tried these:

unmount all filesystem first on that vg. (of couse, the /db2logs, you need to tell the user to logout of db2).

chvg -B vg9

mount all filesystems again on that vg9. (you can tell the db2 user to go back)

chvg -t 64 vg9 (you have to play between 8-64)

Then you will be able to add the san-hdisk on the vg9 and mirror all the filesystems. After that, you can remove the old-scsi-hdisk.

By the way, my AIX is still 43 ml 9 and all jfs. Then my next project is to migrate AIX 43 to 53...