Displaying 20 results from an estimated 38 matches for "lookupbyname".
2008 Aug 25
1
virt-install error: "virDomainLookupByName() failed got unknown HTTP error code 400"
...Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/create.py", line 294, in forward
if(self.validate(notebook.get_current_page()) != True):
File "/usr/share/virt-manager/virtManager/create.py", line 974, in validate
vm = self.connection.vmm.lookupByName(name)
File "/usr/lib64/python2.4/site-packages/libvirt.py", line 646, in lookupByName
if ret is None:raise libvirtError('virDomainLookupByName() failed', conn=self)
libvirtError: virDomainLookupByName() failed got unknown HTTP error code 400
None
There was also a lot of t...
2012 Jan 11
1
Unable to close open libvirt connections
...of|grep ESTABLISHED in the HOST),
the count will increase by 1
conn.close()
*//the count will decrease by 1, it returns 0*
~~~~
conn=libvirt.openReadOnly("qemu+ssh://HOST_IP/system<http://10.16.71.1/system>
")
//now check the no. of connections, the count will increase by 1
dom=conn.lookupByName("sowmya")
print dom.info()
conn.close()
*//the count will not change, it returns 1*
*
*
This is creating a lot of trouble to me but the reason is unknown.
If someone could please point me out, if i am missing something.
--
Jatin
-------------- next part --------------
An HTML attachment w...
2010 Dec 13
1
libvirt printing to stderr
I'm writing an app and using the Python bindings for libvirt.
Everything is fine but, in some cases I need to call lookupByName().
There are a lot of times when the name will not exist, I trap the
exception, however I still get this message printed to stderr:
libvir: QEMU error : Domain not found: no domain with matching name
'foo'
Is there any way to turn this off? This is a command-line program so
the extra out...
2017 Aug 07
1
Avoiding console prints by Libvirt Qemu python APIs
Hi,
I am trying to check if a domain exists by using the libvirt python API
*"lookupbyname()*". If the domain does not exist, it prints an error
message on the console saying "*Domain not found*".
I need the errors or logs only in syslog. I have tried redirecting stderr
and stdout. But, it doesn't have any effect. I have also tried playing
around with the libvirt logg...
2015 Nov 26
2
New vs old API usages
Hi,
Currently I am using the latest libvirt API listAllDomains() to probe for domains.
I may need to fall back to older API for old libvirt server such as: listDefinedDomains() and lookupByName()
instead of listAllDomains().
Is there any disadvantage to using listAllDomains instead of listAllDomains
or its the same results via different API?
Thank you,
Shahar.
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
2018 Mar 20
2
About libvirt domain snapshot problem(for single disk snapshot)
...sk3
-rw-------. 1 qemu qemu 704K 3月 20 23:52 /opt/Images/8d582c1c-355a-4297-9434-2f2f562c77df.sys_disk3
```
2、
``` python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import libvirt
import libvirt_qemu
import json
import sys
name = sys.argv[1]
print name
conn = libvirt.open()
dom = conn.lookupByName(name)
xml = """
<domainsnapshot>
<name>sysdisk_by_xml</name>
<description>By xml</description>
<disks>
<disk name='vda' snapshot='external'>
</disk>
</disks>
</domainsnapshot>
"""
flags = 0...
2016 Nov 30
2
virDomainBlockInfo for local volume
...ckInfo for non block devices?
2. Does the virDomainBlockInfo return the correct physical size for normal file?
3. Performance wise do we have a difference between virStorageVol.download and virDomain.blockPeek?
Assuming the VMs are down, this is the code I intend to use for all formats:
vm = con.lookupByName(options.vmname)
info = vm.blockInfo(src)
physical = info[2]
off = 0
size = 0
with open(dest, 'w+') as f:
while off < physical:
if (physical - off) < bufsize:
size = physical - off
else:
size = bufsize
buf = vm.blockPeek(src, off, si...
2011 Feb 08
1
Libvirt in Windows not working
...lled Libvirt and Python 2.6 in the Windows Vista system
andhave written a small test file in Python.
Here is the code:
import libvirt*
*
import sys
conn = libvirt.openReadOnly(None)
if conn == None:
print *'Failed to open connection to the hypervisor'
*
sys.exit(1)
try:
dom0 = conn.lookupByName(*"vmware1"*)
except:
print *'Failed to find the main domain'
*
sys.exit(1)
print *"Domain 0: id %d running %s"* % (dom0.ID(), dom0.OSType())
print dom0.info()
When I am trying to execute this python code I received error message that :
ImportError: No module named...
2011 May 16
1
(no subject)
...rsh commands are working fine like
snapshot-create, delete, list, revert, current.
But when I try to do the same using libvirt, I get out of memory error. Here
are the commands that i execute on my host in a python shell...
import libvirt
conn = libvirt.open("qemu:///system")
dom = conn.lookupByName("vmtest")
*snap = dom.snapshotCreateXML(None,0);*
The error is as follows
libvir: Remote error : out of memory
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/dist-packages/libvirt.py", line 669, in
sna...
2014 Jul 29
1
Running domain-update memory not working
>>> vm=co.lookupByName('test1')
>>> vm.info()
[1, 524288L, 524288L, 1, 20400000000L]
>>> vm.setMemoryFlags(509952,1) # Live memory
0
>>> vm.info()
[1, 524288L, 524288L, 1, 21430000000L]
>>> vm.setMemoryFlags(509952,0) --- ## current memory
0
>>> vm.info()
[1, 524288L...
2012 Aug 26
1
question about using openAuth with Python
...pen(self):
auth = [[libvirt.VIR_CRED_AUTHNAME, libvirt.VIR_CRED_PASSPHRASE], authcb,
None]
vm_conn = libvirt.openAuth(self.uri, auth, 0);
print self.uri
if vm_conn == None:
print 'Failed to open connection to %s' % self.uri
for name in vm_conn.listDefinedDomains():
print name
vm = vm_conn.lookupByName(name)
if __name__ == '__main__':
conn = connection('qemu+ssh://root at 192.168.1.203/system')
conn.open()
Thanks
fan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120826/5fd7e7da/...
2010 Mar 24
2
Problem attaching device
I keep getting an error when I try to attach a device in the libvirt api through python
The python code is:
conn=libvirt.open('qemu:///system')
dom = conn.lookupByName("fedoratest")
if dom.info()[0]==1:
dom.attachDevice('net.xml')
And I keep getting: "libvirtError: XML description not well formed or invalid
The xml is a simple network card that works fine in virsh. It is just:
#cat net.xml
<interface type='network&...
2016 Jan 08
2
remove cdrom after installing os on a guest
...and I hope someone know a way to handle it.
I need to grammatically need to create/install a guest OS using the
libvirt API.
Currently what I do:
1. create a xml with the vm configuration (this will include a path to the
iso image)
2. connection.defineXML(<my_config>)
3. vm = connection.lookupByName(<domain_name>)
4. vm.create()
This will create a new guest and boot the iso to install the OS. But after
installation, when I restart, It again boots from the cdrom. So obviously I
need remove the cdrom somehow.
I could edit the xml and manually remove the cdrom, but the problem here is
ho...
2013 Feb 12
1
Out of Memory Error
...ice> *
*
*
I am trying to attach it using code:
*conn = libvirt.open("vbox:///session")
if conn ==None:
print 'Failed to open connection to the hypervisor'
sys.exit(1)
print 'connected to vbox hypervisor driver'
domainInstance = conn.lookupByName('SampleNode')
filed = open('/root/testFolder/usbSharedFolder.xml', 'r')
config_str = filed.read()
libvirt.virDomain.attachDevice(domainInstance, config_str)*
When it is executed I am getting an error message saying:
*libvir: VirtualBox Driver error :...
2016 Dec 20
1
Re: virDomainBlockInfo for local volume
...() data. Not sure
if you meant to compare vs. GetBlockInfo which uses fstat or lseek. The
download function is a bit different, but IIRC from the bz is your
actual consumer.
>
> Assuming the VMs are down, this is the code I intend to use for all
> formats:
>
> vm = con.lookupByName(options.vmname)
> info = vm.blockInfo(src)
> physical = info[2]
>
> off = 0
> size = 0
> with open(dest, 'w+') as f:
> while off < physical:
> if (physical - off) < bufsize:
> size = physical - off
>...
2015 Jul 24
0
virsh dominfo does not show correct cpuTime
...increase. How can this happen? Any one helps? Thanks.
Host information:
- CentOS Linux release 7.0.1406 (Core)
- libvirt 1.2.8
- qemu-kvm-rhev 2.1.2
----- python script to capture cpu domain usage ----
import libvirt
import time
conn = libvirt.openReadOnly("qemu:///system")
dom = conn.lookupByName('cpu-test')
last_time = time.time()
last_cpu_time = dom.info()[4]
while True:
time.sleep(1)
this_time = time.time()
dom_info = dom.info()
print "CPU time: %s" % dom_info[4]
print "CPU util: %s%%" % ((dom_info[4] - last_cpu_time) / ((this_time -
last_time) * 1...
2015 Jul 24
0
Re: virsh dominfo does not show correct cpuTime
...t; Host information:
>
> - CentOS Linux release 7.0.1406 (Core)
> - libvirt 1.2.8
> - qemu-kvm-rhev 2.1.2
>
> ----- python script to capture cpu domain usage ----
> import libvirt
> import time
>
> conn = libvirt.openReadOnly("qemu:///system")
> dom = conn.lookupByName('cpu-test')
> last_time = time.time()
> last_cpu_time = dom.info()[4]
>
> while True:
> time.sleep(1)
> this_time = time.time()
> dom_info = dom.info()
>
> print "CPU time: %s" % dom_info[4]
> print "CPU util: %s%%" % ((dom_info[4]...
2015 Nov 27
0
Re: New vs old API usages
On Thu, Nov 26, 2015 at 03:58:27PM +0200, Shahar Havivi wrote:
>Hi,
>
>Currently I am using the latest libvirt API listAllDomains() to probe for domains.
>I may need to fall back to older API for old libvirt server such as: listDefinedDomains() and lookupByName()
>instead of listAllDomains().
>Is there any disadvantage to using listAllDomains instead of listAllDomains
>or its the same results via different API?
>
I guess you meant "disadvantage to using listDefinedDomains and
listDomainIDs instead of listAllDomains". And yes there...
2016 Dec 05
0
Re: virDomainBlockInfo for local volume
...virDomainBlockInfo return the correct physical size for normal
> file?
> 3. Performance wise do we have a difference between virStorageVol.download
> and virDomain.blockPeek?
>
>
> Assuming the VMs are down, this is the code I intend to use for all
> formats:
>
> vm = con.lookupByName(options.vmname)
> info = vm.blockInfo(src)
> physical = info[2]
>
> off = 0
> size = 0
> with open(dest, 'w+') as f:
> while off < physical:
> if (physical - off) < bufsize:
> size = physical - off
> else:
>...