RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1083125 - VirtualDomain will not start lxc container having xml in /var/lib/libvirtd/lxc with Enforcing
Summary: VirtualDomain will not start lxc container having xml in /var/lib/libvirtd/lx...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: resource-agents
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: David Vossel
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-01 14:04 UTC by michal novacek
Modified: 2015-08-24 06:36 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-08 17:53:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description michal novacek 2014-04-01 14:04:07 UTC
Description of problem:
I have xmls for lxc virtual containers under /var/lib/libvirt/lxc which seems
the right place to store them. With selinux set to enforce it seems that
VirtualDomain resource agent cannot read it (Permission denied). 

Version-Release number of selected component (if applicable):
resource-agents-3.9.5-26.el7.x86_64

How reproducible: always

Steps to Reproduce:
1. set selinux to enforcing
2. create lxc xml in /var/lib/libvirt/lxc directory
3. run 'restorecon -R /var/lib/libvirt/lxc'
4. create pacemaker VirtualDomain resource for this container
5. try to enable it

Actual results: resource not started

Expected results: resource starting corretly

Additional info:
The container itself runs fine but there is a problem of pacemaker accessing
the xml definition of container. Please advice on how to make this properly
work with selinux set to enforcing.

# grep lrmd /var/log/messages | tail
...
Apr  1 15:53:59 duck-03 lrmd[21697]: notice: operation_finished: R-duck-03-node01-qemu_stop_0:12640:stderr [ error: internal error: unexpected qemu uri path '/', try qemu:///system ]
Apr  1 15:53:59 duck-03 crmd[13292]: warning: do_update_resource: Resource R-duck-03-node01-qemu no longer exists in the lrmd
Apr  1 15:55:45 duck-03 lrmd[21697]: notice: operation_finished: R-duck-03-node01-lxc_stop_0:5012:stderr [ domain duck-03-node01 destroyed ]
Apr  1 15:56:39 duck-03 lrmd[21697]: notice: operation_finished: R-duck-03-node01-lxc_start_0:5393:stderr [ error: Failed to open file '/var/lib/libvirt/lxc/duck-03-node01.xml'

# ls -lZ /var/lib/libvirt
drwx--x--x. root root system_u:object_r:virt_content_t:s0 boot
drwxr-xr-x. root root system_u:object_r:virt_var_lib_t:s0 dnsmasq
drwx--x--x. root root system_u:object_r:virt_var_lib_t:s0 filesystems
drwxr-xr-x. root root system_u:object_r:virt_image_t:s0 images
drwx------. root root system_u:object_r:virt_var_lib_t:s0 lxc
drwx------. root root system_u:object_r:virt_var_lib_t:s0 network
drwxr-x---. qemu qemu system_u:object_r:qemu_var_run_t:s0 qemu

# ls -lZ /var/lib/libvirt/lxc/duck-03-node01.xml
lrwxrwxrwx. root root unconfined_u:object_r:virt_var_lib_t:s0 /var/lib/libvirt/lxc/duck-03-node01.xml -> /var/lib/libvirt/lxc/duck-03-node01/duck-03-node01.xml

# ls -lZ /var/lib/libvirt/lxc/duck-03-node01/duck-03-node01.xml 
-rw-r--r--. root root unconfined_u:object_r:virt_var_lib_t:s0 /var/lib/libvirt/lxc/duck-03-node01/duck-03-node01.xml

# ls -Zl /usr/lib/ocf/resource.d/heartbeat/VirtualDomain
-rwxr-xr-x. 1 system_u:object_r:bin_t:s0       root root 21799 Mar 28 12:24 /usr/lib/ocf/resource.d/heartbeat/VirtualDomain

Comment 2 David Vossel 2014-04-01 21:46:02 UTC
This is a selinux policy problem. I don't think there is anything we should be doing from the VirtualDomain resource to attempt to solve this.

-- Vossel

Comment 3 David Vossel 2014-07-08 17:53:33 UTC
Let libvirt manage the /var/lib/libvirt/* directories. Store the configs the VirtualDomain agent reads outside of that directory.


Note You need to log in before you can comment on or make changes to this bug.