Adds flag for enabling the creation of a disk partition

Change-Id: Id667208d1516031c770de830580afdf0176791de
This commit is contained in:
Paul Marshall 2014-03-06 11:12:53 -06:00
parent 0b10385183
commit 64914dacff
1 changed files with 10 additions and 4 deletions

View File

@ -34,12 +34,17 @@ import re
import time
CONF = cfg.CONF
CONF.register_opt(
CONF.register_opts([
cfg.IntOpt('ovz_volume_settle_num_tries',
default=10,
help='Number of attempts before we determine that a device '
'has had time to settle and we are beyond a reasonable '
'wait time'))
'wait time'),
cfg.BoolOpt('ovz_create_disk_partition',
default=False,
help='Create a partition on the volume (if it does not exist) '
'when it is attached to the container'),
])
LOG = logging.getLogger('ovznovadriver.openvz.volume')
@ -266,8 +271,9 @@ class OVZVolume(object):
:return:
"""
LOG.debug(_('Partitioning disk in _attach_raw_devices'))
self._partition_disk()
if CONF.ovz_create_disk_partition:
LOG.debug(_('Partitioning disk in _attach_raw_devices'))
self._partition_disk()
# storage for block device major/minor pairs for setting in
# the container config file.