Bug 498750 - RFE: Add a 'managed' save/restore/snapshot libvirt API
RFE: Add a 'managed' save/restore/snapshot libvirt API
Status: CLOSED CURRENTRELEASE
Product: Virtualization Tools
Classification: Community
Component: libvirt (Show other bugs)
unspecified
All Linux
low Severity medium
: ---
: ---
Assigned To: Chris Lalancette
:
: 479857 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-02 15:03 EDT by Kevin Fenzi
Modified: 2010-04-14 10:59 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-04-14 10:59:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
avc denials (12.31 KB, text/plain)
2009-05-04 12:03 EDT, Kevin Fenzi
no flags Details
lucius.xml file (1.38 KB, text/plain)
2009-05-04 12:05 EDT, Kevin Fenzi
no flags Details

  None (edit)
Description Kevin Fenzi 2009-05-02 15:03:14 EDT
virsh restore doesn't seem to work. 

I do a save to a file, that completes, shuts down the kvm guest and saves the file. 
Doing a restore gives:

[root@theleb libvirt]# virsh restore /var/lib/libvirt/test-snap-20090502 
error: Failed to restore domain from /var/lib/libvirt/test-snap-20090502
error: operation failed: failed to start VM

libvirt-0.6.2-3.fc11.x86_64
kvm guests

Happy to test or provide more info. 

Also, as a side note, the virt-manager doesn't seem to have a restore option, only save.
Comment 1 Mark McLoughlin 2009-05-04 11:43:02 EDT
Kevin - could you attach /var/log/libvirt/qemu/test-snap-20090502.log ? Also, any AVCs ? Please also attach the guests XML config
Comment 2 Kevin Fenzi 2009-05-04 12:02:15 EDT
Well, there is no /var/log/libvirt/qemu/test-snap-20090502.log file. ;( 
The name of the guest was "lucius", but the lucius.log file there is empty. ;( 

Ah, I do see avcs however. Will attach them. 

I tried another restore after 'setenforce 0' and got the same error. 
This time there is something in the lucius.log file however: 

stop
qemu_popen: returning result of qemu_fopen_ops
migrate "exec:dd of='/tmp/testsave' oflag=append conv=notrunc 2>/dev/null"
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin /usr/bin/qemu-kvm -S -M pc -m 512 -smp 2 -name lucius -uuid e25534db-201a-f519-7445-e7e187ab02e1 -monitor pty -pidfile /var/run/libvirt/qemu//lucius.pid -boot c -drive file=,if=ide,media=cdrom,index=2 -drive file=/var/lib/libvirt/images/lucius-2.img,if=virtio,index=0,boot=on -drive file=/var/lib/libvirt/images/extra-f10.img,if=virtio,index=1 -net nic,macaddr=54:52:00:3c:97:9e,vlan=0,model=virtio -net tap,fd=22,script=,vlan=0,ifname=vnet2 -serial pty -parallel none -usb -vnc 127.0.0.1:2 -k en-us 
char device redirected to /dev/pts/4
char device redirected to /dev/pts/5
info cpus
* CPU #0: pc=0x00000000000ffff0 thread_id=15442
  CPU #1: pc=0x00000000000ffff0 thread_id=15444
cont
balloon 512
system_powerdown
info balloon
balloon: actual=512
Comment 3 Kevin Fenzi 2009-05-04 12:03:49 EDT
Created attachment 342326 [details]
avc denials

avc denials
Comment 4 Kevin Fenzi 2009-05-04 12:05:03 EDT
Created attachment 342327 [details]
lucius.xml file
Comment 5 Daniel Walsh 2009-05-06 11:48:47 EDT
I believe this is a bug, and users should not be allowed to specify where the snapshot is going to be stored.

For example kevin specified to have libvirt write data to /tmp and then have qemu_t append to it?  Not even shore if qemu_t is actually trying to append or is this a leaked file descriptor?
Comment 6 Daniel Berrange 2009-05-06 11:56:55 EDT
While libvirt allows arbitrary file paths, this can't be expected to work with SELinux enforcing. 

In the future we have plans for a 'managed'  save/restore/snapshot API, where libvirtd decides where the files are stored, and not the user. In the meantime, users running SELinux should expect to use a path known to SELinux policy, like /var/lib/libvirt/qemu
Comment 7 Mark McLoughlin 2009-05-11 06:51:06 EDT
Moving to upstream libvirt tracker, then
Comment 8 Daniel Berrange 2009-05-12 16:31:23 EDT
*** Bug 479857 has been marked as a duplicate of this bug. ***
Comment 9 Daniel Berrange 2009-08-06 08:51:02 EDT
cf, this idea upstream

http://www.redhat.com/archives/libvir-list/2009-March/msg00205.html
Comment 10 Chris Lalancette 2010-03-12 09:48:54 EST
I've started work on this, though I still have a ways to go.

Chris Lalancette
Comment 11 Chris Lalancette 2010-04-06 13:20:02 EDT
DV ended up doing this as a separate interface, and it went in upstream.  Moving to POST.

Chris Lalancette
Comment 12 Chris Lalancette 2010-04-14 10:59:54 EDT
This was released as part of 0.8.0, so I'll close this out as CURRENTRELEASE.

Chris Lalancette

Note You need to log in before you can comment on or make changes to this bug.