Index: create-start-front-end
===================================================================
--- create-start-front-end	(revision 22)
+++ create-start-front-end	(revision 23)
@@ -23,11 +23,11 @@
     exit 1
 fi
 
-# Create the VM system disk.
+# Create the front-end system disk.
 lvcreate -L$FRONT_END_SYSTEM_DISK_SIZE \
          -n  $FRONT_END_SYSTEM_DISK \
          $FRONT_END_SYSTEM_VOLUME_GROUP
-# Create a File System on the VM system disk.
+# Create a File System on the front-end system disk.
 mkfs -t $FRONT_END_SYSTEM_DISK_FILE_SYSTEM \
         $FRONT_END_SYSTEM_VOLUME_GROUP_DEVICE/$FRONT_END_SYSTEM_DISK
 # If necessary, create the swap volume for the front end.
@@ -37,6 +37,13 @@
            $FRONT_END_SWAP_VOLUME_GROUP
   mkswap $FRONT_END_SWAP_VOLUME_GROUP_DEVICE/$FRONT_END_SWAP_DISK
 fi
+# Create the VM home disk.
+lvcreate -L$FRONT_END_HOME_DISK_SIZE \
+         -n  $FRONT_END_HOME_DISK \
+         $FRONT_END_HOME_VOLUME_GROUP
+# Create a File System on the front-end system disk.
+mkfs -t $FRONT_END_HOME_DISK_FILE_SYSTEM \
+        $FRONT_END_HOME_VOLUME_GROUP_DEVICE/$FRONT_END_HOME_DISK
 # Mount the system disk to copy all the specific files.
 if [ ! -d $FRONT_END_SYSTEM_DISK_MOUNT_POINT ]; then
   mkdir $FRONT_END_SYSTEM_DISK_MOUNT_POINT
@@ -53,17 +60,17 @@
 # Create the Xen configuration file from a template
 #
 CURRENT_PATH=/etc/xen
-cp templates$CURRENT_PATH/front-end.cfg \
-   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
-rpl Template Configuration $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
+cp templates$CURRENT_PATH/$CONST_FRONT_END_TEMPLATE_NAME \
+   $CONST_XEN_CONFIG_DIR/$CURRENT_HOST_NAME.cfg
+rpl Template Configuration $CONST_XEN_CONFIG_DIR/$CURRENT_HOST_NAME.cfg
 rpl __FRONT_END_KERNEL__ $COMPUTE_NODE_KERNEL \
-   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
-rpl __FRONT_END_RAMDISK__ $COMPUTE_NODE_RAMDISK \
-   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
-rpl __FRONT_END_MEMORY__ $COMPUTE_NODE_MEMORY \
-   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
-rpl __FRONT_END_VCPUS_NUM__ $COMPUTE_NODE_VCPUS_NUM \
-   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
+   $CONST_XEN_CONFIG_DIR/$CURRENT_HOST_NAME.cfg
+rpl __FRONT_END_RAMDISK__ $FRONT_END_RAMDISK \
+   $CONST_XEN_CONFIG_DIR/$CURRENT_HOST_NAME.cfg
+rpl __FRONT_END_MEMORY__ $FRONT_END_MEMORY \
+   $CONST_XEN_CONFIG_DIR/$CURRENT_HOST_NAME.cfg
+rpl __FRONT_END_VCPUS_NUM__ $FRONT_END_VCPUS_NUM \
+   $CONST_XEN_CONFIG_DIR/$CURRENT_HOST_NAME.cfg
 CPUS_LIST=$FRONT_END_CPUS_LIST
 CPUS=""
 for i in $CPUS_LIST
@@ -76,42 +83,51 @@
     fi
 done
 rpl __FRONT_END_CPUS__ $CPUS \
-   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
+   $CONST_XEN_CONFIG_DIR/$CURRENT_HOST_NAME.cfg
 rpl __FRONT_END_SYSTEM_DISK__ $FRONT_END_SYSTEM_VOLUME_GROUP_DEVICE/$FRONT_END_SYSTEM_DISK \
-   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
-rpl __FRONT_END_HOME_DISK__ $FRONT_END_SYSTEM_VOLUME_GROUP_DEVICE/$FRONT_END_SYSTEM_DISK \
-   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
+   $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
 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 \
-     $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
-  rpl __FRONT_END_NOSWAP__ "" \
-     $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
+     $CONST_XEN_CONFIG_DIR/$CURRENT_HOST_NAME.cfg
+  # Comment out the noswap stanza.
+  rpl __FRONT_END_NOSWAP__ "#$CLUSTER_NOSWAP" \
+     $CONST_XEN_CONFIG_DIR/$CURRENT_HOST_NAME.cfg
 else
+  echo y | rpl -f __FRONT_END_SWAP_DISK__ "" \
+     $CONST_XEN_CONFIG_DIR/$CURRENT_HOST_NAME.cfg
   rpl __FRONT_END_NOSWAP__ $CLUSTER_NOSWAP \
-     $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
+     $CONST_XEN_CONFIG_DIR/$CURRENT_HOST_NAME.cfg
 fi
 rpl __FRONT_END_HOST_NAME__ $CURRENT_HOST_NAME \
-   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
+   $CONST_XEN_CONFIG_DIR/$CURRENT_HOST_NAME.cfg
 
+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}"
+INTERNAL_BRIDGE="{$CONST_XEN_BRIDGE_PREFIX}${CLUSTER_BRIDGE_NAME}"
+INTERNAL_IP=$FRONT_END_CLUSTER_STATIC_IP
 if [ $CLUSTER_EXTERNAL_ADDRESSES_BY_DHCP -eq 1 ] ;then
+  rpl __XEN_DHCP_STANZA__ "$CONST_XEN_DHCP_STANZA" \
+     $CONST_XEN_CONFIG_DIR/$CURRENT_HOST_NAME.cfg
+  VIF_STANZA="${VIF_STANZA}${EXTERNAL_MAC}','${INTERNAL_IP},${INTERNAL_MAC},${INTERNAL_BRIDGE}${CONST_XEN_VIF_STANZA_POSTFIX}"
 else
-fi  
-rpl __FRONT_END_IP_EXTERNAL__ $ADDRESS \
-   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
-rpl __FRONT_END_IP_CLUSTER__ $ADDRESS \
-   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
-rpl __FRONT_END_CLUSTER_MAC_ADDRESS__ $__FRONT_END_CLUSTER_MAC_ADDRESS__ \
-   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
-rpl __FRONT_END_CLUSTER_MAC_ADDRESS__ $__FRONT_END_CLUSTER_MAC_ADDRESS__ \
-   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
-rpl __CLUSTER_BRIDGE_NAME__ $CLUSTER_BRIDGE_NAME \
-   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
-
+  # Comment out the DHCP_STANZA.
+  rpl __XEN_DHCP_STANZA__ "#$CONST_XEN_DHCP_STANZA" \
+     $CONST_XEN_CONFIG_DIR/$CURRENT_HOST_NAME.cfg
+  VIF_STANZA="${VIF_STANZA}${EXTERNAL_IP},${EXTERNAL_MAC},'${INTERNAL_IP},${INTERNAL_MAC},${INTERNAL_BRIDGE}${CONST_XEN_VIF_STANZA_POSTFIX}"
+fi
+# In any case, write the VIF_STANZA
+rpl __VIF_STANZA__ $VIF_STANZA \
+   $CONST_XEN_CONFIG_DIR/$CURRENT_HOST_NAME.cfg
 #
+exit 0
+#
 # Umount the compute node system disk
 #
-umount $COMPUTE_NODE_DISK_MOUNT_POINT
+umount $FRONT_END_SYSTEM_DISK_MOUNT_POINT
 #
 # Start the virtual machine
 #
