[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, 1 month
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
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
How to exit console in L2 vm?
by Yalan Zhang
Hi,
I have a question about nested virtualization. The scenario is as below:
1. Prepare the nested environment, start L2 guest.
2. On the host, connect the L1 vm console, then on L1 guest, connect the L2
guest console:
(host)# virsh console L1_vm
Connected to domain L1_vm
Escape character is ^] (Ctrl + ])
...
(L1 vm)# virsh console L2_vm
Connected to domain L2_vm
Escape character is ^] (Ctrl + ])
...
(L2 vm)# <=== press " ^] " to exit the console, it return to the **host**
(host)#
Is it expected that "^]" in L2 guest will exit thoroughly to the host, not
the L1 guest?
Thank you!
-------
Best Regards,
Yalan Zhang
IRC: yalzhang
3 years, 11 months
Debugging virtiofs
by Popog
I can't seem to start a VM with virtiofs. Everything is running as root
(unraid) with a pretty simple setup:
<filesystem type='mount' accessmode='passthrough'>
<driver type='virtiofs'/>
<binary path='/usr/libexec/virtiofsd' />
<source dir='/mnt/user/shared'/>
<target dir='shared_mount'/>
</filesystem>
Even with debug logging at max, all I get in the main log is:
qemu-system-x86_64: -device
vhost-user-fs-pci,chardev=chr-vu-fs0,tag=shared_mount,bus=pci.5,addr=0x0:
Failed to write msg. Wrote -1 instead of 12.
qemu-system-x86_64: -device
vhost-user-fs-pci,chardev=chr-vu-fs0,tag=shared_mount,bus=pci.5,addr=0x0:
vhost_dev_init failed: Operation not permitted
shutting down, reason=failed
And in the fsd log:
[ID: 00029648] virtio_session_mount: Waiting for vhost-user socket
connection...
[ID: 00029648] virtio_session_mount: Received vhost-user socket connection
[ID: 00000001] pivot_root(., .): Invalid argument
Nothing else in any other logs (e.g. dmesg). What do these errors mean? How
do I troubleshoot this?
3 years, 11 months
image works in native but not in vm when cpu mode='host-passthrough' is set
by daggs
Greetings.
I have an image I've created with a bunch of chost flags which works on my machine when it comes to native boot.
if I take that same image into a vm managed via libvirt, I get kernel panic.
I'd assume that something is missing from my vm config, question is what and what I can do about it?
here is the flags part of lscpu in native and vm: https://dpaste.com/3TR8QJ5G8
and the vm's xml: https://dpaste.com/984JX4LUQ
if I build the image with the default flags (march=x86-64), the vm boots well.
my new chost is -O2 -pipe -march=skylake -mabm -mno-adx -mno-avx -mno-avx2 -mno-bmi -mno-bmi2 -mno-f16c -mno-fma -mno-xsave -mno-xsavec -mno-xsaveopt -mno-xsaves -mno-sgx
the cpu is Intel(R) Pentium(R) CPU G4560 @ 3.50GHz
thoughts?
Thanks,
Dagg.
3 years, 11 months