[libvirt-users] Howto set the option script=no for a tap device in the xml file
by Christian Spann
Hello,
I am trying to run a virtual machine with qemu-kvm and libvirt as a
user. In order to start the virtual machine I setup a tap device
manually, add it to the bridge and activate it via ifconfig. But I
cannot tell libvirt to not try to add the definded tap device to the
bridge by itself. It always fails telling me it cannot add tap0 to br0.
Thats the xml snippet for defining the network:
<interface type='bridge'>
<mac address='54:52:00:38:75:dd'/>
<source bridge='br0'/>
<target dev='tap0'/>
<model type='virtio'/>
</interface>
Here I would like do define "script=no" to get an output like: -net
tap,vlan=0,ifname=tap0,script=no when libvirt launches the vm.
Regards,
Christian
--
Christian Spann - http://www-vs.informatik.uni-ulm.de/~spann
13 years, 7 months
[libvirt-users] (no subject)
by Abhishek Gupta
Hi,
I am using libvirt and virsh for my application. I am trying to manage
snapshots for my infrastructure. All virsh 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
snapshotCreateXML
if ret is None:raise libvirtError('virDomainSnapshotCreateXML() failed',
dom=self)
libvirt.libvirtError: out of memory
13 years, 7 months
[libvirt-users] libvirt connection timeout
by Antoine COETSIER
Hi all,
I would like to set a short connection timeout (only some seconds) when using libvirt in my Python program instead of the long default one.
I found the C function: virEventAddTimeoutFunc() in the C libvirt API here:
http://libvirt.org/html/libvirt-libvirt.html#virEventAddTimeoutFunc
and eventInvokeTimeoutCallback(timer, callback, opaque) in libvirt.py around the line#150 but I do not know how to use it. I did not find any example on the net.
I tried this but I get a segmentation fault: :-(
import libvirt
def timeout_cb_d():
print 'Timeout !'
try:
# try to set the libvirt timeout to 2 seconds:
t = libvirt.eventInvokeTimeoutCallback(2, timeout_cb_d, "from dom0_class")
except:
...
Does anyone can give me a working example please?
Antoine Coetsier
13 years, 7 months
[libvirt-users] (no subject)
by Abhishek Gupta
Hello,
In the documentation section of Python API Website it is written that the
generation of python API and documentation is automated using generator.py
file. This should produce the necessary files alongwith the documentation in
libvirtclass.txt which should be present in docs or python folder.
I executed generator.py file but was not able to find the libvirtclass.txt
file to get the documentation.
The easiest way I could think of was to manually browse the libvirt.py file
for the available functions. Is there any other way of doing the same?
--
Abhishek
13 years, 7 months
[libvirt-users] (no subject)
by Abhishek Gupta
Hello,
I am using python bindings of libvirt. When I use the function
listDomainsID( ) it successfully returns me the list of the ids of my
current virtual machines, but when I call function listDefinedDomains( ) it
returns me an empty list.
Is this some kind of bug because as per my understanding listDefinedDomains
should return a superset of vm's as returned by listDefinedDomains().
I am using 0.8.8 version of the libvirt.
--
Thanks
Abhishek
13 years, 7 months
Re: [libvirt-users] Problem after restarting libvirt
by Nikita A Menkovich
I could not find that cgroups are not persistent now. And there is no
such information in changelog.
Could you show me commit where it was changed?
On 9 May 2011 15:50, Nikita A Menkovich <menkovich(a)gmail.com> wrote:
> It is really bad. Ok, I will write a script, that will set up cgroups
> for every domain.
>
> On 9 May 2011 10:44, Osier Yang <jyang(a)redhat.com> wrote:
>> 于 2011年05月05日 21:32, Nikita A Menkovich 写道:
>>>
>>> After restarting libvirt cgroups for VMs are not recovered.
>>> Is there available to restore cgroup state after restart?
>>>
>> except "cpu.shares" (Since 0.9.0), all other cgroup related stuffs
>> have no persistent XML yet, so they can't be recovered.
>>
>> Regards
>> Osier
>>
>
>
>
> --
> Nikita A Menkovich
> http://libc6.org/
> JID: menkovich(a)gmail.com
> Tel: +7 (921) 423-96-48
>
--
Nikita A Menkovich
http://libc6.org/
JID: menkovich(a)gmail.com
Tel: +7 (921) 423-96-48
13 years, 7 months
[libvirt-users] Booting from scsi
by bhasker@unixindia.com
Hi all,
I am starting up to use libvirt with virsh and virt-install. I used
virt-install successfully and have a running linux system with raw disk
exported to the virtual machine as scsi. (the whole of qemu + libvirt +
virtmanager is compiled and installed on /usr/local from source)
After the virtual OS installation (which succeeds) I am not able to boot
into the OS from the harddisk. Following are some excerpts from my xml
file. Please get back to me if you need any more information
<os>
<type arch='x86_64' machine='pc-0.14'>hvm</type>
<boot dev='hd'/>
<bootmenu enable='yes'/>
</os>
I also tried removing the boot parametes from <os> and added
<boot order='1'/> in the scsi disk section. Still I am not able to use the
scsi disk to boot (my qemu-system-x86_64 however has the boot=on option)
<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/venkatb1/deb'/>
<target dev='sda' bus='scsi'/>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
I could not find any more information or any posts where someone else had
faced this issue. I presume I am doing something wrong here.
Can someone help please ?
thanks
Bhasker C V
13 years, 7 months
[libvirt-users] Problems using virt-install to create KVM CentOS 5.6 guest
by Emmanuel Noobadmin
I was having problems creating a KVM CentOS 5.6
Initially the host was CentOS 5.6 but I switched to Scientific Linux 6
during the process of trying to solve it. I was able to install a
working guest in the end by manually writing an XML and using virsh.
However, as it shouldn't be so complicated, Gleb over at the KVM list
asked me to share this with the libvirtd ML. I don't know it's an old
bug, since current libvirt seems to be several sub-versions ahead of
mine so decided to post to the user list first in case it's a known
bug. Hopefully somebody will be able to pinpoint what went wrong.
Host system: SL 6.0 with libvirtd (libvirt) 0.8.1
Network: 2 physical NICs, eth0 bridged to br0 for WAN connectivity,
eth1 is for internal use
Installation medium: CentOS 5.6 DVD ISO
Original problem
virt-install would simply not work, I get a blank console with nothing
happening and qemu-kvm will be 100% load on one core.
This was eventually traced to virt-install not being able to mount/use
the ISO. Mounting the ISO as loopback allowed the installation to
proceed.
However, the guest was not able to see the installation "cdrom". With
httpd running off the host, and tested accessibly via Internet, a
network install did not work either.
After much frustration, I followed the documentation at libvirt
website to write my own XML file.
The result of this was the discovery that
1. permissions on initrd.img and vmlinux was not allowing virsh access
- copying these files to disk and adjusting the xml allowed
installation to proceed. virt-install appears to do this on the fly.
2. virt-install guest could not see any disk. The anaconda installer
could not find any CDROM or hard disk.
- Part of the problem seems to be that virt-install did not save the
source for the installation medium, the generated XML did not have the
source information under the <disk> element. I specified this in my
manual XML and the CentOS guest was able to see the "cdrom" and
install properly. As I did not have any problem with missing hard
disks with my manually written XML so I'm not sure what went wrong
with virt-install's
3. Can't install via network
- This was traced to networking not working at all. Even in my manual
XML, networking did not work although the guest could install from the
disk. Eventually, this was solved by adding the <model type='virtio'
/> to the device definition.
13 years, 7 months
[libvirt-users] point-to-point connection between vm and host
by Jorge Somavilla
Hi! hopefully someone can give me a hint with this:
I need to create a vm with a point-to-point connection to the host
using a /30 subnet. Right now i have this in the vm's xml for libvirt:
<interface type="network" name="eth0" onboot="yes">
<source network="default"/>
<mac address="02:fd:00:00:01:00"/>
</interface>
Which brings up an interface in the vm that is configured later by a a
daemon, getting to this:
vnx@r2:~$ ifconfig eth0
eth0 Link encap:Ethernet HWaddr 02:fd:00:00:01:00
inet addr:10.250.0.2 Bcast:10.250.0.3 Mask:255.255.255.252
While in the host the other interface is created:
root@tau:/home/jorge/workspace/vnx# ifconfig r2-e0
r2-e0 Link encap:Ethernet HWaddr 0a:81:b6:3c:24:15
inet addr:10.250.0.1 Bcast:10.250.0.3 Mask:255.255.255.252
However there is no connectivity between them, probably because of
some mistake in the <interface> tag, perhaps a wrong 'type' attribute,
but i haven't found out yet. I wouldn't want to create a bridge and
connect both interfaces (vm's and host's) to the bridge, but to have
this ptp, if possible. How would i go about doing that?
thanks!
Jorge
13 years, 7 months