[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
Get Host Capabilities failed: Internal JSON-RPC error: {'reason': 'internal error: Duplicate key'}
by tommy
Hi,everyone:
I got this error in my ovirt env:
VDSM ooengh1.tltd.com command Get Host Capabilities failed: Internal
JSON-RPC error: {'reason': 'internal error: Duplicate key'}
Systemctl message is:
Dec 23 20:48:48 ooengh1.tltd.com vdsm[2431]: ERROR Internal server error
Traceback (most recent call
last):
File
"/usr/lib/python2.7/site-packages/yajsonrpc/__init__.py", line 345, in
_handle_request
res = method(**params)
File
"/usr/lib/python2.7/site-packages/vdsm/rpc/Bridge.py", line 198, in
_dynamicMethod
result = fn(*methodArgs)
File "<string>", line 2, in
getCapabilities
File
"/usr/lib/python2.7/site-packages/vdsm/common/api.py", line 50, in method
ret = func(*args, **kwargs)
File
"/usr/lib/python2.7/site-packages/vdsm/API.py", line 1371, in
getCapabilities
c = caps.get()
File
"/usr/lib/python2.7/site-packages/vdsm/host/caps.py", line 93, in get
machinetype.compatible_cpu_models())
File
"/usr/lib/python2.7/site-packages/vdsm/common/cache.py", line 43, in
__call__
value = self.func(*args)
File
"/usr/lib/python2.7/site-packages/vdsm/machinetype.py", line 142, in
compatible_cpu_models
all_models =
domain_cpu_models(c, arch, cpu_mode)
File
"/usr/lib/python2.7/site-packages/vdsm/machinetype.py", line 97, in
domain_cpu_models
domcaps =
conn.getDomainCapabilities(None, arch, None, virt_type, 0)
File
"/usr/lib/python2.7/site-packages/vdsm/common/libvirtconnection.py", line
131, in wrapper
ret = f(*args, **kwargs)
File
"/usr/lib/python2.7/site-packages/vdsm/common/function.py", line 94, in
wrapper
return func(inst, *args,
**kwargs)
File
"/usr/lib64/python2.7/site-packages/libvirt.py", line 3844, in
getDomainCapabilities
if ret is None: raise
libvirtError ('virConnectGetDomainCapabilities() failed', conn=self)
libvirtError: internal error:
Duplicate key
AnyOne can help me ?
Thanks!
3 years, 8 months
[resent] virt-manager connection fails with 'qemu unexpectedly closed the monitor'
by John Paul Adrian Glaubitz
Hi!
I recently ran into a problem when connecting to libvirtd 6.9.0 on Debian unstable
and trying to import an existing image with Windows 7.
Upon finishing the wizard and starting the instance, the import process fails
with the following error message:
Unable to complete install: 'internal error: qemu unexpectedly closed the monitor'
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 65, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/createvm.py", line 2081, in _do_async_install
installer.start_install(guest, meter=meter)
File "/usr/share/virt-manager/virtinst/install/installer.py", line 731, in start_install
domain = self._create_guest(
File "/usr/share/virt-manager/virtinst/install/installer.py", line 679, in _create_guest
domain = self.conn.createXML(install_xml or final_xml, 0)
File "/usr/lib64/python3.8/site-packages/libvirt.py", line 4366, in createXML
raise libvirtError('virDomainCreateXML() failed')
libvirt.libvirtError: internal error: qemu unexpectedly closed the monitor
Since this error message is rather generic, I don't know where to start debugging.
Does anyone know how to increase verbosity here to get an error message that might be
more helpful?
Thanks,
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - glaubitz(a)debian.org
`. `' Freie Universitaet Berlin - glaubitz(a)physik.fu-berlin.de
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
3 years, 8 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, 9 months
about the script /etc/qemu-ifup with nmcli command
by Yalan Zhang
Hi,
I have tried the qemu-ifup script as below with nmcli command as brctl is
deprecated on rhel8, but the guest network can not work.
I think the script needs update. Could you please help to have a look?
Thank you in advance.
1. prepare a linux bridge on the host named br0;
2. prepare the qemu-ifup script as below:
# cat /etc/qemu-ifup
#!/bin/bash
# A br0 bridge should be already set up.
# Compare with:
# http://en.wikibooks.org/wiki/QEMU/Networking#qemu-ifup
#
# For the bridge setup, see:
# http://wiki.libvirt.org/page/Networking#Fedora.2FRHEL_Bridging
# http://gist.github.com/393525
ip link set "$1" up
nmcli c add type bridge-slave ifname $1 con-name $1 master br0 autoconnect
yes
3. start vm with below interface setting:
# virsh dumpxml rh | grep /interface -B5
<interface type='ethernet'>
<mac address='52:54:00:79:ba:dd'/>
<script path='/etc/qemu-ifup'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x04' slot='0x00'
function='0x0'/>
</interface>
# virsh start rh
Domain rh started
4.check on guest, the interface can not get dhcp ip address;
5. check on host,
# nmcli con
NAME UUID TYPE DEVICE
br0 f68f73c7-10ee-40c1-bb09-3366d11ac896 bridge br0
...
vnet0 90a48d77-dccc-4b59-98f5-09f8cbd62458 ethernet --
# nmcli dev
DEVICE TYPE STATE CONNECTION
br0 bridge connected br0
...
vnet0 tun unmanaged --
6. hotplug a bridge type interface and compare the tap devices:
# virsh attach-interface rh bridge br0 --model virtio
Interface attached successfully
# nmcli con
NAME UUID TYPE DEVICE
br0 f68f73c7-10ee-40c1-bb09-3366d11ac896 bridge br0
vnet1 07c2a1f8-396f-4d5f-b61f-ef2ddb42ed93 tun vnet1 --->the
hot-plugged one
...
vnet0 90a48d77-dccc-4b59-98f5-09f8cbd62458 ethernet -- ----> the
ethernet one
# nmcli dev
DEVICE TYPE STATE CONNECTION
vnet1 tun connected (externally) vnet1 --->the
hot-plugged one
vnet0 tun unmanaged -- ----> the ethernet one
...
7. from the outputs above, the back-end tun device for ethernet type
interface is unmanaged.
I don't know how to update the script to fix it. Could you please help?
-------
Best Regards,
Yalan Zhang
IRC: yalzhang
3 years, 9 months
virt-manager connection fails with 'qemu unexpectedly closed the monitor'
by John Paul Adrian Glaubitz
Hi!
I recently ran into a problem when connecting to libvirtd 6.9.0 on Debian unstable
and trying to import an existing image with Windows 7.
Upon finishing the wizard and starting the instance, the import process fails
with the following error message:
Unable to complete install: 'internal error: qemu unexpectedly closed the monitor'
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 65, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/createvm.py", line 2081, in _do_async_install
installer.start_install(guest, meter=meter)
File "/usr/share/virt-manager/virtinst/install/installer.py", line 731, in start_install
domain = self._create_guest(
File "/usr/share/virt-manager/virtinst/install/installer.py", line 679, in _create_guest
domain = self.conn.createXML(install_xml or final_xml, 0)
File "/usr/lib64/python3.8/site-packages/libvirt.py", line 4366, in createXML
raise libvirtError('virDomainCreateXML() failed')
libvirt.libvirtError: internal error: qemu unexpectedly closed the monitor
Since this error message is rather generic, I don't know where to start debugging.
Does anyone know how to increase verbosity here to get an error message that might be
more helpful?
Thanks,
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - glaubitz(a)debian.org
`. `' Freie Universitaet Berlin - glaubitz(a)physik.fu-berlin.de
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
3 years, 9 months
Unexplicable permission error when trying to read a qemu firmware file
by Emmanuel Kasper
Hi
I want to create a CoreOS VM following the steps mentioned at
https://docs.fedoraproject.org/en-US/fedora-coreos/getting-started,
using a Debian 11 (bullseye) system.
I am thus creating a VM with the following virt-install command:
virt-install --connect="qemu:///system" --name=coreos \
--vcpus=2 --memory=2048 \
--os-variant=fedora29 --import --graphics=none \
--disk="size=10,backing_store=$PWD/fedora-coreos-33.20201201.3.0-qemu.x86_64.qcow2"
\
--qemu-commandline="-fw_cfg
name=opt/com.coreos/config,file=/tmp/example.ign"
which spits some warnings and this mysterious error
2020-12-29T16:52:03.858938Z qemu-system-x86_64: warning: host doesn't
support requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12]
2020-12-29T16:52:03.858941Z qemu-system-x86_64: warning: host doesn't
support requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl
[bit 13]
2020-12-29T16:52:03.864778Z qemu-system-x86_64: -fw_cfg
name=opt/com.coreos/config,file=/tmp/example.ign: can't load
/tmp/example.ign: Failed to open file “/tmp/example.ign”: Permission denied
the file /tmp/example.ign is perfectly world readable,
-rw-rw-rw- 1 manu manu 1130 Dec 29 17:23 /tmp/example.ign
so I am puzzled at what could cause this permission error.
on a RHEL8 system, I had the same error, and was able to fix by setting
a security context on the firmware file:
sudo semanage fcontext --add --type virt_content_t /tmp/example.ign
restorecon /tmp/example.ign
now this Debian system does not selinux installed at all.
ls -dZ /
? /
I could also read the qemu firmware file when using the qemu:///session
connection
any pointers where to look for ?
Emmanuel
3 years, 9 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, 9 months
How to open listener of Libvirt ?
by tommy
Hi,every one:
My Ubuntu is : 20.04 LTS, and I using libvirtd on it to manage KVM vm, but
now I can not open listener function of the libvirtd.
SYSTEM SOCKET ACTIVATION
The libvirtd daemon is capable of starting in two modes.
In the traditional mode, it will create and listen on UNIX sockets
itself. If the --listen parameter is given, it will also listen on TCP/IP
socket(s),
according to the listen_tcp and listen_tls options in
/etc/libvirt/libvirtd.conf
In socket activation mode, it will rely on systemd to create and
listen on the UNIX, and optionally TCP/IP, sockets and pass them as
pre-opened file de�
scriptors. In this mode, it is not permitted to pass the --listen
parameter, and most of the socket related config options in
/etc/libvirt/libvirtd.conf
will no longer have any effect. To enable TCP or TLS sockets use
either
$ systemctl start libvirtd-tls.socket
Or
$ systemctl start libvirtd-tcp.socket
But, on my system, there are no such service like libvirtd-tls.socket or
libvirtd-tcp.socket.
root@ubts1:~# systemctl | grep libvirt
libvirt-guests.service
loaded active exited Suspend/Resume Running libvirt Guests
libvirtd.service
loaded active running Virtualization daemon
libvirtd-admin.socket
loaded active running Libvirt admin socket
libvirtd-ro.socket
loaded active running Libvirt local read-only socket
libvirtd.socket
loaded active running Libvirt local socket
How can I open the listener ?
Thanks!
3 years, 9 months
cannot get Libvirt/qemu to use secure boot
by Felix Rubio Dalmau
Hi everybody,
I am having serious trouble enabling secure boot via virt-install... and I do not see clearly even where to look for help :-/. Maybe somebody can point me on the right direction? I am running:
arch linux
edk2-ovmf 202011-1
libvirt 6.5
virt-install 3.2
qemu 5.2
I am creating the domain with virt-install, and the parameters
--features smm.state=on
--boot loader=/usr/share/ovmf/x64/OVMF_CODE.secboot.fd,nvram.template=/usr/share/ovmf/x64/OVMF_VARS.fd,loader.readonly=yes,loader.type=pflash,loader_secure=yes
If I boot into the UEFI I can see there is the menu for the OVMF and Secure Boot available, but when I get into the Secure Boot entry, I only see it is "disabled" and I cannot tick the "Attempt secure boot" box.
As far as I understand, by using OVMF_CODE.secboot.f I should already get the default keys working, so I should be good to go to test this setup, but... to no success.
Does anybody have any idea on what might be wrong/where can I get help (should this not be the place?)
Thank you!
Felix
3 years, 9 months