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

Shu Ming shuming at linux.vnet.ibm.com
Mon Mar 10 14:47:26 UTC 2014


Reviewed-by: Shu Ming <shuming at linux.vnet.ibm.com>
2014/3/10 14:56, lvroyce at linux.vnet.ibm.com:
> 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'/>




More information about the Kimchi-devel mailing list