Wind River Support Network

HomeDefectsOVP-849
Fixed

OVP-849 : engine-setup fails to setup default ISO domain if the dir is used once (but already cleaned up)

Created: Jul 28, 2013    Updated: Mar 11, 2016
Resolved Date: Sep 5, 2013
Found In Version: 5.0.1
Fix Version: 5.0.1.7
Severity: Severe
Applicable for: Wind River Linux 5
Component/s: Userspace

Description

Problem Description
======================
Assume selinux is set to Permissive to avoid JVM confgiure error.
Try to setup dir /exports/iso as the default ISO domain for oVirt, it is passed if it is the first time to use the dir as iso domain.

Clean up the oVirt engine, and run engine-setup again with the same dir /exports/iso. Then it comes to the error:

2013-07-28 09:59:29::DEBUG::setup_sequences::59::root:: running _configNfsShare
2013-07-28 09:59:29::DEBUG::engine-setup::1769::root:: configuring NFS share
2013-07-28 09:59:29::DEBUG::engine-setup::1773::root:: creating directory /exports/iso 
2013-07-28 09:59:29::DEBUG::nfsutils::17::root:: adding path /exports/iso to /etc/exports
2013-07-28 09:59:29::DEBUG::nfsutils::36::root:: setting selinux context for /exports/iso
2013-07-28 09:59:29::DEBUG::common_utils::372::root:: Executing command --> '/usr/sbin/semanage fcontext -a -t public_content_rw_t /exports/iso(/.*)?'
2013-07-28 09:59:29::DEBUG::common_utils::410::root:: output = 
2013-07-28 09:59:29::DEBUG::common_utils::411::root:: stderr = /usr/sbin/semanage: File context for /exports/iso(/.*)? already defined

2013-07-28 09:59:29::DEBUG::common_utils::412::root:: retcode = 1
2013-07-28 09:59:29::ERROR::engine-setup::1806::root:: Traceback (most recent call last):
  File "/usr/bin/engine-setup", line 1784, in _configNfsShare
    nfsutils.setSELinuxContextForDir(controller.CONF["NFS_MP"], nfsutils.SELINUX_RW_LABEL)
  File "/usr/share/ovirt-engine/scripts/nfsutils.py", line 49, in setSELinuxContextForDir
    utils.execCmd(cmdList=cmd, failOnError=True, msg=output_messages.ERR_SET_SELINUX_NFS_SHARE)
  File "/usr/share/ovirt-engine/scripts/common_utils.py", line 415, in execCmd
    raise Exception(msg)
Exception: Failed to set SELINUX policy for NFS share

2013-07-28 09:59:29::DEBUG::setup_sequences::62::root:: Traceback (most recent call last):
  File "/usr/share/ovirt-engine/scripts/setup_sequences.py", line 60, in run
    function()
  File "/usr/bin/engine-setup", line 1807, in _configNfsShare
    raise Exception(output_messages.ERR_FAILED_CFG_NFS_SHARE)
Exception: Failed to configure NFS share on this host


Expected Behavior
======================
Succeed to setup oVirt engine.

Observed Behavior
======================
Can't configure ISO domain for oVirt engine if the dir is configured once.

Logs
======================
Attached.

Misc Info 
======================
In wrlinux, semanage always returns 1:
root@localhost:~# setenforce 0
root@localhost:~# getenforce 
Permissive
root@localhost:~# /usr/sbin/semanage fcontext -a -t public_content_rw_t /exports/iso\(/.*\)?
/usr/sbin/semanage: File context for /exports/iso(/.*)? already defined
root@localhost:~# echo $?
1
root@localhost:~# setenforce 1
root@localhost:~# getenforce 
Enforcing
root@localhost:~# /usr/sbin/semanage fcontext -a -t public_content_rw_t /exports/iso\(/.*\)?
root@localhost:~# echo $?
1

But in Fedora, semanage always returns 0:
[root@ovirt-engine ~]# setenforce 0
[root@ovirt-engine ~]# getenforce 
Permissive
[root@ovirt-engine ~]# /usr/sbin/semanage fcontext -a -t public_content_rw_t /exports/iso\(/.*\)?
[root@ovirt-engine ~]# echo $?
0

[root@ovirt-engine ~]# setenforce 1
[root@ovirt-engine ~]# getenforce 
Enforcing
[root@ovirt-engine ~]# /usr/sbin/semanage fcontext -a -t public_content_rw_t /exports/iso\(/.*\)?
[root@ovirt-engine ~]# echo $?
0

Steps to Reproduce

step 1; /buildarea1/product/wrlinux-ovp/wrlinux/configure --enable-board=intel-xeon-core --enable-rootfs=ovp-ovirt-engine --enable-addons=wr-ovp --with-package=wrs-kvm-helper --with-template=feature/openvswitch,feature/vxlan --enable-parallel-pkgbuilds=5 --enable-jobs=5 --with-sstate-dir=/buildarea1/build/PUBLIC_SSTATES/intel-xeon-core
step 2; make fs
step 3; Boot intel-xeon-core target
step 4; On target, run command:
    # setenfore 0
    # engine-setup
    Use /exports/iso as the default ISO domain
    # engine-cleanup
    # rm -rf /exports/iso
    Remove /exports/iso from /etc/exports

    Then setup the ovirt engine again:
    engine-setup
    Use the same dir: /exports/iso
Live chat
Online