[pve-devel] create snapshots

Alexandre DERUMIER aderumier at odiso.com
Fri Aug 31 13:05:10 CEST 2012


>>I wonder it is would be safe to call an external script to create the snapshot there? 
>>Or is there still some data in the qemu block driver cache, or the host cache? 
yes, I think taking snapshot don't flush datas. 
rbd devs said me that we need to freeze the filesystem with qemu-ga if we want to be sure that's all is fine.
(Or filesystem will do a fsck at start to correct the missing data with his journal).

But if we save the state, that's not a problem, as the vm will save the missings data in the memory and will flush them when the vm will reload the state.


----- Mail original ----- 

De: "Dietmar Maurer" <dietmar at proxmox.com> 
À: pve-devel at pve.proxmox.com 
Envoyé: Vendredi 31 Août 2012 12:51:04 
Objet: [pve-devel] create snapshots 



I just looked at savevm, and that is relatively simple code: 

qemu-kvm/savevm.c: do_savevm() 

1.) check if all disk support snapshots (call bdrv_can_snapshot()) 
2.) vm_stop(RUN_STATE_SAVE_VM) 
3.) Delete old snapshots of the same name 
4.) save the VM state 
5.) create the snapshots (call bdrv_snapshot_create()) 
6.) resstart vm 

For me, the interesting part is point 5, the call to bdrv_snapshot_create(), 
which is defined in qemu-kvm/block.c: 

int bdrv_snapshot_create(BlockDriverState *bs, 
QEMUSnapshotInfo *sn_info) 
{ 
BlockDriver *drv = bs->drv; 
if (!drv) 
return -ENOMEDIUM; 
if (drv->bdrv_snapshot_create) 
return drv->bdrv_snapshot_create(bs, sn_info); 
if (bs->file) 
return bdrv_snapshot_create(bs->file, sn_info); 
return -ENOTSUP; 
} 

I wonder it is would be safe to call an external script to create the snapshot there? 
Or is there still some data in the qemu block driver cache, or the host cache? 

I guess I should ask that on the qemu-devel list instead? 



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



-- 

-- 



	

Alexandre D e rumier 

Ingénieur Systèmes et Réseaux 


Fixe : 03 20 68 88 85 

Fax : 03 20 68 90 88 


45 Bvd du Général Leclerc 59100 Roubaix 
12 rue Marivaux 75002 Paris 



More information about the pve-devel mailing list