• No results found

Inter physical volume allocation policy

Chapter 1. Components of the logical volume manager

3.1 Concept

3.1.2 Inter physical volume allocation policy

The inter-physical volume allocation policy is one of the attributes of the logical volumes. It stipulates how many physical volumes are used for the allocation of the physical partitions for the logical volume. Usually (meaning non-striped logical volume case) it is set to m (minimum) by default to minimize the physical volumes that are used for the allocation of the physical partitions of the logical volume. It is adequate, since if one of the physical volumes that accommodates this logical volume fails, then the entire logical volume will be lost.

striped LV

1-11-2 1-3 2-12-2 2-3 3-13-2 3-3 LP 1 LP 7 LP 4 LP 2 LP 8 LP 5 LP 3 LP 9 LP 6 3 4 3 4 3 4 1 5 2 5 5

LVM device driver

The AIX LVM does not re-assemble these chunks into one read request. The chunks are read from each physical volume, then write into the caller’s memory area directly.

To confirm the inter-physical volume allocation policy of the logical volume, you can use the lslv command as shown:

In this example, the inter-physical volume allocation policy is set to minimum (shown as minimum in the rectangle). Since this is not a striped logical volume, there is no reason to set the inter-physical volume allocation policy to maximum. It is the default value for non-striped logical volumes.

3.1.2.1 How does the inter-physical volume allocation policy work? In most circumstances, there is no need to set the inter-physical volume allocation policy set to maximum (x). However, you might want to know how it works. The answer is described in the following sections.

Example of configurations

All the examples shown in this section are examined with the following configuration:

• AIX Version 4.3.3 • RS/6000 model F50

• PPC604e 332MHz x 4 ways • 512MB RAM

• 2 x 9.1GB SCSI2 F/W disk (hdisk0 and hdisk3)

• 4 x 4.5GB Ultra SCSI F/W disk (the other LVD connection disks) Here is the listing of the disks on our system:

root@lorraine:/ [121] # lsdev -Cc disk

hdisk0 Available 10-60-00-8,0 16 Bit SCSI Disk Drive hdisk1 Available 10-60-00-9,0 16 Bit LVD SCSI Disk Drive hdisk2 Available 10-60-00-10,0 16 Bit LVD SCSI Disk Drive hdisk3 Available 30-58-00-8,0 16 Bit SCSI Disk Drive hdisk4 Available 30-58-00-9,0 16 Bit LVD SCSI Disk Drive

root@lorraine:/ [113] # lslv hd6

LOGICAL VOLUME: hd6 VOLUME GROUP: rootvg LV IDENTIFIER: 00041631ae592047.2 PERMISSION: read/write VG STATE: active/complete LV STATE: opened/syncd TYPE: paging WRITE VERIFY: off

MAX LPs: 512 PP SIZE: 16 megabyte(s) COPIES: 1 SCHED POLICY: parallel LPs: 64 PPs: 64

STALE PPs: 0 BB POLICY: non-relocatable INTER-POLICY: minimum RELOCATABLE: yes

INTRA-POLICY: middle UPPER BOUND: 32 MOUNT POINT: N/A LABEL: None MIRROR WRITE CONSISTENCY: off

hdisk5 Available 30-58-00-10,0 16 Bit LVD SCSI Disk Drive

Here is the creation of the volume group, which will contain the striped logical volumes:

root@lorraine:/ [122] # mkvg -y pmstripevg -s 8 -t 2 hdisk1

0516-1193 mkvg: WARNING, once this operation is completed, volume group pmstripevg cannot be imported into AIX 430 or lower versions. Continue (y/n)? y

pmstripevg

root@lorraine:/ [137] # lsvg pmstripevg

VOLUME GROUP: pmstripevg VG IDENTIFIER: 00041631540cc083 VG STATE: active PP SIZE: 8 megabyte(s) VG PERMISSION: read/write TOTAL PPs: 537 (4296 megabytes) MAX LVs: 256 FREE PPs: 537 (4296 megabytes) LVs: 0 USED PPs: 0 (0 megabytes) OPEN LVs: 0 QUORUM: 2

TOTAL PVs: 1 VG DESCRIPTORS: 2 STALE PVs: 0 STALE PPs: 0 ACTIVE PVs: 1 AUTO ON: yes MAX PPs per PV: 2032 MAX PVs: 16 root@lorraine:/ [129] # extendvg -f pmstripevg hdisk2 root@lorraine:/ [130] # extendvg -f pmstripevg hdisk4 root@lorraine:/ [131] # extendvg -f pmstripevg hdisk5 root@lorraine:/ [132] # lsvg

pmstripevg rootvg

Here is the resulting volume group: root@lorraine:/ [133] # lsvg pmstripevg

VOLUME GROUP: pmstripevg VG IDENTIFIER: 00041631540cc083 VG STATE: active PP SIZE: 8 megabyte(s)

VG PERMISSION: read/write TOTAL PPs: 2148 (17184 megabytes) MAX LVs: 256 FREE PPs: 2148 (17184 megabytes) LVs: 0 USED PPs: 0 (0 megabytes) OPEN LVs: 0 QUORUM: 3

TOTAL PVs: 4 VG DESCRIPTORS: 4 STALE PVs: 0 STALE PPs: 0 ACTIVE PVs: 4 AUTO ON: yes MAX PPs per PV: 2032 MAX PVs: 16

3.1.2.2 The poor man’s stripe

To create the logical volume with the inter-physical volume allocation policy set to maximum (x), you can use following SMIT panel.

root@lorraine:/ [141] # smit lv Add a Logical Volume

Enter the volume group name in the following dialog.

Add a Logical Volume

Type or select a value for the entry field. Press Enter AFTER making all desired changes.

Now enter the necessary information. In this example, we specified the information shown in the rectangles in the following SMIT dialog panel screen.

If you prefer the command line interface, you can use the following command: root@lorraine:/ [146] # mklv -y pmstripelv -e x pmstripevg 8

To examine how the physical partitions are allocated, we use the lslv command: root@lorraine:/ [147] # lslv -m pmstripelv pmstripelv:N/A LP PP1 PV1 PP2 PV2 PP3 PV3 0001 0109 hdisk1 0002 0109 hdisk2 0003 0109 hdisk4 0004 0109 hdisk5 0005 0110 hdisk1 0006 0110 hdisk2 0007 0110 hdisk4 0008 0110 hdisk5

Figure 50 on page 145 shows the same information in a graphical output.

Add a Logical Volume

Type or select values in entry fields. Press Enter AFTER making all desired changes.

[TOP] [Entry Fields] Logical volume NAME [pmstripelv] * VOLUME GROUP name pmstripevg

* Number of LOGICAL PARTITIONS [8] # PHYSICAL VOLUME names [] + Logical volume TYPE []

POSITION on physical volume middle + RANGE of physical volumes maximum + MAXIMUM NUMBER of PHYSICAL VOLUMES [] # to use for allocation

Number of COPIES of each logical 1 + partition

Mirror Write Consistency? yes + Allocate each logical partition copy yes + on a SEPARATE physical volume?

RELOCATE the logical volume during yes + reorganization?

Logical volume LABEL []

MAXIMUM NUMBER of LOGICAL PARTITIONS [512] # Enable BAD BLOCK relocation? yes + SCHEDULING POLICY for reading/writing parallel + logical partition copies

Enable WRITE VERIFY? no + File containing ALLOCATION MAP []

Stripe Size? [Not Striped] + [BOTTOM]

Figure 50. The physical partition allocation of the poor man’s stripe

At first look, it looks like a striped logical volume. But, there is a distinct difference between this logical volume and a striped logical volume since there is no chunk level I/O striping benefit. Also, this physical volume allocation does not provide any I/O performance gain, but also it provides vulnerability (any disk fails and the logical volume is lost). This configuration is not beneficial in most circumstances, and it is called a poor man’s stripe (not an actual striped logical volume).

3.1.2.3 Pre-defined allocation policy

In a striped logical volume, the inter-physical volume allocation policy is forcibly pre-defined as maximum to achieve the logical partitions mapping scheme described in 3.1.1.1, “The logical partitions mapping scheme” on page 138. It cannot be changed after the initial creation. If you try to force this value, then you would see the error message described in “Prohibited options of the mklv command with striping” on page 150.

For real examples of managing striped logical volumes, please refer to 3.2, “Real examples” on page 152.