LVM and VxVM

# Which is the formula to estimate future growing in a VG

SOLVED
Go to solution

## Which is the formula to estimate future growing in a VG

Hi all,

I'm newbie.

I had problem when a tried to add a new disk to a existing vg, because the vg was created by all default parameters.

I want to know, which are the values to set in the vgcreate command to allow vg grow adding new disk in the future.

i.e.: I'll need create one vg02 with new 36Gb disk, but, if then (1 year later) I want to add other new 72Gb disk or 2 of 36Gb, I can do that specify rightnow the future required space in the vg02. Only thinking that I want to reach a max growing of 100Gb in the vg02.

Keep in mind:
1. I want to grow to 36gb to 100Gb soon
2. All will be mirrored
3. I want to set the vg parameters and values rightnow, if later I add new disk, I don't care about problems with PE's.

How must the command be?

Thanks..

8 REPLIES 8
Honored Contributor

## Re: Which is the formula to estimate future growing in a VG

The only two things you need to worry about is "striping" (don't do it without very careful planning - especially if you plan on growing the number of disks in the vg) and the "largefiles" parameter.

I guess I'm confused as to why you think some default parameter has hindered you in adding a disk to your previous vg?

vgcreate vg02 /dev/dsk/c#t#d#

live free or die
harry
Live Free or Die
Honored Contributor
Solution

## Re: Which is the formula to estimate future growing in a VG

Hi

By default the VG will be created with a PE Size of 4MB and a maximum number of physical extents per PV of 1016.
If your first disk added is 36GB then the maximum physical extents will be increased to around 9200.
If you want to add future disks that are bigger than 36GB then you must increase the maximum no of physical extents when creating the Volume Group.

I would use the following:
# vgcreate -s 8 -e 10000 /dev/vg02 /dev/dsk/cXtXdX.

This will set the number of physcial extents to 10000 and a PE size of 8MB, meaning that you can add a disk of up to around 78GB (10000 x 8MB) in size, if necessary.
If for any reason you think you might want to add larger disks, then you need to increase either the PE Size(-s) or the maximum number of phyical extents (-e).

A man on vgcreate will give you more info.

Cheers
Con
Honored Contributor

## Re: Which is the formula to estimate future growing in a VG

Hi,

If you will be adding a larger disk at a later stage you need to ensure max_pe is set sufficiently high to allow for it. You might then have to plan for the optimal extent size. The extent size may affect performance if it is too large but if too small the LVM metadata won't fit in one extent, causing a "file too large" error on your vgcreate. It's calculated using the forumla :

2*(30 + MAX_PE)/1024

I'm not sure if lvm works this out for you these days when specifying the -e option but even if it does it would not be optimised. So, if you want to create a VG that can accomodate the 72GB disk at a later stage the max_pe will need to be 18000 if the default 4MB extent size is taken into consideration. Putting this through the formula results in a value of 35MB for the physical extent size, which will need to be rounded up to a power of 2 so 64MB. However, if we reduce the extent size first we will need less extents to accomadate the larger disk. I did a few tests and found that the likely optimal setting that passes the formula would be an extent size of 16MB and a max_pe of 4608. You have a bit of flexibility in the max_pe figure so maybe set it to 5000 to be safe. The vgcreate command would then be :

# vgcreate -e 5000 -s 16 vg02

Cheers,

James.
Honored Contributor

## Re: Which is the formula to estimate future growing in a VG

If you are interested in how to calculate the exact limits imposed by the static volume group parameters you should have a look at the LVM chapter (16) of the recent Software Recovery Handbook...

http://www.itrc.hp.com/service/iv/node.do?node=prod%2FWW_Start%2FN1%7C16

Hint, hint... there's a new 8.0 version out as of today.

Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)

## Re: Which is the formula to estimate future growing in a VG

Dietmar,

We just buy a contract with HP, but I still don't have the number.

Then, I can't access that document. Is there some other way to get that document?

Thanks

## Re: Which is the formula to estimate future growing in a VG

When you create volume group, it creates each PE of 4MB and the maximum PE per PV is equal to number of PE of the disk with which you create volume group.
If you are creating vg02 with 36GB disk it will create vg02 with PE per PV equal to aprox 9000. If you want to add 72GB disk in future then while creating the volume group use option "-e" and specify the number.
man vgcreate for more details.
IT is great!

## Re: Which is the formula to estimate future growing in a VG

One more question..!!

All this was happend, because the disk sizes are diferent.

But, I have a HVD10 with 4 disk of 36Gb each one, two of these are in use, there are 2 free.

Can I add the other 2 disk without problems, because all have the same size 36Gb, or I have to estimate any grow?
Acclaimed Contributor

## Re: Which is the formula to estimate future growing in a VG

Hi:

Since the physical disk that you want to use to grow your volume group are the same size as the existing ones, you will be able to add them and utilize their full, physical capacity.

The LVM header is fixed during the 'vgcreate' process, and as you now know, this is the only time you have to specify its geometry. When you do a 'vgextend' the header is updated and replicated to all members of the volume group. The 'vgextend' command does not make any provisions for sizing. See the man pages for 'vgcreate' and for 'vgextend' for more information.

Regards!

...JRF...