Why aren't my partitions the size I expect?

Created by Mark T. Voelker
Keywords:
disk cinder-volme partitioning partition
Last updated by:
Mark T. Voelker

The user.common.yaml file in Cisco OpenStack Installer versions h.0 and newer includes a few settings that allow you to manipulate disk sizing:

#### Disk partitioning options ###########
# The /var directory is where logfiles and instance data are stored
# on disk. If you wish to have /var on it's own partition (considered
# a best practice), set enable_var to true.
enable_var: true

# The Cinder volume service can make use of unallocated space within
# the "cinder-volumes" volume group to create iscsi volumes for
# export to instances. If you wish to leave free space for volumes
# and not preallocate the entire install drive, set enable_vol_space
# to true.
enable_vol_space: true

# Use the following two directives to set the size of the / and /var
# partitions, respectively. The var_part_size directive will be ignored
# if enable_var is not set to true above.
root_part_size: 65536
var_part_size: 432000

When using these options, the installer sets up an LVM volume group called "cinder-volumes" and creates individual logical volumes within it. A common use for these settings is allowing users to set aside free space within the cinder-volumes VG, which can later be exported via iSCSI for use in creating block storage volumes with Cinder.

Some users have reported being surprised when they enable these options, but find that after the machine is provisioned they only have a 4GB cinder-volumes VG, which is created on a loopback device instead of real disk. Other partitions won't be sized as expected either.

The usual cause for this is a behavior of the Ubuntu installer when used with an "expert recipe" for partitioning disks with preseeding: if the total space needed to create the partition scheme requested exceeds the actual amount of disk space available, the Ubuntu installer simply reverts to a default partitioning scheme and continues the installation rather than throwing an error and halting the install. If this happens, you'll find a message in the /var/log/installer/syslog file once the provisioning is complete that looks something like this (the numbers may be different depending on your system and settings):

root@compute-server01:/var/log/installer# grep 'too small' syslog
Feb 24 19:31:06 partman-auto: Available disk space (72999) too small for expert recipe (499795); skipping
root@compute-server01:/var/log/installer#

The 4GB loopback volume is created by the cinder::setup_test_volume class, which creates a 4GB loopback volume and a VG named cinder-volumes as a means of testing that the Cinder service works properly. If a VG named cinder-volumes already exists (as would be the case if the disk had ample enough space to accommodate the desired partitioning scheme), the class had no effect.

If you encounter this situation, the best solution is to adjust the partitioning scheme to match the size of the disk you have available and reprovision the node. You can do so by doing the following:

1.) Adjust the parameters above to fit your disk.
2.) Run "puppet apply -v /etc/puppet/manifests/site.pp" to push the changes into Cobbler's profiles.
3.) Run "/root/puppet_openstack_builder/scripts/clean_node.sh [name of server]" to reboot the node and begin the bare metal provisioning process again.