[pve-devel] [PATCH] qemu-img convert : use default cache=unsafe instead writeback
Eneko Lacunza
elacunza at binovo.es
Mon Aug 1 09:42:42 CEST 2016
El 01/08/16 a las 09:26, Dominik Csapak escribió:
> On 08/01/2016 08:51 AM, Alexandre Derumier wrote:
>> Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
>> ---
>> PVE/QemuServer.pm | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
>> index 7778fb8..2414fd8 100644
>> --- a/PVE/QemuServer.pm
>> +++ b/PVE/QemuServer.pm
>> @@ -5605,7 +5605,7 @@ sub qemu_img_convert {
>> my $dst_path = PVE::Storage::path($storecfg, $dst_volid);
>>
>> my $cmd = [];
>> - push @$cmd, '/usr/bin/qemu-img', 'convert', '-t', 'writeback',
>> '-p', '-n';
>> + push @$cmd, '/usr/bin/qemu-img', 'convert', '-p', '-n';
>> push @$cmd, '-s', $snapname if($snapname && $src_format eq
>> "qcow2");
>> push @$cmd, '-f', $src_format, '-O', $dst_format, $src_path;
>> if ($is_zero_initialized) {
>>
>
> is this really safe?
>
> this also impacts cloning and the "move disk" function.
> what if i clone a vm to an nfs share and immediately move the vm to
> another host, then start it?
From QEMU doc:
"
In case you don’t care about data integrity over host failures, use
cache=unsafe. This option tells QEMU that it never needs to write any
data to the disk but can instead keep things in cache. If anything goes
wrong, like your host losing power, the disk storage getting
disconnected accidentally, etc. your image will most probably be
rendered unusable. When using the -snapshot option, unsafe caching is
always used.
"
Disks are close before command ends; this means all operations (writes)
on them will be completed before more commands on the VM can be done?
--
Zuzendari Teknikoa / Director Técnico
Binovo IT Human Project, S.L.
Telf. 943493611
943324914
Astigarraga bidea 2, planta 6 dcha., ofi. 3-2; 20180 Oiartzun (Gipuzkoa)
www.binovo.es
More information about the pve-devel
mailing list