[Date Prev] [Date Index] [Date Next] [Thread Prev] [Thread Index] [Thread Next]

Re: Strange tty behavior with multiple iLO 2.23 hosts and conserver + expect scripts on openVZ

marcin kowalski yoshi314@gmail.com
Thu, 11 Sep 2014 07:35:28 GMT


Followup - if someone has similar issues, i migrated setup to dropbear client and switched to using expect script as initcmd, and now everything works fine with every version of ilo host.

Attaching config excerpts:

config * {
}
default full {
        rw *;
}
default * {
        logfile /var/log/conserver/&.log;
        timestamp "";
        include full;
        logfilemax 50m;
        master localhost;
#       options !autoreinit,ondemand;
        options reinitoncc;
}


#domyslne parametry polaczenia iLO

default ilo-connection {
    type exec;
    execsubst X=hs;
    exec dbclient admin@X ;
    initcmd /etc/conserver/dropbear-ilo.sh ;
    break 1;
}



console ilo-3-4 {
  host 1.2.3.4;;
  include ilo-connection;
}

access * {
        trusted 127.0.0.1;
        allowed 127.0.0.1;
        admin konsola;
}




The dropbear-ilo.sh script:
-----------------------------------------------------

#!/usr/bin/expect -f

# debug
# exp_internal 1

set send_slow {1 0.02}

set ilom [lindex $argv 0]

expect {
        "Do you want to continue connecting? (y/n)"
        {
                sleep 1 ; send -s "y\r";
                expect "admin@" { send -s "sekrit\r" ; sleep 1 }
        }
        "admin@"       
                { send -s "sekrit\r" ; sleep 1 }
}      

sleep 1
expect "</>hpiLO->"
 
send -s "vsp"
sleep 1
 
send "\r"


# try accessing vsp every 60 seconds, if it's locked
expect {
        "Virtual Serial Port is currently in use by another session." {
                sleep 60;
                send -s "vsp\r";
                exp_continue
        }
}

exit 0
-----------------------------------------------------


2014-09-10 14:10 GMT+02:00 marcin kowalski <yoshi314@gmail.com>:
Hi, all I am using the following configuration  :

default ilo-connection {
    type exec;
    execsubst X=hs;

    exec /etc/conserver/ilo-vsp.sh X;

    break 1;

}

console ilo-test  {
    host 1.2.3.4;
    include ilo-connection;
}

(...)

with expect script like so  :

set send_slow {1 0.02}
set ilom [lindex $argv 0]
spawn ssh -vv admin@$ilom
expect {
        "Are you sure you want to continue connecting (yes/no)?"
        {
                sleep 1 ; send -s "yes\r" ;
                expect "admin@" { send -s "password\r" ; sleep 1 }
        }
        "admin@"
                { send -s "password\r" ; sleep 1 }
}

sleep 1
interact
exit 0


Script also calls vsp command later, but it's commented out for now.


The problem is that certain iLO servers fail to work correctly like this. It mostly happens with ones that identify as "iLO2 2.23" (regardless of variant in the version string, as i encountered a few of those so far) .

Everything from expect script is accepted, but my commands are echoed back to me and no output is displayed. The escape string for ilo "^](" seems to be accepted (it results in ilo displaying the prompt screen again) but nothing else is.

Sometimes the ssh password is accepted, but it's still echoed back to me.

What i've figured out so far

- Other ilo versions work correctly,
- running expect script directly and making it setup a session with that ilo host also works fine, from the same openvz machine
- Same configuration on non openvz host works correctly across all machines i have configured for conserver (including the ilo2 ones), although there is a diferent ssh version on it.

Anyone has any useful tips on running conserver under openVZ that might help here? Does that ilo version require some special treatment, or maybe there is some ssh bug here?