summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorJesse Andrews <jesse@aire.local>2011-04-13 11:31:28 -0500
committerJesse Andrews <jesse@aire.local>2011-04-13 11:31:28 -0500
commit899e6607086f6df9442f588aae4f3c37367e696d (patch)
tree3526c4c73968f1b607b6f73758ee4369ce70c668 /nova
parent822ec6fe3075bed4479c8e48a984bd4c9622ffe1 (diff)
re-add broken code
Diffstat (limited to 'nova')
-rw-r--r--nova/volume/driver.py10
-rw-r--r--nova/volume/san.py10
2 files changed, 16 insertions, 4 deletions
diff --git a/nova/volume/driver.py b/nova/volume/driver.py
index 6d86f193f..15b6b550b 100644
--- a/nova/volume/driver.py
+++ b/nova/volume/driver.py
@@ -93,7 +93,10 @@ class VolumeDriver(object):
def create_volume(self, volume):
"""Creates a logical volume. Can optionally return a Dictionary of
changes to the volume object to be persisted."""
- sizestr = '%sG' % volume['size']
+ if int(volume['size']) == 0:
+ sizestr = '100M'
+ else:
+ sizestr = '%sG' % volume['size']
self._try_execute('sudo', 'lvcreate', '-L', sizestr, '-n',
volume['name'],
FLAGS.volume_group)
@@ -599,7 +602,10 @@ class SheepdogDriver(VolumeDriver):
def create_volume(self, volume):
"""Creates a sheepdog volume"""
- sizestr = '%sG' % volume['size']
+ if int(volume['size']) == 0:
+ sizestr = '100M'
+ else:
+ sizestr = '%sG' % volume['size']
self._try_execute('qemu-img', 'create',
"sheepdog:%s" % volume['name'],
sizestr)
diff --git a/nova/volume/san.py b/nova/volume/san.py
index dd332de1a..9532c8116 100644
--- a/nova/volume/san.py
+++ b/nova/volume/san.py
@@ -219,7 +219,10 @@ class SolarisISCSIDriver(SanISCSIDriver):
def create_volume(self, volume):
"""Creates a volume."""
- sizestr = '%sG' % volume['size']
+ if int(volume['size']) == 0:
+ sizestr = '100M'
+ else:
+ sizestr = '%sG' % volume['size']
zfs_poolname = self._build_zfs_poolname(volume)
@@ -486,7 +489,10 @@ class HpSanISCSIDriver(SanISCSIDriver):
#TODO(justinsb): Should we default to inheriting thinProvision?
cliq_args['thinProvision'] = '1' if FLAGS.san_thin_provision else '0'
cliq_args['volumeName'] = volume['name']
- cliq_args['size'] = '%sGB' % volume['size']
+ if int(volume['size']) == 0:
+ cliq_args['size'] = '100MB'
+ else:
+ cliq_args['size'] = '%sGB' % volume['size']
self._cliq_run_xml("createVolume", cliq_args)