Pages

dimanche 24 novembre 2013

Using Mirror Pools with AIX LVM


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


# mkvg -y myvg -S -p PoolA hdisk10 hdisk11
0516-1254 mkvg: Changing the PVID in the ODM.
0516-1254 mkvg: Changing the PVID in the ODM.
myvg
#


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


# lspv -P | grep myvg
hdisk10 myvg PoolA
hdisk11 myvg PoolA



Reassign a PV to another mirror pool


# chpv -p PoolB hdisk11


# lspv -P | grep myvg
hdisk10 myvg PoolA
hdisk11 myvg PoolB
#



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


# extendvg -p PoolA myvg hdisk12
0516-1254 extendvg: Changing the PVID in the ODM.
# extendvg -p PoolB myvg hdisk13
0516-1254 extendvg: Changing the PVID in the ODM.
#


# lspv -P | grep myvg
hdisk10 myvg PoolA
hdisk11 myvg PoolB
hdisk12 myvg PoolA
hdisk13 myvg PoolB
#



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


When creating a mirrored Logical Volume...
# mklv --c -p copy[1|2|3]=


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


When mirroring an entire VG...
# mirrorvg -c -p copy{1|2|3]=



Example...


# mklv -y mlv1 -c2 -p copy1=pool1 -p copy2=pool2 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: pool1
COPY 2 MIRROR POOL: pool2
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: pool1
COPY 2 MIRROR POOL: pool2
COPY 3 MIRROR POOL: None
#


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


# chlv -m copy1=pool2 -m copy2=pool1 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: pool2
COPY 2 MIRROR POOL: pool1
COPY 3 MIRROR POOL: None
#


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



# 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 hdisk29 0356 hdisk26
0002 0257 hdisk29 0357 hdisk26
0003 0258 hdisk29 0358 hdisk26
...
===========


Errors you may see...


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


# mklvcopy mlv2 2 hdisk29
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=pool1 -p copy2=pool2 mpoolvg 100
mlv2

Aucun commentaire:

Enregistrer un commentaire