Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Failed on allow qemu process read qcow2 images in home directory #44

Open
alexanderbazhenoff opened this issue May 27, 2022 · 1 comment

Comments

@alexanderbazhenoff
Copy link

alexanderbazhenoff commented May 27, 2022

$ molecule test -s kvm

TASK [Allow qemu process read qcow2 images in home directory] ******************
failed: [localhost -> localhost] (item=centos7-instance) => {"ansible_loop_var": "item", "changed": false, "cmd": "/usr/bin/setfacl --test -m user:qemu:x /home/user", "item": {"image_url": "https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2", "name": "centos7-instance"}, "msg": "setfacl: 
Option -m: Invalid argument near character 6", "rc": 2, "stderr": "setfacl: Option -m: Invalid argument near character 6\n", "stderr_lines": ["setfacl: Option -m: Invalid argument near character 6"], "stdout": "", "stdout_lines": []}

from running molecule.yml with a minimum of params:

cat molecule/kvm/molecule.yml

---

dependency:
  name: galaxy
  options:
    ignore-certs: True
    ignore-errors: True
driver:
  name: libvirt
platforms:
  - name: centos7-instance
    image_url: "https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2"
  ... 

Other infro:

$ ansible --version

ansible 2.10.17
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/user/.local/lib/python3.8/site-packages/ansible
executable location = /home/user/.local/bin//ansible
python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0]

$ ls -lh /var/lib | grep libvirt
drwxr-xr-x 1 root          root            56 апр 28 16:45 libvirt
$ ls -lh /var/lib/libvirt | grep images
drwx--x--x 1 root         root  0 сен 27  2020 images

# Well, I have changed permissions of the folders, but it didn't helped. Still failed on -m option
$ sudo chmod 755 /var/lib/libvirt
$ sudo chmod 755 /var/lib/libvirt/images

$ cat /etc/group | grep qemu
libvirt-qemu:x:64055:libvirt-qemu
$ cat /etc/group | grep user | grep qemu
libvirt-qemu:x:64055:libvirt-qemu,user

$ lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.4 LTS
Release:        20.04
Codename:       focal

Everything works fine from virt-manager, but molecule-libvirt not.
May be I'll check this later, but at first here is a bug report.

@heldner
Copy link
Contributor

heldner commented Aug 27, 2022

It seems to be you don't have qemu user in system. Set qemu_user var to libvirt-qemu.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants