[libvirt-users] snapshot troubles

Eric Blake eblake at redhat.com
Tue Jan 22 21:36:37 UTC 2013


On 01/22/2013 09:27 AM, jurgen.depicker at let.be wrote:
>> What version of libvirt are you using?  And is this within the virsh
>> batch mode, or from the command line?
> root at VLET3:~# virsh --version
> 0.8.3

That explains it.  Older virsh had lousy command line handling.

> root at VLET3:~# virsh echo two  spaces
> error: unknown command: 'echo'

Yep, I added the 'virsh echo' command when I fixed command line parsing.

Meanwhile, you don't have to use virsh.  You could write your own C
program that directly calls virDomainSnapshotDelete() from libvirt.so,
or you could use python bindings.  I'm not a python whiz, but I think it
would probably be something like:

$ python
>>> import libvirt
>>> conn = libvirt.open(None)
>>> dom = conn.lookupByName("DOMINO1-prealloc")
>>> snap = dom.snapshotLookupByName("W2K3-virgin install", 0)
>>> snap.delete(0)
>>> quit()

> 
> So, or I pray that my 20G remaining will suffice for one more month, or 
> maybe someone knows how to rename a snapshot, or edit some config file 
> where that name is configured?

Just because virsh command-line parsing is lousy doesn't mean that the
underlying APIs won't work - you just have to get at them from somewhere
other than virsh.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20130122/c5c88556/attachment.sig>


More information about the libvirt-users mailing list