On Sun, Sep 15, 2013 at 12:57:13PM +0200, Gianluca Cecchi wrote:
On Sun, Sep 15, 2013 at 11:54 AM, Dan Kenigsberg wrote:
> Would you be kind to try starting a VM from virsh, where the VM image is
> out of ovirt's repor?
>
> I am asking you to have a VM image somewhere on your local disk, chown
> it to vdsm:kvm mode 0660, create a libvirt domxml for it (something
> simple, no spice or encryption), and try to start it up.
>
> Would this fail to start with the same permission issue, and the issue
> is again solved by `chown vdsm:qemu` ? If so, please copy libvir-list
> with your reply.
>
> Dan.
It seems it doesn't solve for me...
see below
[root@tekkaman ~]# saslpasswd2 -a libvirt virshuser
[root@tekkaman ~]# qemu-img create -f qcow2
/var/lib/libvirt/images/testvm.img 4G
Formatting '/var/lib/libvirt/images/testvm.img', fmt=qcow2
size=4294967296 encryption=off cluster_size=65536 lazy_refcounts=off
[root@tekkaman ~]# chown vdsm.kvm /var/lib/libvirt/images/testvm.img
[root@tekkaman ~]# chmod 0660 /var/lib/libvirt/images/testvm.img
[root@tekkaman ~]# virsh define /tmp/testvm2.xml
Please enter your authentication name: virshuser
Please enter your password:
Domain testvm2 defined from /tmp/testvm2.xml
[root@tekkaman ~]# ll /etc/libvirt/qemu
total 8
drwx------. 3 root root 4096 Aug 2 01:41 networks
-rw-------. 1 root root 2367 Sep 15 12:48 testvm2.xml
[root@tekkaman ~]# virsh start testvm2
Please enter your authentication name: virshuser
Please enter your password:
error: Failed to start domain testvm2
error: internal error Process exited while reading console log output:
char device redirected to /dev/pts/2
((null):19320): Spice-Warning **: reds.c:3247:reds_init_ssl: Could not
use private key file
This means you still have spice in your xml. That's ok, but then, to
test my theory you'd need to chgrp your spice private key as well.
Could you do that?
qemu-kvm: failed to initialize spice server
[root@tekkaman ~]# ll /var/lib/libvirt/images/
total 136
-rw-rw----. 1 vdsm kvm 197120 Sep 15 12:24 testvm.img
[root@tekkaman ~]# chgrp qemu /var/lib/libvirt/images/testvm.img
[root@tekkaman ~]# ll /var/lib/libvirt/images/
total 136
-rw-rw----. 1 vdsm qemu 197120 Sep 15 12:24 testvm.img
[root@tekkaman ~]# virsh start testvm2
Please enter your authentication name: virshuser
Please enter your password:
error: Failed to start domain testvm2
error: internal error Process exited while reading console log output:
char device redirected to /dev/pts/2
((null):19434): Spice-Warning **: reds.c:3247:reds_init_ssl: Could not
use private key file
qemu-kvm: failed to initialize spice server
[root@tekkaman ~]# virsh list --all
Please enter your authentication name: virshuser
Please enter your password:
Id Name State
----------------------------------------------------
- testvm2 shut off
In attach the generated testvm2.xml in /etc/libvirt/qemu.
The diff between it and the one used to define domain here:
[root@tekkaman ~]# diff /tmp/testvm2.xml /etc/libvirt/qemu/testvm2.xml
0a1,7
> <!--
> WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
> OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
> virsh edit testvm2
> or other application using the libvirt API.
> -->
>
3,5c10,13
< <memory>1048576</memory>
< <currentMemory>1048576</currentMemory>
< <vcpu>1</vcpu>
---
> <uuid>91d6012b-043f-2ea0-fcf8-dfa4fcda5b62</uuid>
> <memory unit='KiB'>1048576</memory>
> <currentMemory unit='KiB'>1048576</currentMemory>
> <vcpu placement='static'>1</vcpu>
32c40
< <address type='drive' controller='0' bus='1'
unit='0'/>
---
> <address type='drive' controller='0' bus='1'
target='0' unit='0'/>
39a48,50
> <controller type='usb' index='0'>
> <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x2'/>
> </controller>
50a62,65
> <video>
> <model type='cirrus' vram='9216' heads='1'/>
> <address type='pci' domain='0x0000' bus='0x00'
slot='0x02' function='0x0'/>
> </video>
Gianluca
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
virsh edit testvm2
or other application using the libvirt API.
-->
<domain type='kvm'>
<name>testvm2</name>
<uuid>91d6012b-043f-2ea0-fcf8-dfa4fcda5b62</uuid>
<memory unit='KiB'>1048576</memory>
<currentMemory unit='KiB'>1048576</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64' machine='pc-0.14'>hvm</type>
<boot dev='cdrom'/>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/qemu-kvm</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images//testvm.img'/>
<target dev='hda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x07' function='0x0'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1'
target='0' unit='0'/>
</disk>
<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='0x06' function='0x0'/>
</controller>
<controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x2'/>
</controller>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='spice' autoport='yes'/>
<sound model='ac97'>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x04' function='0x0'/>
</sound>
<video>
<model type='cirrus' vram='9216' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x05' function='0x0'/>
</memballoon>
</devices>
</domain>