[libvirt-users] (no subject)
by arvind viswanathan
I wanted to check if event loop integration was supported even for remote
applications using libvirt. My application would like to make non-blocking
calls and also recv asynchronous notification remotely. Can some one point
out if its supported.
thanks
11 years, 5 months
[libvirt-users] Filesystem passthrough of a Lustre mounted directory
by Tatiana Kichkaylo
Hi,
I am trying to pass a Lustre directory mounted on the host to the guest.
I can pass a local directory in just fine when starting an instance via
virsh. I can execute the qemu command from libvirt's logs (dropping –S
flag) directly, and passing the Lustre mounted directory also works (but
the network complains about different MAC address). However, when I
start an instance using virsh, the mount inside the guest succeeds, and
ls works sometimes, but everything else (cat, touch, actual edit) on any
file in the mounted directory gives "Identifier removed" after some delay.
Is libvirt doing something beyond just calling qemu that can cause this
problem? And how do I get around it?
The host is RedHat 6.1, libvirt 1.0.3, qemu 1.4.50.
Thanks,
Tatiana
The command pulled out from the libvirt's log:
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=none \
/usr/local/bin/qemu-system-x86_64 \
-name i3e -M pc-0.14 -S \
-cpu
SandyBridge,+pdpe1gb,+osxsave,+dca,+pcid,+pdcm,+xtpr,+tm2,+est,+smx,+vmx,+ds_cpl,+monitor,+dtes64,+pbe,+tm,+ht,+ss,+acpi,+ds,+vme
\
-enable-kvm -m 2048 -smp 1,sockets=1,cores=1,threads=1 \
-uuid ccc66436-8535-472e-8397-eee52d01cffe -no-user-config -nodefaults \
-chardev
socket,id=charmonitor,path=/var/lib/libvirt/qemu/i3e.monitor,server,nowait \
-mon chardev=charmonitor,id=monitor,mode=control -rtc
base=utc,driftfix=slew \
-no-kvm-pit-reinjection -no-shutdown -kernel
/var/lib/nova/instances/instance-0000003d/kernel \
-initrd /var/lib/nova/instances/instance-0000003d/ramdisk \
-append root=/dev/vda \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
-drive
file=/var/lib/nova/instances/instance-0000003d/disk,if=none,id=drive-virtio-disk0,format=qcow2,cache=none
\
-device
virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
\
-fsdev local,security_model=passthrough,id=fsdev-fs0,path=/mnt/lustre/ \
-device
virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=testfs,bus=pci.0,addr=0x3 \
-chardev
file,id=charserial0,path=/var/lib/nova/instances/instance-0000003d/console.log
\
-device isa-serial,chardev=charserial0,id=serial0 -chardev
pty,id=charserial1 \
-device isa-serial,chardev=charserial1,id=serial1 -device
usb-tablet,id=input0 \
-netdev tap,fd=30,id=hostnet0 -device
rtl8139,netdev=hostnet0,id=net0,mac=fa:16:3e:39:23:6f,bus=pci.0,addr=0x4 \
-vnc 127.0.0.1:3 -k en-us -vga cirrus -device
virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6
11 years, 5 months
[libvirt-users] Problem with net-define using Open vSwitch bridge
by Will Dennis
Hi all,
I used "net-define" to create a network to use to attach VMs to an Open vSwitch bridge. The net-define worked fine, I can see the network in "net-list" (I set it to started and to autostart) but when I try to attach a new VM's NIC to this network (via virt-manager), I'm getting the following traceback:
Unable to complete install: 'Unable to add bridge vl10-ovsbr0 port vnet0: Operation not supported'
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 96, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/create.py", line 1943, in do_install
guest.start_install(False, meter=meter)
File "/usr/lib/python2.7/site-packages/virtinst/Guest.py", line 1249, in start_install
noboot)
File "/usr/lib/python2.7/site-packages/virtinst/Guest.py", line 1317, in _create_guest
dom = self.conn.createLinux(start_xml or final_xml, 0)
File "/usr/lib64/python2.7/site-packages/libvirt.py", line 2606, in createLinux
if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: Unable to add bridge vl10-ovsbr0 port vnet0: Operation not supported
I'm going to assume the problem is that the bridge is not a linux bridge, but an Open vSwitch bridge. But I did have a line in the XML file that I used for net-define as follows:
<virtualport type='openvswitch'/>
But when I ran net-define, it failed to create the network with the error:
XML error: unexpected virtualport type -1
Removing that line and re-running the net-define worked, as I have stated above. How do I tell libvirt that this bridge is an Open vSwitch bridge and not a regular Linux bridge?
Thanks,
Will
11 years, 5 months
[libvirt-users] Issue with macvtap bridge and forwarding
by Matt LaPlante
I have three hosts running Ubuntu 12.04 (libvirt 0.9.8). The
configuration is one host running on bare metal while the other two
are KVM guests.
The first guest is my network router. It has a direct connection to a
physical nic going out to the internet, and a bridged connection to a
nic for the lan. The host has ip forwarding enabled and forwards my
lan traffic back and forth to the internet.
The second host is a "lan" machine, which is also on the bridged lan
nic. There are several other physical hosts also on the switched lan
network this nic connects to.
Both hosts are configured on the lan tap as follows (different mac):
<interface type='direct'>
<mac address='13:54:21:1f:f3:42'/>
<source dev='eth1' mode='bridge'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
Everything on the firewall host seems to work OK. Hosts elsewhere on
the LAN can connect to it, and they have no problem routing through it
and out to the internet and back. That is, traffic passes through
both nics and this host successfully.
The other guest can also be reached successfully from machines on the
LAN. I can ping it and I can ssh to it. I also note that it seems to
be able to be able to talk to the "router" host over the vtap bridge:
it can perform dns lookups against the router host, and they can seem
to reach each other's ports.
Where I'm getting stuck is that for whatever reason, the second guest
apparently cannot reach the internet via my router host. It's the
only host anywhere on the lan that apparently can't pass forwarding
traffic via the router guest, and the only common feature appears to
be the macvtap bridge. This issue *does not* happen when using a
common linux bridge in the otherwise same configuration and the same
hosts. In the linux bridge scenario, the lan guest forwards traffic
via the router guest fine. But when switching to the macvtap
configuration, suddenly the lan guest no longer forwards traffic via
the router guest and out to the internet.
What appears to be happening is that the traffic is crossing the
bridge, but the router host does not classify it or masq it properly,
and it never makes the internet trip as expected. Further extending
my suspicions, initiating an outbound http connection does not raise
an entry in the conntrack table on the router for the problem host.
So my question is, what is it about macvtap bridge that would cause
traffic coming over via the tap bridge to be routed differently than
traffic coming *up* the bridge from the physical interface, or via a
traditional linux bridge?
11 years, 5 months
[libvirt-users] How to device port on the controller
by Daniele Testa
Hi,
I am adding a disk to my KVM virtual server, but for some reason it refuses
to honor the <address>
I have tried the following 3:
<disk type='block' device='disk'>
<driver name='phy' type='raw'/>
<source dev='/dev/nbd2'/>
<target dev='vdb' bus='virtio'/>
<serial>my-fake-serial</serial>
<address type='drive' controller='0' bus='1' target='3' unit='2'/>
</disk>
<disk type='block' device='disk'>
<driver name='phy' type='raw'/>
<source dev='/dev/nbd2'/>
<target dev='vdb' bus='virtio'/>
<serial>my-fake-serial</serial>
<address type='pci' bus='0x00' slot='0x08' function='0x0'/>
</disk>
<disk type='block' device='disk'>
<driver name='phy' type='raw'/>
<source dev='/dev/nbd2'/>
<target dev='vdb' bus='virtio'/>
<serial>my-fake-serial</serial>
<address type='virtio-serial' controller='0' bus='0' port='8'/>
</disk>
I would assume the last one is the one to use, as I am using a "virtio"
bus. However, the <address> attribute is simply ignored and the disk is
always attached as this:
pci-0000:00:05.0
Further, how do I read the "my-fake-serial" from within the virtual machine?
I have tried using this:
udevadm info -a -p $(udevadm info -q path -n /dev/vdb)
But it does not show the serial string there anywhere.
Regards,
Daniele
11 years, 5 months
[libvirt-users] fail to convert qemu xml to args with libvirt-1.0.4: An error occurred, but the cause is unknown
by Yin Olivia-R63875
Hi,
I used to convert qemu XML to args with libvirt-1.0.3.
But it failed to convert with libvirt-1.0.4.
# virsh domxml-to-native qemu-argv test.xml >test.sh
error: An error occurred, but the cause is unknown
Comparing the debug file as below:
1) lbvirt-1.0.3
<cut>
2013-04-09 03:23:47.296+0000: 2669: debug : virEventPollInterruptLocked:716 : Interrupting
2013-04-09 03:23:47.296+0000: 2669: debug : virNetClientIO:1807 : All done with our call head=(nil) call=0x100871c0 rv=0
2013-04-09 03:23:47.297+0000: 2670: debug : virEventPollRunOnce:640 : Poll got 1 event(s)
2013-04-09 03:23:47.297+0000: 2670: debug : virEventPollDispatchTimeouts:425 : Dispatch 0
2013-04-09 03:23:47.297+0000: 2669: debug : virNetMessageFree:73 : msg=0x10087500 nfds=0 cb=(nil)
2013-04-09 03:23:47.297+0000: 2670: debug : virEventPollDispatchHandles:470 : Dispatch 1
2013-04-09 03:23:47.297+0000: 2670: debug : virEventPollDispatchHandles:484 : i=0 w=1
2013-04-09 03:23:47.297+0000: 2669: debug : virConnectClose:1483 : conn=0x100878b8
<cut>
2) libvirt-1.0.4
<cut>
2013-04-09 03:07:58.012+0000: 2834: debug : virEventPollInterruptLocked:716 : Interrupting
2013-04-09 03:07:58.012+0000: 2834: debug : virNetClientIO:1810 : All done with our call head=(nil) call=0x10089db8 rv=0
2013-04-09 03:07:58.012+0000: 2835: debug : virEventPollRunOnce:640 : Poll got 1 event(s)
2013-04-09 03:07:58.012+0000: 2835: debug : virEventPollDispatchTimeouts:425 : Dispatch 0
2013-04-09 03:07:58.012+0000: 2834: error : virNetClientProgramDispatchError:175 : An error occurred, but the cause is unknown
2013-04-09 03:07:58.012+0000: 2835: debug : virEventPollDispatchHandles:470 : Dispatch 1
2013-04-09 03:07:58.012+0000: 2834: debug : virNetMessageFree:73 : msg=0x1008a0f8 nfds=0 cb=(nil)
2013-04-09 03:07:58.012+0000: 2835: debug : virEventPollDispatchHandles:484 : i=0 w=1
2013-04-09 03:07:58.012+0000: 2835: debug : virEventPollDispatchHandles:498 : EVENT_POLL_DISPATCH_HANDLE: watch=1 events=1
2013-04-09 03:07:58.012+0000: 2835: debug : virEventPollCleanupTimeouts:516 : Cleanup 0
2013-04-09 03:07:58.013+0000: 2835: debug : virEventPollCleanupTimeouts:552 : Found 0 out of 0 timeout slots used, releasing 0
2013-04-09 03:07:58.013+0000: 2835: debug : virEventPollCleanupHandles:564 : Cleanup 2
2013-04-09 03:07:58.013+0000: 2834: debug : virConnectClose:1483 : conn=0x1008a4b0
<cut>
How can I debug this cause unknown error?
Best Regards,
Olivia
11 years, 5 months
[libvirt-users] remote connection issue 'virsh -c qemu+ssh:///root@localhost/system list'
by Yin Olivia-R63875
Hi,
I'm trying remote connection with qemu hypervisor on FSL PPC board.
The libvirt server is the PPC board.
root@ppc:~# ifconfig eth0 10.193.20.109
root@ppc:~# libvirtd -d
root@ppc:~# virsh -c qemu:///system define test.xml
root@ppc:~# virsh -c qemu:///system start test
root@ppc:~# virsh -c qemu:///system list --all
Id Name State
----------------------------------------------------
2 test running
Connect from an X86 PC (Ubuntu 10.04) to the PPC board.
user@x86:~$ virsh -c qemu+ssh://root@10.193.20.109/system list --all
The authenticity of host '10.193.20.109 (10.193.20.109)' can't be established.
RSA key fingerprint is 2f:56:07:08:da:7d:ac:41:45:57:d2:12:15:19:67:e0.
Are you sure you want to continue connecting (yes/no)? yes
root(a)10.193.20.109's password:
error: failed to connect to the hypervisor
error: End of file while reading data: Warning: Permanently added '10.193.20.109' (RSA) to the list of known hosts.
nc: invalid option -- 'U'
BusyBox v1.19.4 (2013-03-08 13:08:18 CST) multi-call binary.
Usage: nc [-iN] [-wN] [-l] [-p PORT] [-f FILE|IPADDR PORT] [-e PROG]: Input/output error
I tried to verify the remote connection on localhost. But it also failed as below:
root@mpc8572ds:~# virsh -c qemu+ssh:///root@localhost/system list --all
root@localhost's password:
error: failed to connect to the hypervisor
error: End of file while reading data: nc: invalid option -- 'U'
BusyBox v1.19.4 (2013-03-08 13:08:18 CST) multi-call binary.
Usage: nc [-iN] [-wN] [-l] [-p PORT] [-f FILE|IPADDR PORT] [-e PROG]: Input/output error
Could anyone give suggestion on this issue?
Best Regards,
Olivia
11 years, 5 months
[libvirt-users] libvirt, selinux, moving images to ~/images does not work
by Alexey Kardashevskiy
Hi!
I am trying libvirt on POWERPC64 with the default settings such as selinux
enabled. It is all good till I move images out of /var/lib/libvirt/images/.
http://libvirt.org/drvqemu.html#securityselinux is saying that "If
attempting to use disk images in another location, the user/administrator
must ensure the directory has be given this requisite label. Likewise
physical block devices must be labelled system_u:object_r:virt_image_t.".
So did I:
[root@vpl2 ~]# ls -dlZ /home/aik/virtimg /var/lib/libvirt/images
drwxr-xr-x. root root system_u:object_r:virt_image_t:s0 /home/aik/virtimg
drwxr-xr-x. root root system_u:object_r:virt_image_t:s0 /var/lib/libvirt/images
[root@vpl2 ~]# ls -lZ /home/aik/virtimg /var/lib/libvirt/images
/home/aik/virtimg:
-rwxrwxrwx. root root system_u:object_r:virt_content_t:s0
Fedora-18-ppc64-DVD.iso
/var/lib/libvirt/images:
-rwxrwxrwx. root root system_u:object_r:virt_image_t:s0 fc18guest
However "virsh -c qemu:///system create libvirtguest-aik.xml" failes with
"avc: denied { dac_override }" and "avc: denied { dac_read_search }".
Also, there is "user system_u is not defined" in /var/log/messages what is
confusing as "semanage user -l" says it is there.
If I simply move Fedora-18-ppc64-DVD.iso to /var/lib/libvirt/images, the
problem goes away and everything works fine.
I am running custom build 3.8 kernel and libvirt from git ("eebbb23 qemu:
support URI syntax for NBD").
More detailed output is below, this is all from the host system.
What do I miss? Thank you.
[root@vpl2 ~]# tail /var/log/messages
Apr 8 16:47:48 vpl2 dbus-daemon[2903]: libsepol.sepol_context_to_sid:
could not convert system_u:system_r:svirt_t:s0:c263,c837 to sid
Apr 8 16:47:48 vpl2 dbus-daemon[2903]: libsepol.context_from_record: user
system_u is not defined
Apr 8 16:47:48 vpl2 dbus-daemon[2903]: libsepol.context_from_record: could
not create context structure
Apr 8 16:47:48 vpl2 dbus-daemon[2903]: libsepol.context_from_string: could
not create context structure
Apr 8 16:47:48 vpl2 dbus-daemon[2903]: libsepol.sepol_context_to_sid:
could not convert system_u:system_r:svirt_t:s0:c263,c837 to sid
Apr 8 16:47:48 vpl2 dbus-daemon[2903]: libsepol.context_from_record: user
system_u is not defined
Apr 8 16:47:48 vpl2 dbus-daemon[2903]: libsepol.context_from_record: could
not create context structure
Apr 8 16:47:48 vpl2 dbus-daemon[2903]: libsepol.context_from_string: could
not create context structure
Apr 8 16:47:48 vpl2 dbus-daemon[2903]: libsepol.sepol_context_to_sid:
could not convert system_u:system_r:svirt_t:s0:c263,c837 to sid
Apr 8 16:47:48 vpl2 libvirtd[5041]: failed to connect to monitor socket:
No such process
[root@vpl2 ~]# semanage user -l
Labeling MLS/ MLS/
SELinux User Prefix MCS Level MCS Range
SELinux Roles
git_shell_u user s0 s0
git_shell_r
guest_u user s0 s0 guest_r
root user s0 s0-s0:c0.c1023
staff_r sysadm_r system_r unconfined_r
staff_u user s0 s0-s0:c0.c1023
staff_r sysadm_r system_r unconfined_r
sysadm_u user s0 s0-s0:c0.c1023 sysadm_r
system_u user s0 s0-s0:c0.c1023
system_r unconfined_r
unconfined_u user s0 s0-s0:c0.c1023
system_r unconfined_r
user_u user s0 s0 user_r
xguest_u user s0 s0 xguest_r
[root@vpl2 ~]# tail /var/log/audit/audit.log
type=NETFILTER_CFG msg=audit(1365403596.177:4507): table=nat family=2
entries=60
type=NETFILTER_CFG msg=audit(1365403596.177:4508): table=nat family=2
entries=61
type=AVC msg=audit(1365403606.017:4509): avc: denied { dac_override } for
pid=8944 comm="qemu-system-ppc" capability=1
scontext=system_u:system_r:svirt_t:s0:c574,c809
tcontext=system_u:system_r:svirt_t:s0:c574,c809 tclass=capability
type=AVC msg=audit(1365403606.017:4510): avc: denied { dac_read_search }
for pid=8944 comm="qemu-system-ppc" capability=2
scontext=system_u:system_r:svirt_t:s0:c574,c809
tcontext=system_u:system_r:svirt_t:s0:c574,c809 tclass=capability
type=AVC msg=audit(1365403606.017:4511): avc: denied { dac_override } for
pid=8944 comm="qemu-system-ppc" capability=1
scontext=system_u:system_r:svirt_t:s0:c574,c809
tcontext=system_u:system_r:svirt_t:s0:c574,c809 tclass=capability
type=AVC msg=audit(1365403606.017:4512): avc: denied { dac_read_search }
for pid=8944 comm="qemu-system-ppc" capability=2
scontext=system_u:system_r:svirt_t:s0:c574,c809
tcontext=system_u:system_r:svirt_t:s0:c574,c809 tclass=capability
type=AVC msg=audit(1365403606.017:4513): avc: denied { dac_override } for
pid=8944 comm="qemu-system-ppc" capability=1
scontext=system_u:system_r:svirt_t:s0:c574,c809
tcontext=system_u:system_r:svirt_t:s0:c574,c809 tclass=capability
type=AVC msg=audit(1365403606.017:4514): avc: denied { dac_read_search }
for pid=8944 comm="qemu-system-ppc" capability=2
scontext=system_u:system_r:svirt_t:s0:c574,c809
tcontext=system_u:system_r:svirt_t:s0:c574,c809 tclass=capability
type=AVC msg=audit(1365403606.017:4515): avc: denied { dac_override } for
pid=8944 comm="qemu-system-ppc" capability=1
scontext=system_u:system_r:svirt_t:s0:c574,c809
tcontext=system_u:system_r:svirt_t:s0:c574,c809 tclass=capability
type=AVC msg=audit(1365403606.017:4516): avc: denied { dac_read_search }
for pid=8944 comm="qemu-system-ppc" capability=2
scontext=system_u:system_r:svirt_t:s0:c574,c809
tcontext=system_u:system_r:svirt_t:s0:c574,c809 tclass=capability
[root@vpl2 ~]# libvirtd --version
libvirtd (libvirt) 1.0.3
[root@vpl2 ~]# yum info policycoreutils
[...]
Arch : ppc64
Version : 2.1.13
Release : 59.fc18
Size : 3.8 M
[root@vpl2 ~]# cat /etc/fedora-release
Fedora release 18 (Spherical Cow)
[root@vpl2 ~]# uname -a
Linux vpl2.ozlabs.ibm.com 3.8.0-kvm-64k-aik+ #376 SMP Mon Apr 8 14:40:40
EST 2013 ppc64 ppc64 ppc64 GNU/Linux
[aik@vpl2 ~]$ cat libvirtguest-aik.xml
<domain type='kvm'>
<name>AikLibvirtTest</name>
<memory>2097152</memory>
<vcpu>2</vcpu>
<os>
<type arch='ppc64' machine='pseries'>hvm</type>
<boot dev='cdrom'/>
<boot dev='hd'/>
</os>
<clock offset='utc'/>
<devices>
<emulator>/usr/local/bin/qemu-system-ppc64</emulator>
<disk type='file' device='disk' >
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/images/fc18guest'/>
<target dev='sda' bus='scsi'/>
</disk>
<disk type='file' device='cdrom' >
<driver name='qemu' type='raw'/>
<source file='/home/aik/virtimg/Fedora-18-ppc64-DVD.iso'/>
<target dev='sdc' bus='scsi'/>
<readonly/>
</disk>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<memballoon model='virtio'/>
</devices>
</domain>
--
Alexey
11 years, 5 months
[libvirt-users] VNC Server in libvirt
by Jaime Loureiro Acuña
My name is Jaime Loureiro and I work in the Network & Applications area in
University of Vigo. I am writing to you hoping you can help me with some
libvirt graphics issues.
I was analysing the source code of the libvirt in order to find how to
access the display of each virtual machine. We are trying to generate a
video streaming from the graphics content, though it is not easy to find
what function is the most appropriate to do that. We tried to use the
screenshot feature, but the rate is to low to generate a smooth streaming.
I suposse the vnc server is reading the graphics output of each virtual
machine at a low level, however I cannot find the exact point where the
server is. Currently I am trying to understand the function
"virDomainOpenGraphics" in libvirt.c and, at a lower level, the function
"qemuProcessHandleGraphics" in qemu_process.c, but I 'm not sure if it is
possible to get what we need from them.
I would appreciate any help or clue you could provide regarding this issue.
Thank you very much in advance.
Best regards,
11 years, 5 months
[libvirt-users] reset = destroy start
by 邓焕聪
what is different between destroy -> start and reset in virsh?
i meet this position , when i reset a domain, it cannot start , it stoped at initialize initd.but when i destory it ,and start it , it can run normally.
i am very confuse about them.
who can tell me the difference....
thanks a lots.
11 years, 5 months