[libvirt-users] Snapshots - can't take a snapshot with running VM

Hi I'm quite new to KVM/libvirt0 so hope you can help I'm using Ubuntu Lucid 10.04 and libvirt0 0.8.1 When I try a :- snapshot create vm_name I get an error, ie 'error -5 while writing' Googling doesnt bring anything up. Taking snapshots of a vm when it isnt running works fine. Can I really only create snapshots of a vm when it isnt running ? -- Kind regards Julian

On 06/15/10 - 01:11:53PM, Julian Robbins wrote:
Hi
I'm quite new to KVM/libvirt0 so hope you can help
I'm using Ubuntu Lucid 10.04 and libvirt0 0.8.1
When I try a :-
snapshot create vm_name
I get an error, ie 'error -5 while writing'
Googling doesnt bring anything up. Taking snapshots of a vm when it isnt running works fine.
Can I really only create snapshots of a vm when it isnt running ?
No, you should be able to take a snapshot both while it is running and while it is off. However, they use different mechanisms so there could be a bug in the online version. What version of qemu/kvm are you running? Also, do you have apparmor enabled/running? If so, and if the apparmor policy hasn't been updated, that might be the source of your problems. -- Chris Lalancette

Can I really only create snapshots of a vm when it isnt running ?
No, you should be able to take a snapshot both while it is running and while it is off. However, they use different mechanisms so there could be a bug in the online version. What version of qemu/kvm are you running? Also, do you have apparmor enabled/running? If so, and if the apparmor policy hasn't been updated, that might be the source of your problems.
Thanks for your reply. Oddly, I didnt receive an email to me, but only in the archives ! I've disabled AppArmor for now and it works fine, so there is some unwanted issue there. Strangely, looking again apparmor is still enabled when guest is running after reboot. Possibly rebooting the guest and using dynamic appamor instead of static has helped ? I'm using vers 1.84 of QEMU/Kvm from dnjl's PPA for Lucid. -- Kind regards Julian

On 15/06/10 17:53, Julian Robbins wrote:
Can I really only create snapshots of a vm when it isnt running ? No, you should be able to take a snapshot both while it is running and while it is off. However, they use different mechanisms so there could be a bug in the online version. What version of qemu/kvm are you running? Also, do you have apparmor enabled/running? If so, and if the apparmor policy hasn't been updated, that might be the source of your problems.
I've disabled AppArmor for now and it works fine, so there is some unwanted issue there. Strangely, looking again apparmor is still enabled when guest is running after reboot. Possibly rebooting the guest and using dynamic appamor instead of static has helped ?
I'm using vers 1.84 of QEMU/Kvm from dnjl's PPA for Lucid.
After trying again, I can no longer get snapshots to work whilst vm guest in running. I have disabled apparmor so that it is only in 'complain' mode on the host, but still get :- Error -5 while writing VM whilst trying a virsh # snapshot-create openerp Whether running virsh as normal user or root. I'm also getting 'libvirtError: Timed out during operation: cannot acquirestate change lock' errors too, after I've tried to take a snapshot. So it appears that perhaps there is a bug where snapshots cannot always be made online. I have taken some successful snapshots online, but none recently. Interestingly, I can never get the 'Security' setting in the guest to stick to be 'none' for the apparmor Model either static or dynamic. Even after a reboot of the guest, the setting stays always to dynamic. Hoping someone can help - don't want to leave using KVM/libvirt ..... -- Kind regards Julian

On 17/06/10 11:40, Julian Robbins wrote:
On 15/06/10 17:53, Julian Robbins wrote:
I'm using vers 1.84 of QEMU/Kvm from dnjl's PPA for Lucid.
After trying again, I can no longer get snapshots to work whilst vm guest in running.
I have disabled apparmor so that it is only in 'complain' mode on the host, but still get :-
Error -5 while writing VM
whilst trying a
virsh # snapshot-create openerp
Whether running virsh as normal user or root. I'm also getting
'libvirtError: Timed out during operation: cannot acquirestate change lock' errors too, after I've tried to take a snapshot.
Apologies after replying to my own post. After applying the latest update of kvm, libvirt etc from Daniel Baumann (dnjl)'s PPA (the one I had been previously using), I noticed a change was related to giving more permission to libvirt relating to access to disk storage when apparmor is running. With this update 0.8.1-2ubuntu1.1~dnjl1~lucid0, snapshots are fine again now. I can create/delete whilst guest is running or shutdown -- Kind regards Julian
participants (2)
-
Chris Lalancette
-
Julian Robbins