Bug 459145

Summary: Can't use custom xen bridge script with cman
Product: Red Hat Enterprise Linux 5 Reporter: Bryn M. Reeves <bmr>
Component: cmanAssignee: Ryan O'Hara <rohara>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.2CC: bdevouge, bstevens, cfeist, cluster-maint, djansa, edamato, tao
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-20 21:52:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bryn M. Reeves 2008-08-14 18:08:36 UTC
Description of problem:
The file /etc/xen/xend-config.xsp allows for tweaking the default network script for xenbridges configuration. The default is (network-script network-bridge).

When used with cman the bridges are started from the cman init script. In RHEL-5.2 this uses the following script fragment:

xend_bridged_net_start() {
    if [ ! -x /etc/xen/scripts/network-bridge ]; then
        if [ -f /etc/xen/scripts/network-bridge ]; then
            errmsg='The xend bridged network script cannot be run'
        else
            errmsg='The xend bridged network script is missing'
        fi
        return 1
    fi
    
    /sbin/modprobe netbk >& /dev/null
    /sbin/modprobe netloop >& /dev/null
    bridge_parms=`egrep -m 1 "^[[:blank:]]*\([[:blank:]]*network-script[[:blank:]]+(')?[[:blank:]]*network-bridge([[:blank:]]*\)|[[:blank:]]+)" /etc/xen/xend-config.sxp| sed -r "s/^[[:blank:]]*\([[:blank:]]*network-script[[:blank:]]+'?[[:blank:]]*network-bridge[[:blank:]]*//; s/'?[[:blank:]]*\).*//"`
    errmsg=$(/etc/xen/scripts/network-bridge start $bridge_parms 2>&1) || return 1
    return 0
}

This seems to hard code the path to the script:

    errmsg=$(/etc/xen/scripts/network-bridge start $bridge_parms 2>&1) || return 1

Although it does retrieve customised parameters from xend-config.sxp and applies these when starting the bridge.

Version-Release number of selected component (if applicable):
cman-2.0.84-2.el5

How reproducible:
100%

Steps to Reproduce:
1. Configure a custom bridge script in xend-config.sxp, e.g. add:

(network-script mynetwork)

2. Create the mynetwork script in the /etc/xen/scripts directory
3. Start cman services
  
Actual results:
No bridges are started

Expected results:
Custom bridge script runs. Bridges start.

Additional info:

Comment 15 RHEL Program Management 2008-08-28 15:52:16 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 19 Ryan O'Hara 2008-08-29 15:12:14 UTC
Fixed in RHEL5 branch.

The fix is to use a NETWORK_BRIDGE_SCRIPT variable. If users wish to use a custom Xen network bridge script, they should define NETWORK_BRIDGE_SCRIPT in /etc/sysconfig/cman and update the /etc/xen/xend-config.sxp file accordingly.

The default value for NETWORK_BRIDGE_SCRIPT is "network-bridge" (the old hard-coded script name). If a custom script is desired, it must exist in /etc/xen/scripts and be executable.

Comment 23 errata-xmlrpc 2009-01-20 21:52:09 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-0189.html