0

I have defined storage pool for VMs on ZFS:

virsh # pool-dumpxml zfs
<pool type='dir'>
  <name>zfs</name>
  <uuid>b2fba550-467f-8133-dee8-44ada7d0a807</uuid>
  <capacity unit='bytes'>210316853248</capacity>
  <allocation unit='bytes'>32768</allocation>
  <available unit='bytes'>210316820480</available>
  <source>
  </source>
  <target>
    <path>/winvm/win1</path>
    <permissions>
      <mode>0700</mode>
      <owner>4294967295</owner>
      <group>4294967295</group>
    </permissions>
  </target>
</pool>

Created RAW image file for vms:

host /winvm/win1 % l
total 3.5K
drwxrwxr-x. 2 root         root           3 Jan  3 14:03 .
drwxr-xr-x  3 libvirt-qemu libvirt-qemu   3 Dec 30 13:45 ..
-rw-------. 1 libvirt-qemu libvirt-qemu 20G Jan  3 14:03 t1.raw

Defined t1 VM but when I try to start it:

host /winvm/win1 % virsh start t1
error: Failed to start domain t1
error: internal error process exited while connecting to monitor: char device redirected to /dev/pts/13
kvm: -drive file=/winvm/win1/t1.raw,if=none,id=drive-sata0-0-0,format=raw,cache=none: could not open disk image /winvm/win1/t1.raw: Invalid argument

The VM's storage file keeps changing owner to root:root:

host /winvm/win1 % ls -l
total 1
-rw-------. 1 root root 21474836480 Jan  3 14:03 t1.raw

I have SELinux disabled on that machine:

host /winvm/win1 % sestatus
SELinux status:                 disabled

Even changed user and context for it:

host /winvm/win1 % chcon -t virt_image_t -u libvirt-qemu t1.raw

And I still keep getting the error above. Why? And how can SELinux impact file access when it's disabled?

1
  • the pool is actived?
    – c4f4t0r
    Jan 4, 2014 at 8:26

1 Answer 1

2

It's not ZFS, it's virt-manager utility that is causing incorrect configuration - the culprit is if=none added for some reason to disk spec (I've used virt-manager to define raw disk on ZFS volume). I was getting intermittent 'permission denied' errors on the disk image and so I thought it was a question of permissions. That's what happens if you set all the available options on disk image in virt-manager, apparently everyone just leaves the defaults on.

1
  • Thanks for the hint, one need to set : cache-mode=Hypervisor Default
    – Arman
    May 12, 2016 at 10:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .