Browse code

xenapi: display IP and DevStack result on console

The devstack setup service can update /etc/issue, displaying the status
of the installation and the VM's management IP. With this change, after
the devstack service finsihed, the login prompt will look like this:

OpenStack VM - Installed by DevStack
Management IP: 10.219.3.108
Devstack run: SUCCEEDED

DevStackOSDomU login:

This helps people to log in to their system.

Change-Id: Idd6bbd5faf9ced5618cd3e95191bfc3b89473fa2

Mate Lakat authored on 2013/09/26 21:57:02
Showing 1 changed files
... ...
@@ -119,6 +119,20 @@ script
119 119
     if su -c "/opt/stack/run.sh" $STACK_USER; then
120 120
         touch /var/run/devstack.succeeded
121 121
     fi
122
+
123
+    # Update /etc/issue
124
+    {
125
+        echo "OpenStack VM - Installed by DevStack"
126
+        IPADDR=\$(ip -4 address show eth0 | sed -n 's/.*inet \\([0-9\.]\\+\\).*/\1/p')
127
+        echo "  Management IP:   \$IPADDR"
128
+        echo -n "  Devstack run:    "
129
+        if [ -e /var/run/devstack.succeeded ]; then
130
+            echo "SUCCEEDED"
131
+        else
132
+            echo "FAILED"
133
+        fi
134
+        echo ""
135
+    } > /etc/issue
122 136
     initctl start hvc0 > /dev/null 2>&1
123 137
 end script
124 138
 EOF