[libvirt-users] Sharing network namespace between containers
by Harish Vishwanath
Hello
Based on the lxc driver documentation, I am trying to create an xml to
share an existing network namespace with another container. I am running
libvirt 1.2.15.
Here is the xml:
<domain type='lxc' xmlns:lxc='http://libvirt.org/schemas/domain/lxc/1.0'>
<name>nt</name>
<uuid>43c00192-e114-4e29-8ce7-4b5487f60a75</uuid>
<memory unit='KiB'>65536</memory>
<currentMemory unit='KiB'>65536</currentMemory>
<vcpu placement='static'>1</vcpu>
<cputune>
<shares>2000</shares>
</cputune>
<resource>
<partition>/apphosting.partition</partition>
</resource>
<os>
<type arch='x86_64'>exe</type>
<init>/sbin/init</init>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/lib/libvirt/libvirt_lxc</emulator>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/work/repo-lxc/nt/rootfs_mnt'/>
<target dir='/'/>
</filesystem>
<filesystem type='mount' accessmode='squash'>
<driver type='path' wrpolicy='immediate'/>
<source dir='/local/local1/core_dir/nt'/>
<target dir='/local/local1/core_dir'/>
</filesystem>
<!--
<interface type='network'>
<mac address='52:54:dd:6d:44:d2'/>
<source network='dpbr_0'/>
<guest dev='eth0'/>
</interface>
-->
<console type='pty'>
<target type='lxc' port='0'/>
</console>
</devices>
* <lxc:namespace>*
* <lxc:sharenet type='netns' value='node'/>*
* </lxc:namespace>*
</domain>
However, the virsh edit is unable to save this file:
error: XML document failed to validate against schema: Unable to validate
doc against /usr/share/libvirt/schemas/domain.rng
Element domain has extra content: namespace
Failed. Try again? [y,n,i,f,?]:
Is this supported in libvirt 1.2.15 - the document doesnt specify a minimum
version of libvirt.
Appreciate your help.
Regards,
Harish
8 years
[libvirt-users] virtual wlan0
by Michael Ströder
HI!
My goal is to run a virtualized access point with hostapd.
Is it possible to use the host's WIFI interface in a VM created with libvirt? I
can add the interface in bridged mode but it appears just as normal eth1 without
wireless extensions.
Ciao, Michael.
8 years
[libvirt-users] pci-assign fails with read error on config-space file
by Henning Schild
Hey,
i am running an unusual setup where i assign pci devices behind the
back of libvirt. I have two options to do that:
1. a wrapper script for qemu that takes care of suid-root and appends
arguments for pci-assign
2. virsh qemu-monitor-command ... 'device_add pci-assign...'
I know i should probably not be doing this, it is a workaround to
introduce fine-grained pci-assignment in an openstack setup, where
vendor and device id are not enough to pick the right device for a vm.
In both cases qemu will crash with the following output:
> qemu: hardware error: pci read failed, ret = 0 errno = 22
followed by the usual machine state dump. With strace i found it to be
a failing read on the config space file of my device.
/sys/bus/pci/devices/0000:xx:xx.x/config
A few reads out of that file succeeded, as well as accesses on vendor
etc.
Manually launching a qemu with the pci-assign works without a problem,
so i "blame" libvirt and the cgroup environment the qemu ends up in.
So i put a bash into the exact same cgroup setup - next to a running
qemu, expecting a dd or hexdump on the config-space file to fail. But
from that bash i can read the file without a problem.
Has anyone seen that problem before? Right now i do not know what i
am missing, maybe qemu is hitting some limits configured for the
cgroups or whatever. I can not use pci-assign from libvirt, but if i
did would it configure cgroups in a different way or relax some limits?
What would be a good next step to debug that? Right now i am looking at
kernel event traces, but the machine is pretty big and so is the trace.
That assignment used to work and i do not know how it broke, i have
tried combinations of several kernels, versions of libvirt and qemu.
(kernel 3.18 and 4.4, libvirt 1.3.2 and 2.0.0, and qemu 2.2.1 and 2.7)
All combinations show the same problem, even the ones that work on
other machines. So when it comes to software versions the problem could
well be caused by a software update of another component, that i
got with the package manager and did not compile myself. It is a debian
8.6 with all recent updates installed. My guess would be that systemd
could have an influence on cgroups or limits causing such a problem.
regards,
Henning
8 years
[libvirt-users] pass-through hwrng
by lejeczek
hi all
I have in my centos 7 this:
crw-------. 1 root root 10, 183 Oct 11 21:28 /dev/hwrng
and VM fails, complains like this:
virsh # start volatile-work6
error: Failed to start domain volatile-work6
error: internal error: process exited while connecting to
monitor: 2016-10-19T09:42:05.988142Z qemu-kvm: -object
rng-random,id=objrng0,filename=/dev/hwrng: Could not open
'/dev/hwrng': Permission denied
which reads logical. Now - is this normal that hwrng is
created with these permissions?
And if yes then how to pass-through it to the VMs?
How to aid VMs with hardware random numbers generator?
many thanks.
L
8 years