--- iscsi-cfg.orig 2017-01-04 00:08:10.000000000 +0100 +++ iscsi-cfg 2017-01-09 15:07:32.000000000 +0100 @@ -113,14 +113,21 @@ # Make sure we are not already in manual mode source /etc/iscsi-ha/iscsi-ha.load - if [ -e $IHA_STATE_PATH/manual ] && ! check_service_run_state + if [ -e $IHA_STATE_PATH/manual ] && check_service_run_state then echo "Manual mode already enabled - exiting" exit 1 fi # Enter manual mode - touch $IHA_STATE_PATH/manual + MY_POOL_ROLE=`cat /etc/xensource/pool.conf | awk -F ':' {'print $1'} | tr -d [[:space:]]` + if [ $MY_POOL_ROLE = "master" ] + then + echo "become_primary" > $IHA_STATE_PATH/manual + else + echo "become_secondary" > $IHA_STATE_PATH/manual + fi + if [ $? -eq 0 ] then echo "iscsi-ha now in manual mode"