[pve-devel] [PATCH qemu-server] Fix #1242 : clone_disk : call qga fstrim after clone

Alexandre DERUMIER aderumier at odiso.com
Tue May 29 15:35:06 CEST 2018


>>On the other hand, as this is a work-around for the underlying problem, 
>>of qemu mirror not being able to detect zeros in data. Might it not be 
>>easier to throw in an API call afterwards that does the fstrim? Would be 
>>less to think about and maintain, till qemu can do it out-of-the-box. 

>># pvesh create /nodes/{node}/qemu/{vmid}/agent/fstrim 
>>or by hand 
>># qm agent <vmid> fstrim 

>>I assume, there are only two use cases with fstrim: 

>>*) many machines, clones and migrations 
>>In this case, there is for sure some automation going on and the 
>>user would call the API after each action taken. This way the fstrim 
>>can be run controlled (eg. monitor IO load). 


Sometime, I'm doing a lot of move disk in parallel, waiting some minutes/hours to finish.
for this case, it's a lot simplier to have the fstrim done automaticaly just after the move.
(could be an option in the move disk api ?)


>>*) few machines, seldom cloning or migration 
>>Here the user would do manual run of the command or has a small 
>>script inside/outside the VM that runs the fstrim. 

for this case, I think that a simple "fstrim" button in the gui could be enough.








----- Mail original -----
De: "Alwin Antreich" <a.antreich at proxmox.com>
À: "pve-devel" <pve-devel at pve.proxmox.com>
Envoyé: Mardi 29 Mai 2018 14:03:09
Objet: Re: [pve-devel] [PATCH qemu-server] Fix #1242 : clone_disk : call qga fstrim after clone

On Tue, May 29, 2018 at 10:02:45AM +0200, Alexandre DERUMIER wrote: 
> >>I would think, the best is to have it in the vmid.conf itself, as maybe there 
> >>is one VM where I want to have flat images (eg. DB server) and not for the 
> >>rest. 
> 
> But I think that if user want flat image, it'll not use the discard option for disk ? 
> (so fstrim don't do nothing) 
True. 

> 
> 
> I think we need an explicit option like "do fstrim or not after clone disk", more like if user don't want fstrim overhead 
> on the storage. 
With the above in mind the storage.cfg sounds to me as the better place. 

On the other hand, as this is a work-around for the underlying problem, 
of qemu mirror not being able to detect zeros in data. Might it not be 
easier to throw in an API call afterwards that does the fstrim? Would be 
less to think about and maintain, till qemu can do it out-of-the-box. 

# pvesh create /nodes/{node}/qemu/{vmid}/agent/fstrim 
or by hand 
# qm agent <vmid> fstrim 

I assume, there are only two use cases with fstrim: 

*) many machines, clones and migrations 
In this case, there is for sure some automation going on and the 
user would call the API after each action taken. This way the fstrim 
can be run controlled (eg. monitor IO load). 

*) few machines, seldom cloning or migration 
Here the user would do manual run of the command or has a small 
script inside/outside the VM that runs the fstrim. 


_______________________________________________ 
pve-devel mailing list 
pve-devel at pve.proxmox.com 
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel 



More information about the pve-devel mailing list