[Kimchi-devel] [PATCHv2] Allocate enough space for logical volume

lvroyce at linux.vnet.ibm.com lvroyce at linux.vnet.ibm.com
Mon Mar 10 06:56:57 UTC 2014


From: Royce Lv <lvroyce at 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 at 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'/>
-- 
1.8.1.2




More information about the Kimchi-devel mailing list