Convert to Scalable Volume Groups

Convert to Scalable Volume Groups

 

 

 

You may need to add extra disks to a volume group (VG) due to pure business data growth or because you require additional testing environments. You might face a situation where you’ve exceeded the permitted allowed maximum physical volume (PV) for that VG. This is true for small and big VGs. To determine which type of VG you have, use the readvgda command. Just read an active disk within the VG to discover the type. For example:

# readvgda hdisk5 | grep type
.....    readvgda_type: smallvg

readvgda hdisk1 | grep type
.....    readvgda_type: bigvg

# readvgda hdisk4 |grep type 
.....    readvgda_type: svg.    

AIX has three types of VGs:

  1. Small VG (smallvg) with a Max PV of 32
  2. Big VG (bigvg) with a Max PV of 128
  3. Scalable VG (svg) with a Max PV of 1024

The Max PV values aren’t set in stone and exclude the scalable type as factoring has no effect on this type of VG. If you’ve used factoring to alter your small or big VG, this will bring the Max PV count down. However, this also increases your physical partitions per PV, so it’s a case of swings and roundabouts; in the end, one offsets the other.

So let’s assume you’ve reached the Max PV count in the VG and factoring is no longer an option as it has reduced your actual Max PV count. You need to add additional disks into the VG. The only real option is to convert to a scalable VG. In fact, whenever you need to create a new VG, future-proof it and create a scalable VG.

To convert to a scalable VG, here are the basic rules:

  • No stale partitions within the VG
  • There must be a free logical partition (LP) at the end (edge) of each disk in the VG to hold the new volume group descriptor area (VGDA). Note: Go for at least two free LPs as a best practice
  • VG must be varied off for the conversion

Find Space at the End of Each Disk

For each PV in the VG, ensure you have at least one free LP. I always go for two. It may be more depending on the current VG attributes set, but AIX will tell you if it doesn’t have enough when converting to scalable. You can mess around with reducing filesystems sizes to try to free up LPs at the end of the disk but generally this won’t work.

Let’s review the full disk (hdisk3). In the following output, hdisk3 is full:

# lspv -M hdisk3|tail -4
hdisk3:543      fslv01:510      
hdisk3:544      fslv01:511      
hdisk3:545      fslv01:512      
hdisk3:546      fslv01:513      

Let’s free disk space by migrating the last two LPs from the edge of hdisk3 to hdisk2. We can tell we have free LPs on hdisk2 from the end output of command: 128-135, which tells us we have seven free LPs:

# lspv -M hdisk2|tail -4
hdisk2:125      fslv01:638      
hdisk2:126      fslv01:639      
hdisk2:127      fslv01:640      
hdisk2:128-135

Let’s move the following LPs across to hdisk2, fslv01/512, fslv01/513 using the migratelp command in this format:

migratelp <logical volume>/<LP_number>  <destination_disk>

To move the two LPs from the end of hdisk3 to hdisk2 (which is also contained in the VG), use the following commands:

#migratelp fslv01/513 hdisk2
migratelp: Mirror copy 1 of logical partition 513 of logical volume
        fslv01 migrated to physical partition 128 of hdisk2.
# migratelp fslv01/512 hdisk2
migratelp: Mirror copy 1 of logical partition 512 of logical volume
        fslv01 migrated to physical partition 129 of hdisk2.

Post LP migration, let’s review both disks. We can now see the LPs have been migrated across from hdisk3 to hdisk2 and now hdisk2 has five free LPs.

# lspv -M hdisk3|tail -4
hdisk3:542      fslv01:509      
hdisk3:543      fslv01:510      
hdisk3:544      fslv01:511      
hdisk3:545-546

# lspv -M hdisk2|tail -4
hdisk2:127      fslv01:640      
hdisk2:128      fslv01:513      
hdisk2:129      fslv01:512      
hdisk2:130-135

Let’s Convert

Now we’re all set to convert the VG (datavg) to scalable. First, let’s confirm the VG type we’re converting is a bigvg:

# readvgda hdisk2 |grep type
.....    readvgda_type: bigvg
.

Next, unmount the filesystems contained in the VG, then vary off the VG:

# varyoffvg datavg

Confirm it’s offline:

# lsvg -o 
rootvg
# lsvg   
rootvg
datavg

We’re ready to convert to scalable using the following command format:

chvg –G <vg_name>

When you convert to scalable, you’ll be prompted to confirm that once converted you can’t import into AIX 5.2 or earlier. So let’s convert:

# chvg -G datavg
0516-1224 chvg: WARNING, once this operation is completed, volume group datavg
        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 datavg changed.  datavg can include up to 1024 physical volumes 
with 2097152 total physical partitions in the volume group.

Now vary on the VG, mount the filesystems and check conversation was successful. No errors were output during the conversion so we can be pretty confident all is well, but let’s check anyway by querying the VG type and the MAX PVs, which should now be 1024:

# varyonvg datavg
# mount -a
# readvgda hdisk2 |grep type
.....    readvgda_type: svg
# lsvg datavg | grep "MAX PV"
MAX PPs per VG:     131072                   MAX PVs:        1024

 

Successful Disk Growth

You’re done. The VG has been converted to scalable and you can now add more disks to the VG and experience disk growth without problems.

5 (1)
Article Rating (1 Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
A tcpdump Tutorial and Primer with Examples
Viewed 5064 times since Sun, Jun 17, 2018
IBM V7000f Performance Test with Vdbench Tool on IBM AIX
Viewed 16059 times since Thu, Jan 23, 2020
The new VIOS performance advisor tool part util
Viewed 3226 times since Tue, Jun 4, 2019
AIX↑ AIX www links
Viewed 3737 times since Sat, Apr 20, 2019
AIX - How to shutdown or reboot
Viewed 5587 times since Fri, Jun 8, 2018
Install and configure GNU’s screen on AIX
Viewed 8932 times since Thu, Feb 21, 2019
Troubleshooting Starts With Understanding Your Physical Disks’ Attributes
Viewed 3781 times since Sat, May 19, 2018
Getting bosboot errors, don’t reboot just yet
Viewed 2860 times since Tue, Apr 16, 2019
Awesome Command to show top 15 processes using memory on AIX
Viewed 23852 times since Thu, Nov 29, 2018
Part 2, Detailed diagnosis and troubleshooting
Viewed 2818 times since Tue, May 22, 2018