Quantcast
Channel: web-manual.net » chvg
Viewing all articles
Browse latest Browse all 5

VOLUME GROUP(VG) in AIX

$
0
0

Volume Group is at the highest level in LVM hierarchy. Volume Group are created by including Physical volume. For more information you can see the previous article: AIX Logical Volume Manager .When we install AIX on a system, the first volume group (VG) is created. It is called the rootvg.  rootvg volume group is a base set of logical volumes required to start the system. It includes paging space, the journal log, boot data, and dump storage, each on its own separate logical volume.

Below are the Volume Group characteristics.

Naming of Volume Group: The name of Volume Group should be unique and the name should range from 1 to 15 characters.

States of Volume Group: The following states are possible for Volume Group:


Active :
The active/complete state of Volume Group signifies that all of the physical volumes in the Volume Group are fully active. In this state the Volume Group is fully usable by the applications. The varyonvg command is used to bring the Volume Group to active/complete state.

Partial : The active/partial state of Volume Group signifies that all of the physical volumes in the Volume Group are not active. Some of the PVs can be in unavailable or removed state. This may cause the alarming condition and the data loss may happen if continuing in this state.

Inactive State :The inactive state of Volume Group signifies that the Volume Group is not in use and can’t be used for any application. The varyoffvg command used to bring down the Volume Group.


The Volume Groups are of three type:

Normal Volume Group : A normal VG is limited to 32512 physical partitions (32 physical volumes each with 1016 partitions) and 256 logical Volumes.Big Volume Group: A Big Volume Group is limited to 130,048 physical partition ( 128 Physical Volumes each with 1016 partitions) and 512 Logical Volumes.Scalable Volume Group: Scalable Volume Group can have by default 1024 Physical Volumes, 256 Logical Volumes and 32768 Physical Partitions. The number of Logical Volumes can be increased up to 4096and Physical Partitions can also be increased.
VG type Maximum PVs  Maximum LVs Maximum PPs per VG Maximum PP size
Normal 32 256 32,512 (1016 * 32) 1G
Big 128 512 130,048 (1016 * 128) 1G
Scalable 1024 4096 2,097,152 128G

If a physical volume is part of a volume group, it contains 2 additional reserved areas. One area contains both the VGSA and the VGDA, and this area is started from the first 128 reserved sectors (blocks) on the disk. The other area is at the end of the disk, and is reserved as a relocation pool for bad blocks.

VGDA (Volume Group Descriptor Area) It is an area on the hard disk (PV) that contains information about the entire volume group. There is at least one VGDA per physical volume, one or two copies per disk. It contains physical volume list (PVIDs), logical volume list (LVIDs), physical partition map (maps lps to pps) . lquery -tAP look into the VGDA (-A:all info, -t: tagged, without it only numbers) as below

#lqueryvg -tAp hdisk1
Max LVs: 256
PP Size: 28
Free PPs: 1110
LV count: 2
PV count: 3
Total VGDAs: 3
Conc Allowed: 0
MAX PPs per PV 32768
MAX PVs: 1024
Quorum (disk): 1
Quorum (dd): 1
Auto Varyon ?: 2
Conc Autovaryo 0
Varied on Conc 0
Logical: 000aac4c0000d6000000012f114223ea.1 webmaualv01 1
000aac4c0000d6000000012f114223ea.2 loglv01 1
Physical: 000aac4c624f1e97 1 0
000aac4c66d6dc6f 1 0
000aac4ccd555e20 1 0
Total PPs: 1691
LTG size: 128
HOT SPARE: 0
AUTO SYNC: 0
VG PERMISSION: 0
SNAPSHOT VG: 0
IS_PRIMARY VG: 0
PSNFSTPP: 140288
VARYON MODE: 0
VG Type: 2
Max PPs: 32768
Mirror Pool St n
Sys Mgt Mode: 0
VG Reserved: 1
PV RESTRICTION 0

VGSA (Volume Group Status Area) The VGSAs are always present, but used with mirroring only. Needed to track the state of mirror copies, that means whether synchronized or stale. Per-disk stucture, but twice on each disk.

Changing factor value (chvg -t) of a VG:

A normal or a big vg has the following limitations after creation:
MAX PPs per VG = MAX PVs * MAX PPS per PV)

Normal Big
MAX PPs per VG 32512 130048
MAX PPs per PV 1016 1016
MAX PVs 32 128

 

root@webmanual: / # chvg -t 2 webvg
0516-1164 chvg: Volume group webvg changed. With given characteristics webvg
can include up to 16 physical volumes with 2032 physical partitions each.

Calculation:
Normal VG: 32/factor = new value of MAX PVs
Big VG: 128/factor= new value of MAX PVs

-t PPs per PV Max PVs(Normal) MAX PVs (Big)
1 1016 32 128
2 2032 16 64
3 3048 8 32
4 4064 4 16
5 5080 2 8

“chvg -t” can be used online either increasing or decreasing the value of the factor.

Changing Normal VG to Big VG:

If you reached the MAX PV limit of a Normal VG and playing with the factor (chvg -t) is not possible anymore you can convert it to Big VG.
It is an online activity, but there must be free PPs on each physical volume, because VGDA will be expanded on all disks:

root@webmanual: / # lsvg -p webvg
webvg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk2 active 511 2 02..00..00..00..00
hdisk3 active 511 23 00..00..00..00..23
hdisk4 active 1023 0 00..00..00..00..00root@webmanual: / # chvg -B webvg
0516-1216 chvg: Physical partitions are being migrated for volume group
descriptor area expansion. Please wait.
0516-1164 chvg: Volume group webvg2 changed. With given characteristics webvg2
can include up to 128 physical volumes with 1016 physical partitions each.

Changing Normal or Big VG to Scalable VG:

If you reached the MAX PV limit of a Normal or a Big VG and playing with the factor (chvg -t) is not possible anymore you can convert that VG to Scalable VG. A Scalable VG allows a maximum of 1024 PVs and 4096 LVs and a very big advantage that the maximum number of PPs applies to the entire VG and is no longer defined on a per disk basis.

Converting to Scalable VG is an offline activity (varyoffvg), and there must be free PPs on each physical volume, because VGDA will be expanded on all disks.

root@webmanual: / # varyoffvg webvg
root@webmanual: / # chvg -G webvg
0516-1214 chvg: Not enough free physical partitions exist on hdisk2 for the
expansion of the volume group descriptor area. Migrate/reorganize to free up
18 partitions and run chvg again.After migrating some lps to free up required PPs (in this case it was 18), then changing to Scalable VG is successful:
root@webmanual: / # chvg -G webvg
0516-1224 chvg: WARNING, once this operation is completed, volume group webvg
cannot be imported into AIX 5.2 or lower versions. Continue (y/n) ?

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

Some Important Commands

To lists the volume groups that are on the system
lsvg
To lists all volume groups that are varied onlsvg -oTo lists PVs of online VGs
lsvg -o | lsvg -ipTo list all Lv of online VGslsvg -o |lsvg -ilTo create a New VG

mkvg

example

mkvg -y webvg hdisk2 hdisk3 hdisk4

To changes the characteristics of a volume group
chvg

To extend a VG
extendvg

To delete a hsidk from a VG
reducevg rootvg

To synchronizes stale physical partitions
syncvg

To makes a vg available or online
varyonvg rootvg

To makes a vg deactive or offline
varyoffvg rootvg

To Mirror a VG
mirrorvg

To Unmirror a VG
unmirrorvg

To removes the VGs definition out of the ODM and /etc/filesystems (for ODM problems after importvg will fix it)
exportvg

To makes the previously exported vg known to the system (hdisk8, is any disk belongs to the vg)
importvg

The post VOLUME GROUP(VG) in AIX appeared first on web-manual.net.


Viewing all articles
Browse latest Browse all 5

Trending Articles