[openstack-dev] [fuel][nailgun][volume-manager][fuel-agent] lvm metadata size value. why was it set to 64M?
agordeev at mirantis.com
Wed Feb 17 17:51:01 UTC 2016
Apparently, nailgun assumes that lvm metadata size is always set to 64M 
It seems that it was defined here since the early beginning of nailgun as a
project, therefore it's impossible to figure out for what purposes that was
done as early commit messages are not so informative.
According to the documentation (man lvm.conf):
pvmetadatasize — Approximate number of sectors to set aside
for each copy of the metadata. Volume groups with large numbers of
physical or logical volumes, or volumes groups containing complex
logical volume structures will need additional space for their metadata.
The metadata areas are treated as circular buffers, so unused space becomes
filled with an archive of the most recent previous versions of the metadata.
The default value is set to 255 sectors. (128KiB)
Quotation from particular lvm.conf sample:
# Approximate default size of on-disk metadata areas in sectors.
# You should increase this if you have large volume groups or
# you want to retain a large on-disk history of your metadata changes.
# pvmetadatasize = 255
nailgun's volume manager calculates sizes of logical volumes within one
physical volume group and takes into account the size of lvm metadata .
However, due to logical volumes size gets rounded to the nearest multiple
of PE size (which is 4M usually), fuel-agent always ends up with the lack
of free space when creating logical volumes exactly in accordance with
partitioning scheme is generated by volume manager.
Thus, tricky logic was added into fuel-agent  to bypass that flaw. Since
64M is way too big value when compared with typical one, fuel-agent
silently reduces the size of lvm metadata by 8M and then partitioning
always goes smooth.
Consequently, almost each physical volume group remains only 4M of free
space. It worked fine on old good HDDs.
But when the time comes to use any FC/HBA/HW RAID block storage device
which is occasionally reporting relatively huge values for minimal io size
and optimal io size exposed in sysfs, then fuel-agent might end up with the
lack of free space once again due to logical volume alignments within
physical volume group . Those alignments have been done by LVM
automatically with respect to those values 
As I'm going to trade off some portion of reserved amount of disk space for
storing lvm metadata for the sake of logical volume alignments, here're the
* why was lvm metadata set to 64M?
* could someone shed more light on any obvious reasons/needs hidden behind
* what is the minimal size of lvm metadata we'll be happy with?
* the same question for the optimal size.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the OpenStack-dev