[libvirt-users] [virtual interface] detach interface during boot succeed with no changes
by Yalan Zhang
Hi guys,
when I detach an interface from vm during boot (vm boot not finished), it
always fail. I'm not sure if there is an existing bug. I have
confirmed with someone that for disk, there is similar behavior, if
this is also acceptable?
# virsh destroy rhel7.2; virsh start rhel7.2 ;sleep 2; virsh
detach-interface rhel7.2 network 52:54:00:98:c4:a0; sleep 2; virsh
dumpxml rhel7.2 |grep /interface -B9
Domain rhel7.2 destroyed
Domain rhel7.2 started
Interface detached successfully
<address type='pci' domain='0x0000' bus='0x00' slot='0x06'
function='0x0'/>
</controller>
<interface type='network'>
<mac address='52:54:00:98:c4:a0'/>
<source network='default' bridge='virbr0'/>
<target dev='vnet0'/>
<model type='rtl8139'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
</interface>
When I detach after the vm boot, expand the sleep time to 10, it will succeed.
# virsh destroy rhel7.2; virsh start rhel7.2 ;sleep 10; virsh
detach-interface rhel7.2 network 52:54:00:98:c4:a0; sleep 2; virsh
dumpxml rhel7.2 |grep /interface -B9
Domain rhel7.2 destroyed
Domain rhel7.2 started
Interface detached successfully
-------
Best Regards,
Yalan Zhang
IRC: yalzhang
Internal phone: 8389413
2 years, 2 months
Problem with xen hvm DomU
by Christoph
Hi
can someone say me whats wrong in this config:
<domain type='xen'>
<name>fenrir.chao5.int</name>
<uuid>7aedcd03-54e8-4055-8d1b-37dd34194859</uuid>
<memory unit='KiB'>2097152</memory>
<currentMemory unit='KiB'>2097152</currentMemory>
<vcpu placement='static'>2</vcpu>
<os>
<type arch='x86_64' machine='xenfv'>hvm</type>
<loader type='rom'>/usr/lib/xen/boot/hvmloader</loader>
<kernel>/usr/lib64/xen/boot/hvmloader</kernel>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='variable' adjustment='0' basis='localtime'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/dev/vg_astarte/lv_fenrir_root'/>
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/dev/vg_astarte/lv_fenrir_swap'/>
<target dev='hdb' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
<controller type='xenbus' index='0'/>
<controller type='ide' index='0'/>
<interface type='bridge'>
<mac address='00:16:3e:05:30:04'/>
<source bridge='xenbr5'/>
<script path='vif-bridge'/>
<model type='netfront'/>
</interface>
<interface type='bridge'>
<mac address='00:16:3e:04:30:04'/>
<source bridge='xenbr4'/>
<script path='vif-bridge'/>
<model type='netfront'/>
</interface>
<interface type='bridge'>
<mac address='00:16:3e:15:30:04'/>
<source bridge='xenbr15'/>
<script path='vif-bridge'/>
<model type='netfront'/>
</interface>
<interface type='bridge'>
<mac address='00:16:3e:14:30:04'/>
<source bridge='xenbr14'/>
<script path='vif-bridge'/>
<model type='netfront'/>
</interface>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='vnc' port='6000' autoport='no' listen='0.0.0.0'>
<listen type='address' address='0.0.0.0'/>
</graphics>
<video>
<model type='cirrus' vram='8192' heads='1' primary='yes'/>
</video>
<memballoon model='xen'/>
</devices>
</domain>
If I try to start it with virsh create... then I see only:
error: Failed to create domain from
/etc/libvirt/libxl/fenrir.chao5.int.xml
error: internal error: libxenlight failed to create new domain
'fenrir.chao5.int'
------
Greetz
3 years, 10 months
Isolated bridge does not bridge
by Paul van der Vlis
Hello,
I want to do some testing and I have removed two VM's from the bridge
what connects them to internet, and added them to another isolated
bridge what's not connected to internet. Problem is that I cannot reach
the other host in the isolated network.
Something like this:
virsh shutdown kvm66
virsh shutdown kvm68
brctl delif br0 vnet10 vnet6 # the interfaces of kvm66 and kvm68
brctl addbr br1
brctl addif br1 vnet10 vnet6
Then I've replaced br0 to br1 in the XML of both VM's with "virsh edit".
Then I did start the VM's using the serial console (no network):
virsh start --console kvm66
virsh start --console kvm68
I cannot ping from one machine to the other. Why??
With regards,
Paul
--
Paul van der Vlis Linux systeembeheer Groningen
https://www.vandervlis.nl/
3 years, 10 months
Set hostname of guest during installation time
by john doe
Hi,
I would like to set the hostname when installing a guest, with the below
command the hostname is not set to 'try06' in the guest:
virt-install --name=try06 --graphic none --pxe --network bridge=virbr0
How can I set the hostname of the guest during installation time?
I realy appriciate the support I'm getting in here, I'm fairly new to
libvirt.
--
John Doe
4 years
Failed to get udev device for syspath '/sys/devices/virtual/dmi/id'
by Mathieu Tarral
Hi,
I'm facing an issue with libvirt and the LIBXL driver, failing when searching for DMI data in /sys.
info : libvirt version: 5.0.0, package: 4+deb10u1 (Guido Günther <agx(a)sigxcpu.org> Thu, 05 Dec 2019 00:22:14 +0100)
error : udevGetDMIData:1719 : internal error: Failed to get udev device for syspath '/sys/devices/virtual/dmi/id' or '/sys/class/dmi/id'
error : libxlDriverConfigNew:1803 : Unable to configure libxl's memory management parameters
error : virStateInitialize:662 : Initialization of LIBXL state driver failed: internal error: Failed to get udev device for syspath '/sys/devices/virtual/dmi/id' or '/sys/class/dmi/id'
error : daemonRunStateInit:799 : Driver state initialization failed
The relevant function udevGetDMIData in libvirt:
https://github.com/libvirt/libvirt/blob/cb09344a2cccc0cc9bcefa3cb53d7af45...
I don't understand what's happening, as this initialization failure only happens when I boot on the Xen kernel.
Also, the /sys/class/dmi* paths are not exposed on Xen.
Note: Running on Xen 4.12.1
Any ideas ?
Thanks !
4 years, 1 month
cant create network with virt-manager
by Marko Horn
hello list,
i cant create an isolated network with the virt-manager.
installed version virt-manager 3.0.0
installed version libvirt 6.2.0
output in error-message:
Error creating virtual network: internal error: Failed to apply firewall
rules /sbin/iptables -w --table filter --insert LIBVIRT_INP
--in-interface virbr3 --protocol tcp --destination-port 67 --jump
ACCEPT: iptables: No chain/target/match by that name.
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 66, in
cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/createnet.py", line 428, in
_async_net_create
netobj.create()
File "/usr/lib/python3.7/site-packages/libvirt.py", line 3174, in
create
if ret == -1: raise libvirtError ('virNetworkCreate() failed',
net=self)
libvirt.libvirtError: internal error: Failed to apply firewall rules
/sbin/iptables -w --table filter --insert LIBVIRT_INP --in-interface
virbr3 --protocol tcp --destination-port 67 --jump ACCEPT: iptables: No
chain/target/match by that name
any ideas?
thank you
marko
--
Mitten drin statt nur Datei!
4 years, 1 month
Help on Meson build Error
by Wei Wang
Seems it didn't appear on the mailing list, resent it.
Hi folks,
I'm trying to build libvirt using meson with the latest upstream libvirt,
but the compilation fails:
(followed on https://libvirt.org/compiling.html, not sure if any
dependencies are missed. I checked, src/util/libvirt_util.a.p does not
exist.)
FAILED: src/util/libvirt_util.a.p/glibcompat.c.o
....
In file included from ../src/util/glibcompat.c:19:
./config.h:1026:10: fatal error: config-post.h: No such file or directory
FAILED: src/util/libvirt_util.a.p/virfirmware.c.o
In file included from ../src/util/virarch.c:22:
./config.h:1026:10: fatal error: config-post.h: No such file or directory
FAILED: src/util/libvirt_util.a.p/viraudit.c.o
In file included from ../src/util/viraudit.c:22:
./config.h:1026:10: fatal error: config-post.h: No such file or directory
Any help is appreciated.
Thanks,
Wei
4 years, 1 month
[libvirt] SRIOV configuration
by Edward Haas
Hello,
We encountered a problem while testing SRIOV on kubevirt [1]:
We are currently using the Device "hostdev" generic options to
pass-through the VF to the guest.
It is not done through the "interface" (with type hostdev) because
that option requires access to the PF which is not available in our
case (the VF is moved to the container namespace where libvirt runs,
but not the PF, however libvirt attempts to access the PF and fails).
The PCI addresses appearing on the domxml are not the same as the ones
mappend/detected in the VM itself. I compared the domxml on the host
and the lspci in the VM while the VM runs.
This occurs only when SRIOV is defined, messing up also the other
"regular" vnics.
Somehow, everything comes up and runs (with the SRIOV interface as
well) on the first boot (even though the PCI addresses are not in
sync), but additional boots cause the VM to mess up the interfaces
(not all are detected).
This is how the domxml hostdev section looks like:
```
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x3b' slot='0x0a' function='0x4'/>
</source>
<alias name='hostdev0'/>
<address type='pci' domain='0x0000' bus='0x06' slot='0x01'
function='0x0'/>
</hostdev>
```
Is there something we are missing or we misconfigured?
Tested with 6.0.0-16.fc31
My second question is: Can libvirt avoid accessing the PF (as we do
not need mac and other options).
1. https://github.com/kubevirt/kubevirt
Thanks,
Edy.
4 years, 1 month
consuming pre-created tap - with multiqueue
by Miguel Duarte de Mora Barroso
Hello,
On KubeVirt, we are trying to pre-create a tap device, then instruct
libvirt to consume it (via the type=ethernet , managed='no'
attributes).
It works as expected, **unless** when we create a multi-queue tap device.
The difference when creating the tap device is that we set the
multi-queue flag; libvirt throws the following error when consuming
it:
```
LibvirtError(Code=38, Domain=0, Message='Unable to create tap device
tap0: Invalid argument')
```
After digging a bit on the libvirt code (we're using libvirt 6.0.0), I
see this on the logs (immediately before the error):
{"component":"virt-launcher","level":"info","msg":"Enabling
IFF_VNET_HDR","pos":"virNetDevProbeVnetHdr:190","subcomponent":"libvirt","thread":"33"
,"timestamp":"2020-09-22T10:34:29.335000Z"}
I do not understand how it can try to set the VNET_HDR flag, since I
have not set it when I created it, which, as per [0] should only
happen when requested. Here's the tap device I'm creating: (output of
`ip tuntap show`)
- tap0: tap persist0x100 user 107 group 107
I'm confused by this, since on [1] it says that only one flag can be
used (persist *or* vnet_hdr). Also, from my limited understanding, in
order to open a pre-created tap device, it must be set to persistent.
Am I right (in the sense that these flags cannot co-exist) ? If so,
why would libvirt be setting the VNET_HDR flag on the tap device ?
[0] - https://github.com/libvirt/libvirt/blob/v6.0.0/src/util/virnetdevtap.c#L261
[1] - https://github.com/libvirt/libvirt/blob/v6.0.0/src/util/virnetdevtap.c#L209
4 years, 1 month