From 0995a924dcec4c2b62aa82b1837c5a992548e94c Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 9 Aug 2013 10:30:58 -0400 Subject: [PATCH] Do sparse allocation for non-lvm raw format images --- xCAT-server/lib/xcat/plugins/kvm.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index 2c52ffb1e..53d7568ef 100644 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -278,7 +278,9 @@ sub get_filepath_by_url { #at the end of the day, the libvirt storage api gives my $create = $args{create}; my $force = $args{force}; my $format = $args{format}; + my $sparse = 1; if ($url =~ /^lvm:/) { + $sparse = 0; $format = 'raw'; } unless ($format) { @@ -327,7 +329,7 @@ sub get_filepath_by_url { #at the end of the day, the libvirt storage api gives # additionally, when mastering a powered down node, we should rebase the node to be a cow clone of the master it just spawned } else { my $vol; - if ($format eq 'raw') { #skip allocation specification for now + unless ($sparse) { #skip allocation specification for now #currently, LV can have reduced allocation, but *cannot* grow..... $vol = $poolobj->create_volume("".$desiredname."".getUnits($create,"G",1).""); } else {