Following on from my previous post, on working with scalable VGs.

https://www.ibm.com/developerworks/mydeveloperworks/blogs/cgaix/entry/working_with_aix_scalable_volume_groups1?lang=en

You may find yourself in a situation where youd like to convert a VG to scalable.

For example, you might start off with a normal VG i.e. one that can support a maximum of 256 LVs and 32 PVs.

# mkvg -s 512M -y myvg hdisk5

myvg

# lsvg myvg

VOLUME GROUP: myvg VG IDENTIFIER: 00f6027300004c0000000133aa24d1f6

VG STATE: active PP SIZE: 512 megabyte(s)

VG PERMISSION: read/write TOTAL PPs: 99 (50688 megabytes)

MAX LVs: 256 FREE PPs: 0 (0 megabytes)

LVs: 1 USED PPs: 99 (50688 megabytes)

OPEN LVs: 1 QUORUM: 2 (Enabled)

TOTAL PVs: 1 VG DESCRIPTORS: 2

STALE PVs: 0 STALE PPs: 0

ACTIVE PVs: 1 AUTO ON: yes

MAX PPs per VG: 32512

MAX PPs per PV: 1016 MAX PVs: 32

LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no

HOT SPARE: no BB POLICY: relocatable

PV RESTRICTION: none

Sometime later you discover you need to grow the volume group and add more hdisks. But you cant because youve reached the maximum PV limit of 32.

You examine the chvg man page and discover the G flag! Of course you take note of the special considerations when converting to scalable.

Changes the volume group to Scalable VG format. This can accommodate up to 1024 physical volumes and 4096 logical volumes. Notes:

1 The -G flag cannot be used if there are any stale physical partitions.

2 Once the volume group is converted, it cannot be imported into AIX(R) 5.2 or lower versions.

3 The -G flag cannot be used if the volume group is varied on.

4 There must be enough free partitions available on each physical volume for the VGDA expansion for this operation to be successful.

5 Since the VGDA resides on the edge of the disk and it requires contiguous space for expansion, the free partitions are required on the edge of the disk. If those partitions are allocated for user usage, they will be migrated to other free partitions on the same disk. The rest of the physical partitions will be renumbered to reflect the loss of the partitions for VGDA usage. This will change the mappings of the logical to physical partitions in all the PVs of this VG. If you have saved the mappings of the LVs for a potential recovery operation, you should generate the maps again after the completion of the conversion operation. Also, if the backup of the VG is taken with the map option and you plan to restore using those maps, the restore operation may fail since the partition number may no longer exist (due to reduction). It is recommended that backup is taken before the conversion, and right after the conversion if the map option is utilized.

6 Because the VGDA space has been increased substantially, every VGDA update operation (creating a logical volume, changing a log ical volume, adding a physical volume, and so on) may take considerably longer to run.

Excellent, I can convert my VG to scalable.

The volume group must be varied off before it can be converted.

# chvg -G myvg

0516-1707 chvg: The volume group must be varied off during conversion to

scalable volume group format.

0516-732 chvg: Unable to change volume group myvg.

# umount /myfs

# lsvg -l myvg

myvg:

LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT

mylv jfs2 99 99 1 closed/syncd /myfs

# varyoffvg myvg

There must be enough free PPs in the volume group (on each hdisk) in order for the conversion to work. If there arent then youll see this error:

# chvg -G myvg

0516-1214 chvg: Not enough free physical partitions exist on hdisk5 for the

expansion of the volume group descriptor area. Migrate/reorganize to free up

1 partitions and run chvg again.

0516-732 chvg: Unable to change volume group myvg.

In this example, we vary on the VG again, and shrink the file system by 1 PP, giving us 1 PP free in the volume group. Remember, There must be enough free partitions available on each physical volume for the VGDA expansion for this operation to be successful.

# varyonvg myvg

# chfs -a size=-512M /myfs

Filesystem size changed to 102760448

Inlinelog size changed to 196 MB.

# lsvg myvg

VOLUME GROUP: myvg VG IDENTIFIER: 00f6027300004c0000000133aa24d1f6

VG STATE: active PP SIZE: 512 megabyte(s)

VG PERMISSION: read/write TOTAL PPs: 99 (50688 megabytes)

MAX LVs: 256 FREE PPs: 1 (512 megabytes)

LVs: 1 USED PPs: 98 (50176 megabytes)

OPEN LVs: 0 QUORUM: 2 (Enabled)

TOTAL PVs: 1 VG DESCRIPTORS: 2

STALE PVs: 0 STALE PPs: 0

ACTIVE PVs: 1 AUTO ON: yes

MAX PPs per VG: 32512

MAX PPs per PV: 1016 MAX PVs: 32

LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no

HOT SPARE: no BB POLICY: relocatable

PV RESTRICTION: none

The VG is varied off again.

# varyoffvg myvg

# lsvg -o

rootvg

We convert the VG to scalable.

# chvg -G myvg

0516-1224 chvg: WARNING, once this operation is completed, volume group myvg

cannot be imported into AIX 5.2 or lower versions. Continue (y/n) ? y

0516-1216 chvg: Physical partitions are being migrated for volume group

descriptor area expansion. Please wait.

0516-1712 chvg: Volume group myvg changed. myvg can include up to 1024 physical volumes with 2097152 total physical partitions in the volume group.

We vary on the volume group and check that it is now scalable. Youll notice that weve now lost that free PP in the VG as it has been used in the conversion process.

# varyonvg myvg

# lsvg myvg

VOLUME GROUP: myvg VG IDENTIFIER: 00f6027300004c0000000133aa24d1f6

VG STATE: active PP SIZE: 512 megabyte(s)

VG PERMISSION: read/write TOTAL PPs: 98 (50176 megabytes)

MAX LVs: 256 FREE PPs: 0 (0 megabytes)

LVs: 1 USED PPs: 98 (50176 megabytes)

OPEN LVs: 0 QUORUM: 2 (Enabled)

TOTAL PVs: 1 VG DESCRIPTORS: 2

STALE PVs: 0 STALE PPs: 0

ACTIVE PVs: 1 AUTO ON: yes

MAX PPs per VG: 32768 MAX PVs: 1024

LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no

HOT SPARE: no BB POLICY: relocatable

PV RESTRICTION: none

If you are unable to free up a physical partition on a your hdisk (or hdisks) then you may need to use a tool like migratelp to move logical partitions around in order to free up some space. From the migratelp man page:

migratelp Command

Purpose

Moves allocated logical partition from one physical partition to another physical partition on a different physical volume.