Index: create-start-front-end
===================================================================
--- create-start-front-end	(revision 19)
+++ create-start-front-end	(revision 20)
@@ -13,7 +13,7 @@
 #
 # Check that the front-end virtual machine does not already exist.
 #
-CURRENT_HOST_NAME=$FRONT_END_NAME
+CURRENT_HOST_NAME=$FRONT_END_HOST_NAME
 IS_RUNNING=`xm list | grep $CURRENT_HOST_NAME`
 if [ -n "$IS_RUNNING" ]
   then
@@ -44,48 +44,16 @@
 mount $FRONT_END_SYSTEM_VOLUME_GROUP_DEVICE/$FRONT_END_SYSTEM_DISK \
       $FRONT_END_SYSTEM_DISK_MOUNT_POINT
 #
-# 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
-#
 # Get the MAC address
 #
 CURRENT_PATH=/etc
-COMPUTE_NODE_MAC_ADDRESS=\
-`awk -F, -v INDEX=$NODE_NUMBER '{if (FNR==INDEX) {print $1}}' $SCRIPT_PATH/$TEMPLATES_DIR$CURRENT_PATH/$DHCP_HOSTSFILE_BASENAME`
+FRONT_END_MAC_ADDRESS=\
+`awk -F, -v INDEX=$FRONT_END_STATIC_NETWORK_POSTFIX '{if (FNR==INDEX) {print $1}}' $SCRIPT_PATH/$TEMPLATES_DIR$CURRENT_PATH/$DHCP_HOSTSFILE_BASENAME`
 #
 # Create the Xen configuration file from a template
 #
 CURRENT_PATH=/etc/xen
-cp templates$CURRENT_PATH/compute-node.cfg \
+cp templates$CURRENT_PATH/front-end.cfg \
    $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
 rpl Template Configuration $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
 rpl "the Xen instance compute-node" "compute-node-$NODE_NUMBER_STRING" \
@@ -150,3 +118,36 @@
     xm vcpu-pin $CURRENT_HOST_NAME $VCPU_NUM $i
     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
