IBM Support

Using Mirror Pools with AIX LVM

Question & Answer


Question

How do I implement mirror pools in AIX LVM?

Answer

Mirror pools are simply collections or groupings of disks within a Volume Group. Each disk in the VG can be assigned to only one mirror pool .

Logical Volume copies which are assigned to a mirror pool will allocate partitions only from the physical volumes in that mirror pool, which simplifies the task of mirroring data.

Mirror pool characteristics can be changed, however, any changes will not affect currently allocated partitions. It is recommended to use the reorgvg command after any mirror pool changes so allocated partitions can be moved to conform to the mirror pool restrictions.

Mirror pools are new to AIX beginning with 6100-02 and are only available for use in Scalable Volume Groups.

Following are examples of creating and using mirror pools with physical volumes of a Volume Group.

Create a new Scalable VG and assign disks to a mirror pool

# mkvg -y mpoolvg -S -p PoolA hdisk24 hdisk25
0516-1254 mkvg: Changing the PVID in the ODM.
0516-1254 mkvg: Changing the PVID in the ODM.
mpoolvg
#

* Only one mirror pool can be defined with mkvg. Disks can be reassigned to new mirror pools after VG creation.

# lspv -P | grep mpoolvg
hdisk24 mpoolvg PoolA
hdisk25 mpoolvg PoolA


Reassign a PV to another mirror pool

# chpv -p PoolB hdisk25

# lspv -P | grep myvg
hdisk24 mpoolvg PoolA
hdisk25 mpoolvg PoolB
#


Add new disks to the the VG and assign them to existing mirror pools

# extendvg -p PoolA mpoolvg hdisk26
0516-1254 extendvg: Changing the PVID in the ODM.
# extendvg -p PoolB mpoolvg hdisk27
0516-1254 extendvg: Changing the PVID in the ODM.
#

# lspv -P | grep mpoolvg
hdisk24 myvg PoolA
hdisk25 myvg PoolB
hdisk26 myvg PoolA
hdisk27 myvg PoolB
#


Mirrored pools can be used with mirrored Logical Volumes...

When creating a mirrored Logical Volume...
# mklv --c <numcopies> -p copy[1|2|3]=<mirroredpoolname> <vgname> <numpps>

When adding a mirror to an existing LV...
# mklvcopy -p copy{1|2|3]=<mirroredpoolname> <lvname> <numcopies>

When mirroring an entire VG...
# mirrorvg -c <numcopies> -p copy{1|2|3]=<mirroredpoolname> <vgname>


Example...

# mklv -y mlv1 -c2 -p copy1=poolA -p copy2=poolB mpoolvg 100

# lslv mlv1
LOGICAL VOLUME: mlv1 VOLUME GROUP: mpoolvg
LV IDENTIFIER: 00050a850000d6000000013ed36da508.1 PERMISSION: read/write
VG STATE: active/complete LV STATE: closed/syncd
TYPE: jfs WRITE VERIFY: off
MAX LPs: 512 PP SIZE: 16 megabyte(s)
COPIES: 2 SCHED POLICY: parallel
LPs: 100 PPs: 200
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: yes
INTRA-POLICY: middle UPPER BOUND: 1024
MOUNT POINT: N/A LABEL: None
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?: NO
INFINITE RETRY: no
DEVICESUBTYPE: DS_LVZ
COPY 1 MIRROR POOL: poolA
COPY 2 MIRROR POOL: poolB
COPY 3 MIRROR POOL: None
#


Changing Mirror Pools

To enable an existing LV to use mirror pools, or to change which mirror pools an LV is allocated to...

NOTE: Partitions allocated to the LV prior to chlv will not belong to the mirror pool defined in the chlv command. reorgvg can be used to move the old partitions to the new mirror pool.

Examples...

Change which copy is assigned to which mirror pool...

# lslv mlv1 | grep MIRROR
MIRROR WRITE CONSISTENCY: on/ACTIVE
COPY 1 MIRROR POOL: poolA
COPY 2 MIRROR POOL: poolB
COPY 3 MIRROR POOL: None
#

# lslv -m mlv1
mlv1:N/A
LP PP1 PV1 PP2 PV2 PP3 PV3
0001 0256 hdisk24 0256 hdisk25
0002 0257 hdisk24 0257 hdisk25
0003 0258 hdisk24 0258 hdisk25
....

# chlv -m copy1=poolB -m copy2=poolA mlv1
0516-1812 lchangelv: Warning, existing allocation violates mirror pools.
Consider reorganizing the logical volume to bring it into compliance.
#

# lslv mlv1 | grep MIRROR
MIRROR WRITE CONSISTENCY: on/ACTIVE
COPY 1 MIRROR POOL: poolB
COPY 2 MIRROR POOL: poolA
COPY 3 MIRROR POOL: None
#

# lslv -m mlv1
mlv1:N/A
LP PP1 PV1 PP2 PV2 PP3 PV3
0001 0256 hdisk24 0256 hdisk25
0002 0257 hdisk24 0257 hdisk25
0003 0258 hdisk24 0258 hdisk25
...


# reorgvg mpoolvg mlv1
0516-962 reorgvg: Logical volume mlv1 migrated.

# lslv -m mlv1
mlv1:N/A
LP PP1 PV1 PP2 PV2 PP3 PV3
0001 0256 hdisk25 0356 hdisk24
0002 0257 hdisk25 0357 hdisk24
0003 0258 hdisk25 0358 hdisk24
...


Disable a mirror pool on an LV copy

# lsvg -m mpoolvg
Logical Volume Copy 1 Copy 2 Copy 3
mlv1 poolA poolB None
mlv2 poolA poolB None


# lsvg -P mpoolvg
Physical Volume Mirror Pool
hdisk24 poolA
hdisk25 poolB
hdisk26 poolA
hdisk27 poolB
#

# chlv -M 2 mlv2

# lsvg -m mpoolvg
Logical Volume Copy 1 Copy 2 Copy 3
mlv1 poolA poolB None
mlv2 poolA None None



Remove a physical volume from a mirror pool

# chpv -P hdisk27

# lsvg -P mpoolvg
Physical Volume Mirror Pool
hdisk24 poolA
hdisk25 poolB
hdisk26 poolA
hdisk27 None
#



===========


Errors you may see...

If we try to mirror to another disk in the same mirror pool...

# mklvcopy mlv2 2 hdisk27
0516-404 allocp: This system cannot fulfill the allocation request.
There are not enough free partitions or not enough physical volumes to keep strictness and satisfy allocation requests. The command should be retried with different allocation characteristics.
0516-1517 mklvcopy: Failed to create a valid partition allocation.
0516-842 mklvcopy: Unable to make logical partition copies forlogical volume.

---

If you have an LV in the VG which is not assigned to a pool and try to mirror it to any disk (all of which are part of a pool)...
# mklvcopy mlv3 2
0516-1829 mklvcopy: Every mirror pool must contain a copy of the logical volume.
0516-842 mklvcopy: Unable to make logical partition copies for logical volume

---

With strict mirror pools defined, you must specify copies value and defined which copy is allocated to which mirror pool...

Failure to specify copies or pools errors with...

# mklv -y mlv2 mpoolvg 100
0516-1829 mklv: Every mirror pool must contain a copy of
the logical volume.
0516-822 mklv: Unable to create logical volume.

Specifying copies value without defining the pools errors with...

# mklv -y mlv2 -c2 mpoolvg 100
0516-1814 lcreatelv: Mirror pools must be defined for each copy when strict mirror
pools are enabled.
0516-822 mklv: Unable to create logical volume.
#

Specifying both copies value and defining which copy is allocated to which pool succeeds...

# mklv -y mlv2 -c2 -p copy1=poolA -p copy2=poolB mpoolvg 100
mlv2

[{"Product":{"code":"SWG10","label":"AIX"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Miscellaneous","Platform":[{"code":"PF002","label":"AIX"}],"Version":"6.1;7.1","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
17 June 2018

UID

isg3T1019574