vyos ping-timeout/ssh-lost after config script execution

Environment : OpenStack Juno

Image : VyOS 1.1.7

Issue : I have a script to just set hostname (& other basic stuff) on VyOS, created using http://vyos.net/wiki/Configuration_scripting. Once I execute the script, the remote ssh connection is lost and ping starts dropping intermittently.

Please let me know what might be happening here

Observation:

  1. Same is not seen if VyOS is just created on plain KVM on Ubuntu 14.04.01.
  2. VyOS was installed using ‘install image’.
  3. 3,879,088k memory is free out of total 4,054,688 k in top.
  4. cpu is 99.8% idle in top.

Steps Tried :

  1. Changed glance image hw_vif_model to virtio/e1000/rtl8139 without luck.
  2. Tried cli-shell-api without luck.

SCRIPT 1:

#!/bin/vbash
source /opt/vyatta/etc/functions/script-template
configure
set system host-name TEST
commit

SCRIPT 2:

#!/bin/bash

WRAPPER=/opt/vyatta/sbin/vyatta-cfg-cmd-wrapper
$WRAPPER begin
$WRAPPER set system host-name TEST
$WRAPPER set interfaces loopback lo address 1.1.1.1/32
$WRAPPER set system ntp server 8.8.8.8
$WRAPPER set system name-server 8.8.8.8
$WRAPPER commit
$WRAPPER end

SCRIPT3:
#!/bin/bash

export vyatta_sbindir=/opt/vyatta/sbin

export SHELL_API=/opt/vyatta/sbin/my_cli_shell_api

session_env=$($SHELL_API getSessionEnv $PPID)

eval $session_env

cli-shell-api setupSession

cli-shell-api inSession

export SET=${vyatta_sbindir}/my_set

export COMMIT=${vyatta_sbindir}/my_commit
export SAVE=${vyatta_sbindir}/vyatta-save-config.pl

$SET system hostname TEST

$COMMIT

$SAVE

cli-shell-api teardownSession

I’m curious if you could narrow down which command is causing the problem. If you remove the set loopback interface IP command does it still exhibit the problem?

loopback is also my prime suspect.
afaik, if you want to use Cisco-like loopback adapters, use dummy adapter instead