search for: lookupbyid

Displaying 17 results from an estimated 17 matches for "lookupbyid".

2011 Feb 09
1
How to use Python Binding with Lbivirt.
...ed information. Here is my simple code: #!/*usr*/local/bin/*python * import libvirt import sys conn = libvirt.openReadOnly(None) if conn == None: print *'Failed to open connection to the hypervisor' * sys.exit(1) try: domIds = conn.listDomainsID() for id in domIds: dom0 = conn.lookupByID(id) dom0.info() print *"Domain 0: id %d running %s"* % (dom0.ID(), dom0.OSType()) print dom0.info() except: print *'Failed to find the main domain' * sys.exit() The output is : Domain 0: id 2 running hvm [1, 131072L, 131072L, 1, 14921710000000L] Domain 0: id 3 running hvm [...
2012 Mar 06
1
[help] how can I use libvirt to get cpu usage ratio ?
hi experts: I am a freshman of libvirt, I have got a domU's info like: libvirt.open, lookupByID, info. But now I want to use libvirt to get a xen domU 's cpu usage ratio , how can I fulfill it ? I cannot find the API. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120306/808a55aa...
2012 May 05
1
printing domain information
how do i print the features of a domain from functions that return a domain object? for instance mydomain =?virdomain=libvirt.virConnect.lookupByID(conn,domainid) so mydomain is?virDomainPtr, which is?typedef virDomain * virDomainPtr i am not sure on how to print the domain object features in python, such as name, disk size, etc
2010 Dec 17
1
libvirt unavailable while a VM is in migration?
Hi, I am running libvirt 0.8.6 on qemu (kvm, really) 0.12.5. I have noticed that while a live migration is running, I cannot do anything else with libvirt -- even 'virsh list' blocks without output until the migration is almost done. (At that point 'virsh list' will dump a final screen showing the VM I just migrated as 'running'; the next run of 'virsh
2011 Feb 10
0
How to retrieve Memory stat of the KVM using python binding with Libvirt API
...I have written for this, is : #!/usr/local/bin/python import libvirt import sys conn = libvirt.openReadOnly(None) if conn == None: print "Failed to open connection to the hypervisor" sys.exit(1) try: domIds = conn.listDomainsID() for id in domIds: dom0 = conn.lookupByID(id) try: print "memory stats: %s"% dom0.memoryStats().values() except: print 'Failed to find the memory data of this domain' sys.exit(1) except: print 'Failed to find the main domain' sys.exit(1) But this co...
2011 Sep 13
1
cpu time totals
...when summed, should equal the total cpu usage of the domain, but there is quite a large gap between them. Is there something I'm missing? See this example code using the python bindings: >>> import libvirt >>> c = libvirt.open('qemu:///system') >>> d = c.lookupByID(51) >>> d.info()[4] 111390000000L >>> d.vcpus()[0] [(0, 1, 12720000000L, 1), (1, 1, 2980000000L, 0), (2, 1, 3150000000L, 1), (3, 1, 2600000000L, 0)] >>> sum([vcpu[2] for vcpu in d.vcpus()[0]]) 21520000000L >>> d.info()[4] - sum([vcpu[2] for vcpu in d.vcpus()[0]])...
2012 Feb 10
1
Unable to collect VM metrics for ESX using libvirt
...metrics like cpu usage, network and disk iops. I am able to establish the connection successfully and obtain VM information such as ids, domain names, config xml etc. But I am unable to collect statistics. I am using the python interface and if I do , conn=libvirt.openAuth(uri, auth, 0) dom-conn.lookupByID(id) // Where id is the domain id of the vms netstats=dom.interfaceStats(interface) gives an error libvirt.libvirtError: this function is not supported by the connection driver: virDomainInterfaceStats The same goes for block stats. For the cpu, I used, cpu=dom.info()[4] but, that always return...
2013 Jul 08
1
python equiv to perl list_domains()
Hey, I'm trying to figure out a way to get a list of the running domains on a dom0. I can get the ID's but I'd prefer the names. We have another script written in perl, but I'm trying to get some other functionality in python as well as work on converting it all to python. It looks like perl has a list_domains() that will, according to the libvirt doc, "Return a list of all
2012 May 09
3
creating a domain
hi, i am a bit confused on how to start an inactive domain using the python bindings, any help would be appreciated. (inactive as in the domain was created with?virConnect.defineXML sometime in the past) 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 i guess if?virConnect.create was
2012 Jan 24
1
[Problem] C# virDomainShutdown
...D. Fonk -- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de -------------- next part -------------- foreach (int runningDomainID in runningDomainIDs) { IntPtr domainPtr = Domain.LookupByID(conn, runningDomainID); if (domainPtr == IntPtr.Zero) { MessageBox.Show("Unable to lookup domains by id", "Lookup domain failed", MessageBoxButtons.OK, MessageBoxIcon.Error);...
2013 Sep 25
2
Collecting system stats
Hi, I am trying to create a report across all my KVM hypervisors using libvirt API and I need some assistance in figuring out the right API calls. My report will contain the total available memory, CPU, disk across all hypervisors, versus the amount used by the virtual machines. This report will help figure out if we are running low on hypervisor disk, CPU or memory and if we need to add more. I
2009 Aug 31
1
Fixed patch...
This version of the patch includes feedback from jboggs at redhat.com, including fixes to the BuildRequires and Requires in the spec file.
2009 Sep 11
1
Text-based node administration tool
This patch obsoletes any previous ones. This is an upstream candidate, so I'm looking for feedback so we can push this and start using it.
2009 Sep 14
1
Bugfixes...
This version fixes a few bugs found by jboggs. It also includes some logging facilities that need to be fleshed out more.
2009 Sep 16
1
Final push candidate for nodeadmin tool...
This patch is ready for pushing upstream.
2009 Sep 16
1
Replacement that includes utils.py
The previous patch was missing this file. Resending.
2009 Jul 31
2
RFC: This patch is not being submitted for ACK...
...just looking for some feedback on the direction I'm going. The code won't get all the way to the define stage since I'm in the middle of retrofitting it to use virtinst instead of a home spun node definition.