
Reviewed-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com> On 03/10/2014 02:56 PM, lvroyce@linux.vnet.ibm.com wrote:
From: Royce Lv <lvroyce@linux.vnet.ibm.com>
When creating storage volume, allocation is specified with 0 because previous format is qcow2. As we use raw format in logcial pool now, we need to specify allocation in xml.
Signed-off-by: Royce Lv <lvroyce@linux.vnet.ibm.com> --- src/kimchi/vmtemplate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/kimchi/vmtemplate.py b/src/kimchi/vmtemplate.py index d3bd52e..f227ee6 100644 --- a/src/kimchi/vmtemplate.py +++ b/src/kimchi/vmtemplate.py @@ -211,10 +211,11 @@ class VMTemplate(object): 'format': fmt, 'path': '%s/%s' % (storage_path, volume)}
+ info['allocation'] = 0 if fmt == 'qcow2' else info['capacity'] info['xml'] = """ <volume> <name>%(name)s</name> - <allocation>0</allocation> + <allocation unit="G">%(allocation)s</allocation> <capacity unit="G">%(capacity)s</capacity> <target> <format type='%(format)s'/>
-- Thanks and best regards! Sheldon Feng(冯少合)<shaohef@linux.vnet.ibm.com> IBM Linux Technology Center