Merge "Devicemapper storage driver need specified volume"

This commit is contained in:
Zuul 2018-06-05 07:19:44 +00:00 committed by Gerrit Code Review
commit 35f6e9069e
2 changed files with 5 additions and 5 deletions

View File

@ -213,8 +213,9 @@ They are loosely grouped as: mandatory, infrastructure, COE specific.
If specified, container images will be stored in a cinder volume of the
specified size in GB. Each cluster node will have a volume attached of
the above size. If not specified, images will be stored in the compute
instance's local disk. For the 'devicemapper' storage driver, the minimum
value is 3GB. For the 'overlay' storage driver, the minimum value is 1GB.
instance's local disk. For the 'devicemapper' storage driver, must specify
volume and the minimum value is 3GB. For the 'overlay' and 'overlay2'
storage driver, the minimum value is 1GB or None(no volume).
This value can be overridden at cluster creation.
--docker-storage-driver \<docker-storage-driver\>

View File

@ -205,11 +205,10 @@ def _enforce_volume_driver_types(cluster_template):
def _enforce_volume_storage_size(cluster_template, cluster):
volume_size = cluster.get('docker_volume_size') \
or cluster_template.get('docker_volume_size')
if not volume_size:
return
storage_driver = cluster_template.get('docker_storage_driver')
if storage_driver == 'devicemapper':
if volume_size < 3:
if not volume_size or volume_size < 3:
raise exception.InvalidParameterValue(
'docker volume size %s GB is not valid, '
'expecting minimum value 3GB for %s storage '