[libvirt-users] ceph rbd pool and libvirt manageability (virt-install)
by Jelle de Jong
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello everybody,
I created a rbd pool and activated it, but I can't seem to create
volumes in it with virsh or virt-install?
# virsh pool-dumpxml myrbdpool
<pool type='rbd'>
<name>myrbdpool</name>
<uuid>2d786f7a-2df3-4d79-ae60-1535bcf1c6b5</uuid>
<capacity unit='bytes'>6997998301184</capacity>
<allocation unit='bytes'>10309227031</allocation>
<available unit='bytes'>6977204658176</available>
<source>
<host name='ceph01.powercraft.nl' port='6789'/>
<host name='ceph02.powercraft.nl' port='6789'/>
<host name='ceph03.powercraft.nl' port='6789'/>
<name>libvirt-pool</name>
<auth type='ceph' username='libvirt'>
<secret uuid='029a334e-ed57-4293-bb99-ffafa8867122'/>
</auth>
</source>
</pool>
# virt-install --version
1.0.1
# virsh --version
1.2.9
I ended using virsh edit ceph-test.powercraft.nl and making creating
the disk manually.
<disk type='network' device='disk'>
<auth username='libvirt'>
<secret type='ceph' uuid='029a334e-ed57-4293-bb99-ffafa8867122'/>
</auth>
<source protocol='rbd' name='libvirt-pool/kvm01-storage'>
<host name='ceph01.powercraft.nl' port='6789'/>
<host name='ceph02.powercraft.nl' port='6789'/>
<host name='ceph03.powercraft.nl' port='6789'/>
</source>
<target dev='vdc' bus='virtio'/>
</disk>
I use virt-install a lot to define, import and undefine domains, how
can I use virt-install to manage my rdb disks?
Kind regards,
Jelle de Jong
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iJwEAQECAAYFAlV1xlQACgkQ1WclBW9j5HkbPQP+PjNrzvlqysslOp2Yk7wH4Mxy
2sh2dn96G0KOAHEeEn3BN6IWlnD1TADZbHdpTtMwkdv48Xwn0sP1s+3QDM4pb3gP
n+z+dVxS8FouDIy/eiso3IBCj3g4TWbEX8ZHqs3jKqe0lZgAXBzB9xYSUowcEBrZ
ddkPbr8p8ozWyOG+9V8=
=lkK7
-----END PGP SIGNATURE-----
6 years, 4 months
[libvirt-users] virRandomBits - not very random
by Brian Rak
I just ran into an issue where I had about 30 guests get duplicate mac
addresses assigned. These were scattered across 30 different machines.
Some debugging revealed that:
1) All the host machines were restarted within a couple seconds of each
other
2) All the host machines had fairly similar libvirtd pids (within ~100
PIDs of each other)
3) Libvirt seeds the RNG using 'time(NULL) ^ getpid()'
This perfectly explains why I saw so many duplicate mac addresses.
Why is the RNG seed such a predictable value? Surely there has to be a
better source of a random seed then the timestamp and the pid?
The PID seems to me to be a very bad source of any randomness. I just
ran a test across 60 of our hosts. 43 of them shared their PID with at
least one other machine.
6 years, 7 months
[libvirt-users] stream finish throws exception via python API
by Shahar Havivi
Hi,
The following snippet works fine e.g. receiving the data but when calling
stream.finish() we get the following error:
stream = con.newStream()
vol.download(stream, 0, 0, 0)
buf = stream.recv(1024)
stream.finish()
libvirt: I/O Stream Utils error : internal error: I/O helper exited abnormally
Traceback (most recent call last):
File "./helpers/kvm2ovirt", line 149, in <module>
download_volume(vol, item[1], diskno, disksitems, pksize)
File "./helpers/kvm2ovirt", line 102, in download_volume
stream.finish()
File "/usr/lib64/python2.7/site-packages/libvirt.py", line 5501, in finish
if ret == -1: raise libvirtError ('virStreamFinish() failed')
libvirt.libvirtError: internal error: I/O helper exited abnormally
Am I doing something wrong?
Thank you,
Shahar.
8 years, 1 month
[libvirt-users] Guest startup process blocks if a hook's child process is still running (i.e : after forking)
by Nicolas Roy-Renaud
I've been having issues with KVM lately where I sometimes put my host
into sleep while a guest is still running, which prevents it from waking
up properly. This is somewhat expected due to my setup, but I have
mistakenly done this more than once and could use a workaround to stop
this from happening.
So I've been trying to setup a libvirt hook to fork an instance of
systemd-inhibit when the start hook is called and keep it running until
the shutdown hook is called. This seems to work well when I run the hook
script in a normal bash shell, but running it through libvirt simply
blocks the starting process until systemd-inhibit quits.
Here's the script :
LOCK_FILE="/tmp/vfio-lock-$OBJECT"
if [ "$OPERATION" == "start" ]; then
(
touch "$LOCK_FILE";
systemd-inhibit --what="sleep" \
--who="libvirt" \
--mode="block" \
inotifywait -qq -e delete "$LOCK_FILE"
) & disown $!
exit
fi
if [ "$OPERATION" == "shutdown" ]; then
rm "$LOCK_FILE"
fi
Is there some way to make it so libvirt sees the hook script exiting and
carries on with the rest of its guest startup process even after a
process fork or would that require changes in the internal hook handling
functions?
- Nicolas
8 years, 1 month
[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, 1 month
[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, 1 month
[libvirt-users] How do you set real time bandwidth for a container?
by Peter Steele
When I create a VM using libvirt, the VM comes up the path
/sys/fs/cgroup/cpu/cpu.rt_runtime_us set to something like 1000000. When
I create a container however, the path
/sys/fs/cgroup/cpu/cpu.rt_runtime_us is 0. This prevents my containers
from being able to run any real time applications. I have to explicitly
echo a value into this field in order to give the container some real
time bandwidth and allow it to run real time processes.
Is it possible to define this in a container's XML config? Or is there
another method I should be using to enable real time capability in a
container?
Peter
8 years, 1 month
[libvirt-users] command guest-file-open failed to open file - Permission denied
by 刘梦可
hello,
I am using libvirt 1.2.17 on CentOS 7.2 - kernel
3.10.0-327.13.1.el7.x86_64. The command guest-file-open failed to open
file with error "Permission denied", the detail is as below:
virsh qemu-agent-command instance-00000a9c
'{"execute":"guest-file-open",
"arguments":{"path":"/home/centos/test","mode":"r"}}'
error: internal error: unable to execute QEMU agent command
'guest-file-open': failed to open file '/home/centos/test' (mode:
'r'): Permission denied
In the guest, the file '/home/centos/test' exist and the access
permissions is 777 as below:
-rwxrwxrwx. 1 centos centos 18 Oct 27 11:16 test
How can I fix it?
Thanks very much!!!
-mkliu28
8 years, 1 month
Re: [libvirt-users] Libvirt newer than 2.1.0 doesnt start up
by Rene Pasing
Hi all,
thanks so far for your time and ideas.
Please find the gdb output and also the debug-output of libvirt (as
requested by Michal Privoznik and Laine Stump) here:
https://paste.xinu.at/m-gPSHl/
On 10/19/2016 01:58 AM, Michal Privoznik wrote:
> Those "Network is already in use by interface virbr1" error messages
> worry me. Is the bridge active before you start libvirtd? If so we might
> be losing netowrk state XML (or fail to parse it) and thus think network
> is not started and because of autostart we try to start it again (which
> fails).
> [...]
> Before you start libvirt, are there any files under
> /var/run/libvirt/network/ ? If so, what's their content?
Laine was already correct about that, this error message only appears
when I manually try to restart libvirt after it already hung up. Maybe I
should've made that more clear. Additionaly, no, there are no files in
that directory, also I am pretty sure that I only got one instance of
libvirt running
According to the GDB log, the libvirt process is endlessly iterating
over [1]. Any ideas what could be wrong?
Thanks in advance
Regards
Rene
[1] =
https://github.com/libvirt/libvirt/blob/master/src/network/bridge_driver....
8 years, 2 months