[libvirt] 'starting' a domain using Python libvirt..

Daniel P. Berrange berrange at redhat.com
Sun Jul 6 08:33:43 UTC 2008


On Sat, Jul 05, 2008 at 04:31:05PM -0700, Michael March wrote:
> I'm trying to figure out how to start a domain .. and I can't figure out 
> what method to use..
> 
> When I do this:
> 
> >>>  dir(conn.lookupByName('my-vm-1'))
> 
> I get these options:
> 
> ['ID', 'OSType', 'UUID', 'UUIDString', 'XMLDesc', '__del__', '__doc__', 
> '__init__', '__module__', '_conn', '_o', 'attachDevice', 'autostart', 
> 'blockStats', 'connect', 'coreDump', 'create', 'destroy', 
> 'detachDevice', 'info', 'interfaceStats', 'maxMemory', 'maxVcpus', 
> 'migrate', 'name', 'pinVcpu', 'reboot', 'resume', 'save', 
> 'setAutostart', 'setMaxMemory', 'setMemory', 'setVcpus', 'shutdown', 
> 'suspend', 'undefine']
> 
> I don't see a method to start a domain up.. What am I missing here?

You want the create() method which python equiv of virDomainCreate()

http://libvirt.org/html/libvirt-libvirt.html#virDomainCreate

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list