[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, 2 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, 5 months
[libvirt-users] virDomainCoreDumpWithFormat files created as root
by NoxDaFox
Greetings,
I am dumping a guest VM memory for inspection using the command
"virDomainCoreDumpWithFormat" and the created files appear to belong to
root (both user and group).
I have searched around but didn't find any answer. Is there a way to
instruct QEMU to create those files under a different user?
Thank you.
9 years
[libvirt-users] libvirt 1.19: could not open drive file (permission denied)
by crequill
Hi,
With libvrit 1.18 all is working fine: I can open my win7 VM on
Archlinux without problem.
But I cannot use it with libvirt 1.19: it could not open drive file
(permission denied).
In /etc/libvirt/qemu.conf, I have:
- user: root
- group: root
And the drive file has root:root as owner.
Why this configuration is running with libvirt 1.18 and not with libvirt 1.19 ?
Many thanks for your reply.
Christophe
9 years, 1 month
[libvirt-users] VirtualBox + Virsh
by Julian Zhou
Hi I am trying to add a virtualbox domain to my virsh installation, I get:
error: Failed to define domain from Ondria.xml
>>https://gist.github.com/jztech101/5aeebb82412c1910dc1f<< error:
internal error: unexpected domain type vbox, expecting one of these:
qemu, kqemu, kvm, xen.
virsh is compiled with VirtualBox support so I'm confused:
Virsh -V >> Virsh command line tool of libvirt 1.2.2
See web site athttp://libvirt.org/
Compiled with support for:
Hypervisors: QEMU/KVM LXC UML Xen LibXL OpenVZ VMWare VirtualBox Test
Networking: Remote Network Bridging Interface netcf Nwfilter VirtualPort
Storage: Dir Disk Filesystem SCSI Multipath iSCSI LVM RBD Sheepdog
Miscellaneous: Daemon Nodedev AppArmor Secrets Debug Readline Modular.
After some insight, I decided to run it like this instead: " virsh -c
vbox:///session create Ondria.xml"
Now I get:
error: failed to connect to the hypervisor
error: internal error: unable to initialize VirtualBox driver API
So, after further insight, I ran "export
VBOX_APP_HOME=/usr/lib/virtualbox" and tried again. Same error as above.
(/usr/lib/virtualbox is where VBoxCPCOMC.so lies and I'm told the reason
for the above error is it cannot find that file in any "normal"
location. Help? It should be noted I installed VirtualBox-5.0 directly
from the VBox Repo for Ubuntu 14.04LTS
Regards,
Julian Zhou
9 years, 1 month
[libvirt-users] Fw: libvirtd service not starting
by Jonathan Rurka
On Thursday, September 24, 2015 12:29 PM, Jonathan Rurka <jon.rurka(a)yahoo.com> wrote:
Yes the "which libvirtd" and "sudo virt-host-validate" commands return correct values However, I am having a new problem now; "UEFI" is not selectable under firmware: http://i.imgur.com/O4ypOTX.png I do have VT-d enabled in my bios, my processor supports VT-d, and I am booting ubuntu in UEFI mode. The yellow triangle says "Libvirt did not detect any UEFI/OVMF firmware image installed on the host.". Another person instructed me to set the nvram opeion in /etc/libvirt/qemu.conf to where I have my OVMF placed (which I downloaded from https://www.kraxel.org/repos/jenkins/edk2/), however it hasn't helped. it is set to:
nvram = [
"/usr/share/edk2.git/ovmf-x64/OVMF_pure-efi.fd:/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd"
]
On Thursday, September 24, 2015 3:29 AM, Kashyap Chamarthy <kchamart(a)redhat.com> wrote:
On Thu, Sep 24, 2015 at 06:47:43AM +0200, Martin Kletzander wrote:
> On Wed, Sep 23, 2015 at 11:00:34PM +0000, Jonathan Rurka wrote:
> >Hello, I'm new to using libvirt. After a few days of installing and
> >removing libvirt, virt-manager and a few others to get VT-d working
> >with a virtual machine, I finally got the latest virt-manager and
> >libvirt installed from source to get the most recent
> >versions. However, when I start up virt-manager I get a popup saying
> >"Unable to connect to libvirt; Verify that the 'libvirtd' deamon is
> >running.". When running "service libvirtd start", I get an error
> >saying libvirtd.service cannot be found. I can, however, use libvirtd
> >from the command line. The service file does not exist
> >in /lib/systemd/system/.
> >
>
> Did you probably forget to specify the prefix to install it into? you
> can do "which libvirtd" to see that you probably installed it into
> /usr/local/sbin. Specifying the prefix should help.
>
> Getting to your "to get VT-d working", you should check whether
> everything is enabled in BIOS. That's usually the case if it's not
> working for you.
[A small addendum to what Martin says.]
Jon, you can use `virt-host-validate` to check the above, if everything
is setup correctly, it should look like that:
$ sudo virt-host-validate
QEMU: Checking for hardware virtualization : PASS
QEMU: Checking for device /dev/kvm : PASS
QEMU: Checking for device /dev/vhost-net : PASS
QEMU: Checking for device /dev/net/tun : PASS
LXC: Checking for Linux >= 2.6.26 : PASS
[. . .]
--
/kashyap
9 years, 2 months
[libvirt-users] PCI passthrough fails in virsh: iommu group is not viable
by Alex Holst
I would really appreciate some pointers on what I am doing wrong here.
I have a need to run multiple virtual guests which have each their own GPU and
some USB controllers passed-through. I am able to run one of the guests like
this (assuming vfio stuff has happened elsewhere), but I would prefer to use
virsh:
kvm -M q35 -m 8192 -cpu host,kvm=off \
-smp 4,sockets=1,cores=4,threads=1 \
-bios /usr/share/seabios/bios.bin -vga none \
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
-device vfio-pci,host=02:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on \
-device vfio-pci,host=02:00.1,bus=root.1,addr=00.1 \
-device vfio-pci,host=00:1d.0,bus=pcie.0 \
-device vfio-pci,host=00:1a.0,bus=pcie.0 \
-nographic -boot menu=on /vm2/foo.img
I found the hardware addresses using lspci. When I invoke the same machine with virsh with what
I believe are the same addresses, I get:
virsh # start foo
error: Failed to start domain foo
error: internal error: process exited while connecting to monitor: 2015-08-12T18:24:10.651720Z qemu-system-x86_64: -device vfio-pci,host=02:00.0,id=hostdev0,bus=pci.0,addr=0x4: vfio: error, group 18 is not viable, please ensure all devices within the iommu_group are bound to their vfio bus driver.
2015-08-12T18:24:10.651752Z qemu-system-x86_64: -device vfio-pci,host=02:00.0,id=hostdev0,bus=pci.0,addr=0x4: vfio: failed to get group 18
2015-08-12T18:24:10.651766Z qemu-system-x86_64: -device vfio-pci,host=02:00.0,id=hostdev0,bus=pci.0,addr=0x4: Device initialization failed.
2015-08-12T18:24:10.651781Z qemu-system-x86_64: -device vfio-pci,host=02:00.0,id=hostdev0,bus=pci.0,addr=0x4: Device 'vfio-pci' could not be initialized
I have included dumpxml output below -- is the hostdev section wrong?
<domain type='kvm'>
<name>foo</name>
<uuid>51f57655-11be-41bf-b925-2e6aef01f9c4</uuid>
<memory unit='KiB'>8388608</memory>
<currentMemory unit='KiB'>8388608</currentMemory>
<vcpu placement='static' current='1'>4</vcpu>
<os>
<type arch='x86_64' machine='pc-i440fx-utopic'>hvm</type>
<bootmenu enable='yes'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
<hyperv>
<relaxed state='on'/>
<vapic state='on'/>
<spinlocks state='on' retries='8191'/>
</hyperv>
</features>
<cpu mode='custom' match='exact'>
<model fallback='allow'>SandyBridge</model>
<topology sockets='1' cores='4' threads='1'/>
</cpu>
<clock offset='localtime'>
<timer name='rtc' tickpolicy='catchup'/>
<timer name='pit' tickpolicy='delay'/>
<timer name='hpet' present='no'/>
<timer name='hypervclock' present='yes'/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<pm>
<suspend-to-mem enabled='no'/>
<suspend-to-disk enabled='no'/>
</pm>
<devices>
<emulator>/usr/bin/kvm-spice</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/vm2/foo.img'/>
<target dev='sda' bus='sata'/>
<boot order='1'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='block' device='cdrom'>
<driver name='qemu' type='raw'/>
<target dev='hdb' bus='ide'/>
<readonly/>
<boot order='2'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
<controller type='usb' index='0' model='ich9-ehci1'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x7'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci1'>
<master startport='0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0' multifunction='on'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci2'>
<master startport='2'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x1'/>
</controller>
<controller type='usb' index='0' model='ich9-uhci3'>
<master startport='4'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'/>
<controller type='ide' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<controller type='virtio-serial' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</controller>
<controller type='sata' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</controller>
<interface type='direct'>
<mac address='52:54:00:f0:47:f5'/>
<source dev='p5p1' mode='bridge'/>
<model type='e1000'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<channel type='spicevmc'>
<target type='virtio' name='com.redhat.spice.0'/>
<address type='virtio-serial' controller='0' bus='0' port='1'/>
</channel>
<input type='tablet' bus='usb'/>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='spice' autoport='yes'/>
<video>
<model type='cirrus' vram='16384' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
</source>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</hostdev>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</memballoon>
</devices>
</domain>
--
Alex Holst
9 years, 2 months
[libvirt-users] Guest cpuacct counters and others location
by Jean-Pierre Ribeauville
Hi,
My piece of code ( C langage) uses cgroups to retrieve counters related to cpu and memory usage related to KVM guests hosted by the host where this code runs.
I noticed that depending on the O.S. running on the host , these counters are not found at the same location :
CentOS 7 :
ls /sys/fs/cgroup/cpuacct/machine.slice/machine-qemu\\x2drhel6.0.scope/vcpu0
cgroup.clone_children cgroup.procs cpuacct.usage cpu.cfs_period_us cpu.rt_period_us cpu.shares notify_on_release
cgroup.event_control cpuacct.stat cpuacct.usage_percpu cpu.cfs_quota_us cpu.rt_runtime_us cpu.stat tasks
]#
RHEL6 :
ls /cgroup/cpuacct/libvirt/qemu/VM_Orion-1/vcpu0
cgroup.event_control cgroup.procs cpuacct.stat cpuacct.usage cpuacct.usage_percpu notify_on_release tasks
1) May I assume that their meanings is identical ?
2) Is this difference due to the O.S. or to libvirt ?
3) I presume I've to check this point on Ubuntu , Debian and Fedora .
Thanks
J.P. Ribeauville
P: +33.(0).1.47.17.20.49
.
Puteaux 3 Etage 5 Bureau 4
jpribeauville(a)axway.com<mailto:jpribeauville@axway.com>
http://www.axway.com<http://www.axway.com/>
P Pensez à l'environnement avant d'imprimer.
9 years, 2 months