Dňa 07.11.2012 08:18, Hector Sanjuan wrote / napísal(a):
Any chance the "Use Secure WSS" is checked in sunstone config? Can you check/uncheck and retry with it unchecked just in case?

Secure WSS wasn't checked, but I tried to check/uncheck and run once again with unchecked - nothing changed :-(

Otherwise, kill your sunstone proxy and restart it manually:

python /usr/share/opennebula/websockify/websocketproxy.py --target-config=/var/lib/one/sunstone_vnc_tokens 29876
1. sunstone stopped, occi stopped
oneadmin@myto-node:~$ ps aux|grep py
oneadmin 12456  0.0  0.0   9516   904 pts/2    S+   09:56   0:00 grep py

2.
oneadmin@myto-node:/etc/one$ python /usr/share/opennebula/websockify/websocketproxy.py --target-config=/var/lib/one/sunstone_vnc_tokens 29876
WebSocket server settings:
  - Listen on :29876
  - Flash security policy server
  - No SSL/TLS support (no cert file)
  - proxying from :29876 to targets in /var/lib/one/sunstone_vnc_tokens

oneadmin@myto-node:~$ ps aux|grep py
oneadmin 12457  0.5  0.1  93056 16800 pts/1    S+   09:57   0:00 python /usr/share/opennebula/websockify/websocketproxy.py --target-config=/var/lib/one/sunstone_vnc_tokens 29876
oneadmin 12460  0.0  0.0   9516   908 pts/2    S+   09:57   0:00 grep py


3. oneadmin@myto-node:~$ sunstone-server start
sunstone-server started

oneadmin@myto-node:~$ ps aux|grep py
oneadmin 12457  0.1  0.1  93056 16800 pts/1    S+   09:57   0:00 python /usr/share/opennebula/websockify/websocketproxy.py --target-config=/var/lib/one/sunstone_vnc_tokens 29876
oneadmin 12481  0.9  0.0      0     0 pts/2    Z    09:58   0:00 [python] <defunct>
oneadmin 12484  0.0  0.0   9516   908 pts/2    S+   09:58   0:00 grep py

Here seems to be an issue - if websockify process runs in time of sunstone is starting - python process is defunct. If a defunct python proces exist in system, VNC server is disconnected immediately and 10 lines is added to websockify console:

oneadmin@myto-node:~$ python /usr/share/opennebula/websockify/websocketproxy.py --target-config=/var/lib/one/sunstone_vnc_tokens 29876
WebSocket server settings:
  - Listen on :29876
  - Flash security policy server
  - No SSL/TLS support (no cert file)
  - proxying from :29876 to targets in /var/lib/one/sunstone_vnc_tokens
 

  1: 10.0.1.125: SSL connection but '/var/lib/one/self.pem' not found
  2: 10.0.1.125: SSL connection but '/var/lib/one/self.pem' not found
  3: 10.0.1.125: SSL connection but '/var/lib/one/self.pem' not found
  4: 10.0.1.125: SSL connection but '/var/lib/one/self.pem' not found
  5: 10.0.1.125: SSL connection but '/var/lib/one/self.pem' not found
  6: 10.0.1.125: SSL connection but '/var/lib/one/self.pem' not found
  7: 10.0.1.125: SSL connection but '/var/lib/one/self.pem' not found
  8: 10.0.1.125: SSL connection but '/var/lib/one/self.pem' not found
  9: 10.0.1.125: SSL connection but '/var/lib/one/self.pem' not found
 10: 10.0.1.125: SSL connection but '/var/lib/one/self.pem' not found

In /etc/one/sunstone-server there is:
:vnc_proxy_base_port: 29876
:vnc_proxy_path: /usr/share/opennebula/websockify/websocketproxy.py
:vnc_proxy_support_wss: no
:vnc_proxy_cert:
:vnc_proxy_key:

-rwxr-xr-x 1 root root 3691 okt 26 18:13 sunstone-server

if [ -z "$ONE_LOCATION" ]; then
    SUNSTONE_PID=/var/run/one/sunstone.pid
    SUNSTONE_SERVER=/usr/share/opennebula/sunstone/sunstone-server.rb
    SUNSTONE_LOCK_FILE=/var/lock/one/.sunstone.lock
    SUNSTONE_LOG=/var/log/one/sunstone.log
    SUNSTONE_LOG_ERROR=/var/log/one/sunstone.error
    SUNSTONE_CONF=/etc/one/sunstone-server.conf
else
    SUNSTONE_PID=$ONE_LOCATION/var/sunstone.pid
    SUNSTONE_SERVER=$ONE_LOCATION/lib/sunstone/sunstone-server.rb
    SUNSTONE_LOCK_FILE=$ONE_LOCATION/var/.sunstone.lock
    SUNSTONE_LOG=$ONE_LOCATION/var/sunstone.log
    SUNSTONE_LOG_ERROR=$ONE_LOCATION/var/sunstone.error
    SUNSTONE_CONF=$ONE_LOCATION/etc/sunstone-server.conf
fi

setup()
{
  TMPDIR=$(grep ^:tmpdir: $SUNSTONE_CONF|awk '{print $2}')

  if [ -n "$TMPDIR" ]; then
    export TMPDIR
    mkdir -p $TMPDIR
  fi

  if [ -f $SUNSTONE_LOCK_FILE ]; then
    if [ -f  $SUNSTONE_PID ]; then
      SUNSTONEPID=`cat $SUNSTONE_PID`
      ps $SUNSTONEPID &> /dev/null
      if [ $? -eq 0 ]; then
        echo -n "Sunstone Server is still running (PID:$SUNSTONEPID). Please "
        echo "try 'sunstone-server stop' first."
        exit 1
      fi
    fi
    echo "Stale .lock detected. Erasing it."
    rm $SUNSTONE_LOCK_FILE
  fi
}

start()
{
  if [ ! -f "$SUNSTONE_SERVER" ]; then
    echo "Cannot find $SUNSTONE_SERVER."
    exit 1
  fi

  # Start the sunstone daemon
  touch $SUNSTONE_LOCK_FILE
  ruby $SUNSTONE_SERVER > $SUNSTONE_LOG 2>$SUNSTONE_LOG_ERROR &
  LASTPID=$!

  if [ $? -ne 0 ]; then
    echo "Error executing sunstone-server."
    echo "Check $SUNSTONE_LOG_ERROR and $SUNSTONE_LOG for more information"
    exit 1
  else
    echo $LASTPID > $SUNSTONE_PID
  fi

  sleep 1
  ps $LASTPID &> /dev/null

  if [ $? -ne 0 ]; then
    echo "Error executing sunstone-server."
    echo "Check $SUNSTONE_LOG_ERROR and $SUNSTONE_LOG for more information"
    exit 1
  fi

  echo "sunstone-server started"
}
#
# Function that stops the daemon/service
#
stop()
{
  if [ ! -f $SUNSTONE_PID ]; then
    echo "Couldn't find sunstone-server process pid."
    exit 1
  fi

  # Kill the sunstone daemon
  kill -INT `cat $SUNSTONE_PID` &> /dev/null

  # Remove pid files
  rm -f $SUNSTONE_LOCK_FILE &> /dev/null
  rm -f $SUNSTONE_PID &> /dev/null

  echo "sunstone-server stopped"
}

case "$1" in
  start)
    setup
    start
    ;;
  stop)
    stop
    ;;
  restart)
    stop
    setup
    start
    ;;
  *)
    echo "Usage: sunstone-server {start|stop|restart}" >&2
    exit 3
    ;;
esac




Jan


and see if it says something interesting to the console when you are trying to connect to the VM.

Hector


On Wed, 07 Nov 2012 08:01:52 +0100, Jan Benadik <jan.bena...@atos.net> wrote:

Hi,
here are my python processes in different situations:

1. sunstone and OCCI server stopped
oneadmin@myto-node:~$ ps aux|grep python
oneadmin  1395  0.0  0.0   9516   912 pts/0    S+   07:48   0:00 grep python
nova      5838  0.0  0.2 118608 23796 ?        S    Nov06   0:02 python /usr/bin/nova-novncproxy --flagfile=/etc/nova/nova.conf --web /usr/share/novnc/

2. sunstone started, OCCI stopped
oneadmin@myto-node:~$ ps aux|grep python
oneadmin  1412  6.5  0.1  93060 16808 pts/0    S    07:49   0:00 python /usr/share/opennebula/websockify/websocketproxy.py --target-config=/var/lib/one/sunstone_vnc_tokens 29876
oneadmin  1415  0.0  0.0   9516   908 pts/0    S+   07:49   0:00 grep python
nova      5838  0.0  0.2 118608 23796 ?        S    Nov06   0:02 python /usr/bin/nova-novncproxy --flagfile=/etc/nova/nova.conf --web /usr/share/novnc/

3. sunstone and OCCI started
oneadmin@myto-node:~$ ps aux|grep python
oneadmin  1412  0.2  0.1  93060 16808 pts/0    S    07:49   0:00 python /usr/share/opennebula/websockify/websocketproxy.py --target-config=/var/lib/one/sunstone_vnc_tokens 29876
oneadmin  1434  4.6  0.1  93056 16808 pts/0    S    07:50   0:00 python /usr/share/opennebula/websockify/websocketproxy.py --target-config=/var/lib/one/selfservice_vnc_tokens 33876
oneadmin  1437  0.0  0.0   9520   908 pts/0    S+   07:50   0:00 grep python
nova      5838  0.0  0.2 118608 23796 ?        S    Nov06   0:02 python /usr/bin/nova-novncproxy --flagfile=/etc/nova/nova.conf --web /usr/share/novnc/

4. sunstone and OCCI started, VNC session via OCCI established
oneadmin@myto-node:~$ ps aux|grep python
oneadmin  1412  0.0  0.1  93060 16808 pts/0    S    07:49   0:00 python /usr/share/opennebula/websockify/websocketproxy.py --target-config=/var/lib/one/sunstone_vnc_tokens 29876
oneadmin  1434  0.1  0.1  93056 16912 pts/0    S    07:50   0:00 python /usr/share/opennebula/websockify/websocketproxy.py --target-config=/var/lib/one/selfservice_vnc_tokens 33876
oneadmin  1833  0.0  0.1  95288 14456 pts/0    S    07:52   0:00 python /usr/share/opennebula/websockify/websocketproxy.py --target-config=/var/lib/one/selfservice_vnc_tokens 33876
oneadmin  1835  0.0  0.0   9520   912 pts/0    S+   07:52   0:00 grep python
nova      5838  0.0  0.2 118608 23796 ?        S    Nov06   0:02 python /usr/bin/nova-novncproxy --flagfile=/etc/nova/nova.conf --web /usr/share/novnc/


5. sunstone and OCCI started, VNC session via sunstone try to establish (with error message :Server disconnected (code: 1006) displayed)
oneadmin  1833  0.0  0.0      0     0 pts/0    Z    07:52   0:00 [python] <defunct>
oneadmin  1927  0.0  0.0      0     0 pts/0    Z    07:53   0:00 [python] <defunct>
oneadmin  1938  0.0  0.0   9520   912 pts/0    S+   07:53   0:00 grep python
nova      5838  0.0  0.2 118608 23796 ?        S    Nov06   0:02 python /usr/bin/nova-novncproxy --flagfile=/etc/nova/nova.conf --web /usr/share/novnc/


6. the same as 5., but after error message closing
oneadmin@myto-node:~$ ps aux|grep python
oneadmin  1412  0.0  0.1  93060 16912 pts/0    S    07:49   0:00 python /usr/share/opennebula/websockify/websocketproxy.py --target-config=/var/lib/one/sunstone_vnc_tokens 29876
oneadmin  1434  0.0  0.1  93056 16912 pts/0    S    07:50   0:00 python /usr/share/opennebula/websockify/websocketproxy.py --target-config=/var/lib/one/selfservice_vnc_tokens 33876
oneadmin  1833  0.0  0.0      0     0 pts/0    Z    07:52   0:00 [python] <defunct>
oneadmin  1927  0.0  0.0      0     0 pts/0    Z    07:53   0:00 [python] <defunct>
oneadmin  2016  0.0  0.0   9520   908 pts/0    S+   07:55   0:00 grep python
nova      5838  0.0  0.2 118608 23796 ?        S    Nov06   0:02 python /usr/bin/nova-novncproxy --flagfile=/etc/nova/nova.conf --web /usr/share/novnc/


File /var/log/one/sunstone.error is still empty.

Jan


Dňa 06.11.2012 19:53, Hector Sanjuan wrote / napísal(a):
Is there any suspicious python process still running after stopping sunstone that might be taking the 33876 port?

(im seeing oneadmin 6942 0.0 0.0 0 0 pts/1 Z 10:10 0:00 [python] <defunct>)

Anything in sunstone.error maybe?

Hector

On Tue, 06 Nov 2012 10:43:30 +0100, Jan Benadik <jan.bena...@atos.net> wrote:

Hi all,

I have a problem to start VNC session from Sunstone interface.

I have Ubuntu 12.04 Server with Opennebula 3.8.1 installed, the newest version of noVNC (no error message), restarted oned, sunstone-server and occi-server too.

After restarting, the python processes are:
oneadmin@myto-node:/usr/share/opennebula$ ps aux|grep python
nova      5838  0.0  0.2 118608 23796 ?        S    09:56   0:00 python /usr/bin/nova-novncproxy --flagfile=/etc/nova/nova.conf --web /usr/share/novnc/
oneadmin  6835  0.4  0.1  93068 16816 pts/1    S    10:09   0:00 python /usr/share/opennebula/websockify/websocketproxy.py --target-config=/var/lib/one/sunstone_vnc_tokens 29876
oneadmin  6857  0.7  0.1  93064 16820 pts/1    S    10:09   0:00 python /usr/share/opennebula/websockify/websocketproxy.py --target-config=/var/lib/one/selfservice_vnc_tokens 33876
oneadmin  6869  0.0  0.0   9516   908 pts/1    S+   10:10   0:00 grep python


When I try to start VNC session from OCCI interface - everything works, VNC session is established.
If I try to start VNC session to the same VM from SUNSTONE interface, a message "Server disconnected (code: 1006)" occurs immediately and python processes are changed:
oneadmin@myto-node:/usr/share/opennebula$ ps aux|grep python
nova      5838  0.0  0.2 118608 23796 ?        S    09:56   0:00 python /usr/bin/nova-novncproxy --flagfile=/etc/nova/nova.conf --web /usr/share/novnc/
oneadmin  6835  0.2  0.1  93068 16920 pts/1    S    10:09   0:00 python /usr/share/opennebula/websockify/websocketproxy.py --target-config=/var/lib/one/sunstone_vnc_tokens 29876
oneadmin  6857  0.3  0.1  93064 16820 pts/1    S    10:09   0:00 python /usr/share/opennebula/websockify/websocketproxy.py --target-config=/var/lib/one/selfservice_vnc_tokens 33876
oneadmin  6942  0.0  0.0      0     0 pts/1    Z    10:10   0:00 [python] <defunct>
oneadmin  6944  0.0  0.0   9516   912 pts/1    S+   10:10   0:00 grep python

File /var/log/one/sunstone.error is empty,
the file /var/log/one/sunstone.log starts with:
--------------------------------------
         Server configuration
--------------------------------------
{:vnc_proxy_cert=>nil,
 :vnc_proxy_support_wss=>false,
 :vnc_proxy_path=>"/usr/share/opennebula/websockify/websocketproxy.py",
 :_one_xmlrpc_=>"http://localhost:2633/RPC2",
 :vnc_proxy_base_port=>29876,
 :vnc_proxy_key=>nil,
 :core_auth=>"cipher",
 :host=>"0.0.0.0",
 :tmpdir=>"/var/tmp/one",
 :marketplace_url=>"https://marketplace.c12g.com/appliance",
 :debug_level=>3,
 :port=>9869,
 :lang=>"en_US",
 :auth=>"sunstone"}
Tue Nov 06 10:09:42 2012 [I]: Starting VNC proxy: python /usr/share/opennebula/websockify/websocketproxy.py --target-config=/var/lib/one/sunstone_vnc_tokens  29876


and ends with:
Tue Nov 06 10:27:12 2012 [I]: 10.0.1.125 - - [06/Nov/2012 10:27:12] "POST /vm/88/startvnc HTTP/1.1" 200 48 0.0068
Tue Nov 06 10:27:12 2012 [I]: 10.0.1.125 - - [06/Nov/2012 10:27:12] "GET /user?timeout=true HTTP/1.1" 200 3416 0.0062
Tue Nov 06 10:27:13 2012 [I]: 10.0.1.125 - - [06/Nov/2012 10:27:13] "GET /vm?timeout=true HTTP/1.1" 200 24160 0.0203
Tue Nov 06 10:27:15 2012 [I]: 10.0.1.125 - - [06/Nov/2012 10:27:15] "GET /cluster?timeout=true HTTP/1.1" 200 338 0.0038
Tue Nov 06 10:27:26 2012 [I]: 10.0.1.125 - - [06/Nov/2012 10:27:26] "GET /image?timeout=true HTTP/1.1" 200 14143 0.0757

Paths to files looks to be correct - which could be an issue?

Jan

--

Ján Beňadik
Managed Services - Solution Design Architect
mobile: +421 903 691 634
fax: +421 2 6852 8380
jan.bena...@atos.net
Vinohradnicka 6, 971 01 Prievidza
www.sk.atos.net
__________________________________





--
Hector Sanjuan
@hecsanjuan

--

Ján Beňadik
Managed Services - Solution Design Architect
mobile: +421 903 691 634
fax: +421 2 6852 8380
jan.bena...@atos.net
Vinohradnicka 6, 971 01 Prievidza
www.sk.atos.net
__________________________________





--
Hector Sanjuan
@hecsanjuan

--

Ján Beňadik
Managed Services - Solution Design Architect
mobile: +421 903 691 634
fax: +421 2 6852 8380
jan.bena...@atos.net
Vinohradnicka 6, 971 01 Prievidza
www.sk.atos.net
__________________________________


_______________________________________________
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org

Reply via email to