Monday 22 May 2017

Understanding AIX Volume Group limitations and types

Modern versions of AIX have three types of Volume Groups:  Original, Big, and Scalable.    
In my opinion, for any new volume groups you are creating you should always use scalable unless you will have the need to export the volume group and import it on very old versions of AIX.  Scalable volume groups have very few limitations when compared to big and original volume groups.  
Unfortunately there are a ton of original and big volume groups out there in the world, and it can be very tricky to understand their limitations.  The main barriers people hit with original and big volume groups is the limit on the maximum number of disks in the volume group ("MAX PVs") and the limit on how many PP's can be on the disk which directly impacts how large a disk in the volume group can be ("MAX PPs per PV").
To further complicate this, these 2 limitations are variable based on the volume group "Factor".   The factor is a number between 1-16 for original volume groups, and between 1-64 for big volume groups.   As you increase the factor, the "MAX PVs" does down and the "MAX PPs per PV" goes up.   It is essentially a trade off:  if you would like larger disks, you can't have as many.  If you want more disks, they can't have as many PP's on them.  
The factor of a volume group can be changed with the "chvg -t" command.   
Below is how the factor affects original VG's and Big VG's  ( Scalable VG's don't have a factor settings ) :

Original(Normal) VG

Factor
Max PV's
Max PP's per PV
1
32
1016
2
16
2032
3
10
3048
4
8
4064
5
6
5080
6
5
6096
7
4
7112
8
4
8128
9
3
9144
10
3
10160
11
2
11176
12
2
12192
13
2
13208
14
2
14224
15
2
15240
16
2
16256

Big VG

Factor
Max PV's
Max PP's per PV
1
128
1016
2
64
2032
3
42
3048
4
32
4064
5
25
5080
6
21
6096
7
18
7112
8
16
8128
9
14
9144
10
12
10160
11
11
11176
12
10
12192
13
9
13208
14
9
14224
15
8
15240
16
8
16256
17
7
17272
18
7
18288
19
6
19304
20
6
20320
21
6
21336
22
5
22352
23
5
23368
24
5
24384
25
5
25400
26
4
26416
27
4
27432
28
4
28448
29
4
29464
30
4
30480
31
4
31496
32
4
32512
33
3
33528
34
3
34544
35
3
35560
36
3
36576
37
3
37592
38
3
38608
39
3
39624
40
3
40640
41
3
41656
42
3
42672
43
2
43688
44
2
44704
45
2
45720
46
2
46736
47
2
47752
48
2
48768
49
2
49784
50
2
50800
51
2
51816
52
2
52832
53
2
53848
54
2
54864
55
2
55880
56
2
56896
57
2
57912
58
2
58928
59
2
59944
60
2
60960
61
2
61976
62
2
62992
63
2
64008
64
2
65024
The standard AIX utilities such as "lsvg" don't directly show you the volume group type or the volume group factor.   There is a "readvgda" command that you can run on a hdisk (i.e. "readvgda hdisk0") that will show the volume group type and the factor, but it also shows a bunch of other info so its difficult to quickly and efficiently get information from. 
Here is a script that produces a quick report showing several things such as the volume group type, factor size, max PV's, used PV's, Max PP's per PV, PP Size, and max disk size.

Here is a screenshot of the report produced:

 

 

 

 

 

 

 

 

 

 

 

Here is the script:

#!/usr/bin/perl
use strict;
my (@vgs,$vg,@output,$line,$type,$maxpvs,$maxppsperpv);
my ($activepvs,$ppsize,$total,$factor,$maxdisk);
@vgs = `lsvg -o | sort`;

print "                                        Max           Max  \n";
print "                                        PP's    PP    disk \n";
print "                    Max   Used  VG      per     Size  size \n";
print "VG Name      Type   PV's  PV's  Factor  PV      (MB)  (MB) \n";
print "-----------------------------------------------------------\n";
foreach $vg (@vgs){
        chomp($vg);
        @output = `lsvg $vg`;
        $ppsize = $maxpvs = $activepvs = $type = $maxppsperpv = "";
        foreach $line (@output){
                if ($line =~ /PP SIZE:\s+(\d+)\s+mega.*/) {$ppsize = $1;}
                if ($line =~ /MAX PVs:\s+(\d+).*/) {$maxpvs = $1;}
                if ($line =~ /ACTIVE PVs:\s+(\d+).*/) {$activepvs = $1;}
                if ($line =~ /MAX PPs per PV:\s+(\d+).*/) {$maxppsperpv = $1;}
        }
        $total=$maxpvs*$maxppsperpv;
        $maxdisk=$ppsize*$maxppsperpv;
        if ($maxpvs == 1024) {
                $type = "scale";
        }elsif (($total >= 22352) && ($total <= 32512)){
                $type = "orig";
        }elsif (($total >= 87376) && ($total <= 130048)){
                $type = "big";
        }else{
                print "error determining VG type\n";
                next;
        }

        if ($type eq "orig" || $type eq "big"){
                $factor = $maxppsperpv/1016   
        }else{
                $factor = "N/A";
                $maxppsperpv = "N/A";
                $maxdisk = $ppsize*2097152;
        }

        printf "%-12s %-6s %-5s %-5s ",$vg,$type,$maxpvs,$activepvs;
        printf "%-7s %-7s %-5s %-7s \n",$factor,$maxppsperpv,$ppsize,$maxdisk;
}

No comments:

Post a Comment