Index: trunk/shell/c-i-a-b.common
===================================================================
--- trunk/shell/c-i-a-b.common	(revision 24)
+++ trunk/shell/c-i-a-b.common	(revision 25)
@@ -24,10 +24,12 @@
 CLUSTER_BRIDGE_NAME=internal
 CLUSTER_BRIDGE_SCRIPT=network-bridge-internal
 CLUSTER_BRIDGE_STANZA="($CONST_NETWORK_SCRIPT_KEYWORD $CLUSTER_BRIDGE_SCRIPT)"
+CLUSTER_DOMAIN_NAME=ciab.lip.ens-lyon.fr
 CLUSTER_EXTERNAL_ADDRESSES_BY_DHCP=1
 CLUSTER_EXTERNAL_MAC_PREFIX="00:16:3E:33:A6:"
+CLUSTER_EXTERNAL_DOMAIN_NAME=lip.ens-lyon.fr
 CLUSTER_IMAGE=full
-CLUSTER_DOMAIN_NAME=ciab.lip.ens-lyon.fr
+CLUSTER_MAC_ADDRESS_PREFIX="00:16:3E:0F:6A"
 CLUSTER_NOSWAP="$CONST_XEN_NOSWAP"
 CLUSTER_STATIC_EXTERNAL_PREFIX="140.77.15"
 CLUSTER_STATIC_NETWORK_PREFIX="192.168.1"
@@ -38,7 +40,6 @@
 COMPUTE_NODE_DISK_MOUNT_POINT=/mnt/compute-node-system-disk
 COMPUTE_NODE_INTERFACES_TEMPLATE=interfaces.compute-node
 COMPUTE_NODE_KERNEL=/boot/vmlinuz-`uname -r`
-COMPUTE_NODE_MAC_ADDRESS_PREFIX="00:16:3E:0F:6A"
 COMPUTE_NODE_MAX_NUM=250
 COMPUTE_NODE_MEMORY=3072
 COMPUTE_NODE_MODEL_EXTERNAL_MAC_ADDRESS="${CLUSTER_EXTERNAL_MAC_PREFIX}01"
@@ -52,11 +53,19 @@
 COMPUTE_NODE_SWAP_DISK_PREFIX="compute-node-"
 COMPUTE_NODE_SWAP_DISK_SIZE=1G
 SWAP_DISK_VOLUME_GROUP=/dev/vg_fast
+#
 DHCP_HOSTSFILE_BASENAME=dhcp-hostsfile
+#
 DOM0_CPUS_LIST="0 4"
 DOM0_CPUS_NUM=2
 DOM0_CPUS_CLAUSE="(dom0-cpus $DOM0_CPUS_NUM)"
 FRONT_END_CPUS_LIST="8 12 16"
+FRONT_END_EXTERNAL_INTERFACE_STATIC_NETMASK=255.255.255.0
+FRONT_END_EXTERNAL_INTERFACE_STATIC_NETWORK=140.77.15.0
+FRONT_END_EXTERNAL_INTERFACE_STATIC_GATEWAY=140.77.15.1
+FRONT_END_EXTERNAL_INTERFACE_STATIC_BROADCAST=140.77.15.255
+FRONT_END_EXTERNAL_INTERFACE_STATIC_DNS_NAMESERVERS=140.77.1.32 140.77.167.2
+FRONT_END_EXTERNAL_INTERFACE_STATIC_DNS_SEARCH="lip.ens-lyon.fr ens-lyon.fr resam.ens-lyon.fr"
 FRONT_END_EXTERNAL_MAC_ADDRESS="${CLUSTER_EXTERNAL_MAC_PREFIX}02"
 FRONT_END_HOME_DISK=front-end-home-disk
 FRONT_END_HOME_DISK_FILE_SYSTEM=ext3
Index: trunk/shell/templates/etc/network/interfaces.front-end
===================================================================
--- trunk/shell/templates/etc/network/interfaces.front-end	(revision 24)
+++ trunk/shell/templates/etc/network/interfaces.front-end	(revision 25)
@@ -2,14 +2,21 @@
 # and how to activate them. For more information, see interfaces(5).
 
 # The loopback network interface
-auto lo eth0a eth1
+auto lo eth0 eth1
 iface lo inet loopback
 #
 # The primary network interface
-iface eth0 inet dhcp
+__ETH0_STATIC_OR_DHCP__
+__ETH0_STATIC_ADDRESS__
+__ETH0_STATIC_NETMASK__
+__ETH0_STATIC_NETWORK__
+__EHT0_STATIC_GATEWAY__
+__ETH0_STATIC_BROADCAST__
+__ETH0_STATIC_DNS_NAMESERVERS__
+__ETH0_STATIC_DNS_SEARCH__
 #
 iface eth1 inet static
- address __STATIC_ADDRESS__
+ address __ETH1_STATIC_ADDRESS__
  netmask 255.255.255.0
 #
 # post-up  ethtool -K eth0 tx off
Index: trunk/shell/templates/etc/dhcp-hostsfile
===================================================================
--- trunk/shell/templates/etc/dhcp-hostsfile	(revision 24)
+++ trunk/shell/templates/etc/dhcp-hostsfile	(revision 25)
@@ -248,7 +248,4 @@
 00:16:3E:0F:6A:F8,id:*,192.168.1.248,compute-node-248
 00:16:3E:0F:6A:F9,id:*,192.168.1.249,compute-node-249
 00:16:3E:0F:6A:FA,id:*,192.168.1.250,compute-node-250
-00:16:3E:0F:6A:FB,id:*,192.168.1.251,front-end
-00:16:3E:0F:6A:FC,id:*,192.168.1.252,free-slot-1
-00:16:3E:0F:6A:FD,id:*,192.168.1.253,free-slot-2
-00:16:3E:0F:6A:FE,id:*,192.168.1.254,free-slot-3
+00:16:3E:0F:6A:FB,id:*,192.168.1.251,tamadi-1-fe
Index: trunk/shell/generate-dhcp-hostsfile
===================================================================
--- trunk/shell/generate-dhcp-hostsfile	(revision 24)
+++ trunk/shell/generate-dhcp-hostsfile	(revision 25)
@@ -12,7 +12,8 @@
 # Clean up the file
 DHCP_HOSTSFILE="${SCRIPT_PATH}/${TEMPLATES_DIR}/etc/${DHCP_HOSTSFILE_BASENAME}"
 rm -f $DHCP_HOSTSFILE
-# Compute the file entries.
+# Compute the compute nodes file entries.
+# Must start at 1 (0 is the network address).
 for i in `seq 1 $COMPUTE_NODE_MAX_NUM`
   do
     NODE_NUMBER=$i
@@ -28,11 +29,14 @@
       do
         NODE_NUMBER_HEXA="0$NODE_NUMBER_HEXA"
     done
-    MAC_ADDRESS="${COMPUTE_NODE_MAC_ADDRESS_PREFIX}:$NODE_NUMBER_HEXA"
+    MAC_ADDRESS="${CLUSTER_MAC_ADDRESS_PREFIX}:$NODE_NUMBER_HEXA"
     COMPUTE_NODE_NAME="${COMPUTE_NODE_NAME_PREFIX}${NODE_NUMBER_STRING}"
-    echo "${MAC_ADDRESS},id:*,${COMPUTE_NODE_STATIC_NETWORK_PREFIX}.${NODE_NUMBER},${COMPUTE_NODE_NAME}" >> $DHCP_HOSTSFILE
-    
+    echo "${MAC_ADDRESS},id:*,${CLUSTER_STATIC_NETWORK_PREFIX}.${NODE_NUMBER},${COMPUTE_NODE_NAME}" >> $DHCP_HOSTSFILE
 done
+# Create the entry for the front-end.
+NODE_NUMBER_HEXA=`printf "%X" $FRONT_END_STATIC_NETWORK_POSTFIX`
+MAC_ADDRESS="${CLUSTER_MAC_ADDRESS_PREFIX}:$NODE_NUMBER_HEXA"
+echo "${MAC_ADDRESS},id:*,${CLUSTER_STATIC_NETWORK_PREFIX}.${FRONT_END_STATIC_NETWORK_POSTFIX},$FRONT_END_HOST_NAME" >> $DHCP_HOSTSFILE
 echo
 echo Copy the file to the front end!
 echo
Index: trunk/shell/create-start-front-end
===================================================================
--- trunk/shell/create-start-front-end	(revision 24)
+++ trunk/shell/create-start-front-end	(revision 25)
@@ -93,6 +93,7 @@
    $CONST_XEN_CONFIG_DIR/$CURRENT_HOST_NAME.cfg
 rpl __FRONT_END_HOME_DISK__ $FRONT_END_HOME_VOLUME_GROUP_DEVICE/$FRONT_END_HOME_DISK \
    $CONST_XEN_CONFIG_DIR/$CURRENT_HOST_NAME.cfg
+# Swap disk stuff.
 if [ "x$FRONT_END_SWAP_DISK_SIZE" != "x$CONST_NULL_DISK_SIZE" ] ; then
   FRONT_END_SWAP_DISK_STANZA="'phy:$FRONT_END_SWAP_VOLUME_GROUP_DEVICE/${FRONT_END_SWAP_DISK},xvda3,w',"
   rpl __FRONT_END_SWAP_DISK__ $FRONT_END_SWAP_DISK_STANZA \
@@ -106,9 +107,10 @@
   rpl __FRONT_END_NOSWAP__ $CLUSTER_NOSWAP \
      $CONST_XEN_CONFIG_DIR/$CURRENT_HOST_NAME.cfg
 fi
+#
 rpl __FRONT_END_HOST_NAME__ $CURRENT_HOST_NAME \
    $CONST_XEN_CONFIG_DIR/$CURRENT_HOST_NAME.cfg
-
+# Vif stuff.
 VIF_STANZA=$CONST_XEN_VIF_STANZA_PREFIX
 EXTERNAL_MAC="${CONST_XEN_MAC_PREFIX}${FRONT_END_EXTERNAL_MAC_ADDRESS}"
 INTERNAL_MAC="${CONST_XEN_MAC_PREFIX}${FRONT_END_CLUSTER_MAC_ADDRESS}"
@@ -128,6 +130,72 @@
 rpl __VIF_STANZA__ "$VIF_STANZA" \
    $CONST_XEN_CONFIG_DIR/$CURRENT_HOST_NAME.cfg
 #
+#
+# Configure the specific files from templates
+#
+# /etc/network/interfaces
+# The first interface is DHCP configured.
+CURRENT_PATH=/etc/network
+cp templates$CURRENT_PATH/$FRONT_END_INTERFACES_TEMPLATE \
+   $FRONT_END_SYSTEM_DISK_MOUNT_POINT/$CURRENT_PATH/interfaces
+if [ $CLUSTER_EXTERNAL_ADDRESSES_BY_DHCP -eq 1 ] ;then
+  ETH0_STANZA="iface eth0 inet dhcp"
+  rpl __ETH0_STATIC_OR_DHCP__ "$ETH0_STANZA"  \
+      $FRONT_END_SYSTEM_DISK_MOUNT_POINT/$CURRENT_PATH/interfaces
+  echo y | rpl __ETH0_STATIC_ADDRESS__ ""
+      $FRONT_END_SYSTEM_DISK_MOUNT_POINT/$CURRENT_PATH/interfaces
+  echo y | rpl __ETH0_STATIC_NETMASK__ ""
+      $FRONT_END_SYSTEM_DISK_MOUNT_POINT/$CURRENT_PATH/interfaces
+  echo y | rpl __ETH0_STATIC_GATEWAY__ ""
+      $FRONT_END_SYSTEM_DISK_MOUNT_POINT/$CURRENT_PATH/interfaces
+  echo y | rpl __ETH0_STATIC_BROADCAST__ ""
+      $FRONT_END_SYSTEM_DISK_MOUNT_POINT/$CURRENT_PATH/interfaces
+  echo y | rpl __ETH0_STATIC_NAMESERVERS__ ""
+      $FRONT_END_SYSTEM_DISK_MOUNT_POINT/$CURRENT_PATH/interfaces
+  echo y | rpl __ETH0_STATIC_DNS_SEARCH__ ""
+      $FRONT_END_SYSTEM_DISK_MOUNT_POINT/$CURRENT_PATH/interfaces
+else
+  ETH0_STANZA="iface eth0 inet static"
+  rpl __ETH0_STATIC_OR_DHCP__ "$ETH0_STANZA"  \
+      $FRONT_END_SYSTEM_DISK_MOUNT_POINT/$CURRENT_PATH/interfaces
+  echo y | rpl __ETH0_STATIC_ADDRESS__ "$FRONT_END_CLUSTER_STATIC_IP"
+      $FRONT_END_SYSTEM_DISK_MOUNT_POINT/$CURRENT_PATH/interfaces
+  echo y | rpl __ETH0_STATIC_NETMASK__ "$FRONT_END_EXTERNAL_INTERFACE_STATIC_NETMASK"
+      $FRONT_END_SYSTEM_DISK_MOUNT_POINT/$CURRENT_PATH/interfaces
+  echo y | rpl __ETH0_STATIC_NETWORK__ "$FRONT_END_EXTERNAL_INTERFACE_STATIC_NETWORK"
+      $FRONT_END_SYSTEM_DISK_MOUNT_POINT/$CURRENT_PATH/interfaces
+  echo y | rpl __ETH0_STATIC_GATEWAY__ "$FRONT_END_EXTERNAL_INTERFACE_STATIC_GATEWAY"
+      $FRONT_END_SYSTEM_DISK_MOUNT_POINT/$CURRENT_PATH/interfaces
+  echo y | rpl __ETH0_STATIC_BROADCAST__ "$FRONT_END_EXTERNAL_INTERFACE_STATIC_BROADCAST"
+      $FRONT_END_SYSTEM_DISK_MOUNT_POINT/$CURRENT_PATH/interfaces
+  echo y | rpl __ETH0_STATIC_NAMESERVERS__ "$FRONT_END_EXTERNAL_INTERFACE_STATIC_DNS_NAMESERVERS"
+      $FRONT_END_SYSTEM_DISK_MOUNT_POINT/$CURRENT_PATH/interfaces
+  echo y | rpl __ETH0_STATIC_DNS_SEARCH__ "$FRONT_END_EXTERNAL_INTERFACE_STATIC_DNS_SEARCH"
+      $FRONT_END_SYSTEM_DISK_MOUNT_POINT/$CURRENT_PATH/interfaces
+fi 
+ADDRESS="$CLUSTER_STATIC_NETWORK_PREFIX.$FRONT_END_STATIC_NETWORK_POSTFIX"
+rpl __ETH1_STATIC_ADDRESS__ $ADDRESS  \
+    $FRONT_END_SYSTEM_DISK_MOUNT_POINT/$CURRENT_PATH/interfaces
+# /etc/hostname
+CURRENT_PATH=/etc
+echo $CURRENT_HOST_NAME > "${FRONT_END_DISK_MOUNT_POINT}${CURRENT_PATH}/hostname"
+# /etc/hosts
+CURRENT_PATH=/etc
+CURRENT_HOST_IP="${CLUSTER_STATIC_NETWORK_PREFIX}.${FRONT_END_STATIC_NETWORK_POSTFIX}"
+cp templates$CURRENT_PATH/hosts \
+   $FRONT_END_SYSTEM_DISK_MOUNT_POINT/$CURRENT_PATH
+rpl __COMPUTE_NODE_IP__ $CURRENT_HOST_IP \
+    ${FRONT_END_SYSTEM_DISK_MOUNT_POINT}${CURRENT_PATH}/hosts
+rpl __COMPUTE_NODE_NAME__ $CURRENT_HOST_NAME \
+    ${FRONT_END_SYSTEM_DISK_MOUNT_POINT}${CURRENT_PATH}/hosts
+# /etc/resolv.conf
+CURRENT_PATH=/etc
+cp $TEMPLATES_DIR$CURRENT_PATH/resolv.conf \
+   ${FRONT_END_SYSTEM_DISK_MOUNT_POINT}${CURRENT_PATH}/resolv.conf
+rpl __CLUSTER_DOMAIN_NAME__ "${CLUSTER_DOMAIN_NAME}." \
+   ${FRONT_END_SYSTEM_DISK_MOUNT_POINT}${CURRENT_PATH}/resolv.conf
+rpl __FRONT_END_STATIC_ADDRESS__ "${CLUSTER_STATIC_NETWORK_PREFIX}.$FRONT_END_STATIC_NETWORK_POSTFIX" \
+   ${FRONT_END_SYSTEM_DISK_MOUNT_POINT}${CURRENT_PATH}/resolv.conf
 exit 0
 #
 # Umount the compute node system disk
@@ -156,35 +224,4 @@
     VCPU_NUM=$((VCPU_NUM + 1))
 done
 
-#
-# Configure the specific files from templates
-#
-# /etc/network/interfaces
-# The first interface is DHCP configured.
-CURRENT_PATH=/etc/network
-cp templates$CURRENT_PATH/$FRONT_END_INTERFACES_TEMPLATE \
-   $FRONT_END_SYSTEM_DISK_MOUNT_POINT/$CURRENT_PATH
-ADDRESS="$COMPUTE_NODE_STATIC_NETWORK_PREFIX.$FRONT_END_STATIC_NETWORK_POSTFIX"
-rpl __STATIC_ADDRESS__ $ADDRESS  \
-    $FRONT_END_SYSTEM_DISK_MOUNT_POINT/$CURRENT_PATH/interfaces
-# /etc/hostname
-CURRENT_PATH=/etc
-echo $CURRENT_HOST_NAME > "${COMPUTE_NODE_DISK_MOUNT_POINT}${CURRENT_PATH}/hostname"
-# /etc/hosts
-CURRENT_PATH=/etc
-CURRENT_HOST_IP="${COMPUTE_NODE_STATIC_NETWORK_PREFIX}.${FRONT_END_STATIC_NETWORK_POSTFIX}"
-cp templates$CURRENT_PATH/hosts \
-   $FRONT_END_SYSTEM_DISK_MOUNT_POINT/$CURRENT_PATH
-rpl __COMPUTE_NODE_IP__ $CURRENT_HOST_IP \
-    ${FRONT_END_SYSTEM_DISK_MOUNT_POINT}${CURRENT_PATH}/hosts
-rpl __COMPUTE_NODE_NAME__ $CURRENT_HOST_NAME \
-    ${FRONT_END_SYSTEM_DISK_MOUNT_POINT}${CURRENT_PATH}/hosts
-# /etc/resolv.conf
-CURRENT_PATH=/etc
-cp $TEMPLATES_DIR$CURRENT_PATH/resolv.conf \
-   ${FRONT_END_SYSTEM_DISK_MOUNT_POINT}${CURRENT_PATH}/resolv.conf
-rpl __CLUSTER_DOMAIN_NAME__ "${CLUSTER_DOMAIN_NAME}." \
-   ${FRONT_END_SYSTEM_DISK_MOUNT_POINT}${CURRENT_PATH}/resolv.conf
-rpl __FRONT_END_STATIC_ADDRESS__ "${CLUSTER_STATIC_NETWORK_PREFIX}.$FRONT_END_STATIC_NETWORK_POSTFIX" \
-   ${FRONT_END_SYSTEM_DISK_MOUNT_POINT}${CURRENT_PATH}/resolv.conf
 exit 0
