Re: creating a domain

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 10, 2012 at 12:00:17PM +0300, Henrik Ahlgren wrote:
> On Wed, May 09, 2012 at 02:26:47PM -0700, John Wayne wrote:
> > looks like i have to use virDomain.create, however virDomain.create
> > needs a defined domain xmldesc as a parameter and i am not sure on how to get that
> 
> Have you tried one of these?
> 
>   lookupByID(self, id)
>       Try to find a domain based on the hypervisor ID number
>       Note that this won't work for inactive domains which have
>       an ID of -1,
>       in that case a lookup based on the Name or UUId need to be
>       done instead.
>   
>   lookupByName(self, name)
>       Try to lookup a domain on the given hypervisor based on
>       its name.
>   
>   lookupByUUID(self, uuid)
>       Try to lookup a domain on the given hypervisor based on
>       its UUID.
>   
>   lookupByUUIDString(self, uuidstr)
>       Try to lookup a domain on the given hypervisor based on
>       its UUID.

Quick python tip... you can get a list of valid APIs from the
interpretor:

$ python
import libvirt
print dir(libvirt)
...snip output...
conn = libvirt.open("qemu:///session")
print dir(conn)
...snip output...
print help(conn.lookupByID)
...snip output...

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

_______________________________________________
libvirt-users mailing list
libvirt-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvirt-users


[Index of Archives]     [Virt Tools]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux