Index: trunk/shell/c-i-a-b.common
===================================================================
--- trunk/shell/c-i-a-b.common	(revision 15)
+++ trunk/shell/c-i-a-b.common	(revision 16)
@@ -1,10 +1,14 @@
-# Common configuration variables
+# Constants that no one should not change.
+CONST_NULL_DISK_SIZE=0G
 #
+# Common user defined configuration variables
+#
 CLUSTER_DOMAIN_NAME=ciab.lip.ens-lyon.fr
 CLUSTER_STATIC_NETWORK_PREFIX="192.168.1"
 COMPUTE_NODE_BRIDGE=internal
 COMPUTE_NODE_CPUS_FILE=compute-nodes-cpus
 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_RAMDISK=/boot/initrd.img-`uname -r`
 COMPUTE_NODE_MAC_ADDRESS_PREFIX="00:16:3E:0F:6A"
@@ -13,14 +17,23 @@
 COMPUTE_NODE_MODEL_STATIC_NETWORK_POSTFIX=252
 COMPUTE_NODE_MODEL_NAME="compute-node-model"
 COMPUTE_NODE_NAME_PREFIX="compute-node-"
-COMPUTE_NODE_NUM=3
 COMPUTE_NODE_STATIC_NETWORK_PREFIX=$CLUSTER_STATIC_NETWORK_PREFIX
-COMPUTE_NODE_VCPUS=2
 DHCP_HOSTSFILE_BASENAME=dhcp-hostsfile
+FRONT_END_HOME_DISK_SIZE=512G
+FRONT_END_INTERFACES_TEMPLATE=interfaces.front-end
+FRONT_END_HOME_LOGICAL_VOLUME=/dev/vg_slow
+FRONT_END_NAME="frontend"
 FRONT_END_STATIC_NETWORK_POSTFIX=251
-FRONT_END_NAME="frontend"
+FRONT_END_SWAP_DISK="frontend-swap"
+FRONT_END_SWAP_DISK_SIZE=$CONST_NULL_DISK_SIZE # 0G means no swap disk.
+FRONT_END_SYSTEM_DISK="frontend-system-disk"
+FRONT_END_SYSTEM_DISK_SIZE=46G
+FRONT_END_SYSTEM_DISK_FILE_SYSTEM=ext3
+FRONT_END_SYSTEM_DISK_MOUNT_POINT=/mnt/frontend-system-disk
+FRONT_END_SYSTEM_LOGICAL_VOLUME=/dev/vg_fast
+FRONT_END_VCPUS=3
 HOSTS_FILE_BASENAME=hosts
-SWAP_DISK_LOGICAL_VOLUME=/dev/vg_guests
+SWAP_DISK_LOGICAL_VOLUME=/dev/vg_fast
 SWAP_DISK_POSTFIX="-swap"
 SWAP_DISK_PREFIX="compute-node-"
 SWAP_DISK_SIZE=1G
@@ -28,7 +41,7 @@
 SYSTEM_DISK_CLONE_PREFIX=$COMPUTE_NODE_NAME_PREFIX
 SYSTEM_DISK_CLONE_SIZE=20G # Half of the master size.
 SYSTEM_DISK_FILE_SYSTEM=ext3
-SYSTEM_DISK_LOGICAL_VOLUME=/dev/vg_guests
+SYSTEM_DISK_LOGICAL_VOLUME=/dev/vg_slow
 SYSTEM_DISK_MASTER=$SYSTEM_DISK_LOGICAL_VOLUME/compute-node-model-disk
 TEMPLATES_DIR=templates
 USERS_HOME_DISK="users-home-disk"
Index: trunk/shell/templates/etc/network/interfaces
===================================================================
--- trunk/shell/templates/etc/network/interfaces	(revision 15)
+++ trunk/shell/templates/etc/network/interfaces	(revision 16)
@@ -1,17 +0,0 @@
-# This file describes the network interfaces available on your system
-# and how to activate them. For more information, see interfaces(5).
-
-# The loopback network interface
-auto lo eth0
-iface lo inet loopback
-
-# The primary network interface
-
-iface eth0 inet static
- address __STATIC_ADDRESS__
- netmask 255.255.255.0
-
-#
-# The commented out line above will disable TCP checksumming which
-# might resolve problems for some users.  It is disabled by default
-#
Index: trunk/shell/templates/etc/network/interfaces.front-end
===================================================================
--- trunk/shell/templates/etc/network/interfaces.front-end	(revision 0)
+++ trunk/shell/templates/etc/network/interfaces.front-end	(revision 16)
@@ -0,0 +1,19 @@
+# This file describes the network interfaces available on your system
+# and how to activate them. For more information, see interfaces(5).
+
+# The loopback network interface
+auto lo eth0a eth1
+iface lo inet loopback
+#
+# The primary network interface
+iface eth0 inet dhcp
+#
+iface eth1 inet static
+ address __STATIC_ADDRESS__
+ netmask 255.255.255.0
+#
+# post-up  ethtool -K eth0 tx off
+#
+# The commented out line above will disable TCP checksumming which
+# might resolve problems for some users.  It is disabled by default
+#
Index: trunk/shell/templates/etc/network/interfaces.compute-node
===================================================================
--- trunk/shell/templates/etc/network/interfaces.compute-node	(revision 0)
+++ trunk/shell/templates/etc/network/interfaces.compute-node	(revision 16)
@@ -0,0 +1,18 @@
+# This file describes the network interfaces available on your system
+# and how to activate them. For more information, see interfaces(5).
+
+# The loopback network interface
+auto lo eth0
+iface lo inet loopback
+
+# The primary network interface
+
+iface eth0 inet static
+ address __STATIC_ADDRESS__
+ netmask 255.255.255.0
+#
+# post-up  ethtool -K eth0 tx off
+#
+# The commented out line above will disable TCP checksumming which
+# might resolve problems for some users.  It is disabled by default
+#
Index: trunk/shell/create-start-front-end
===================================================================
--- trunk/shell/create-start-front-end	(revision 0)
+++ trunk/shell/create-start-front-end	(revision 16)
@@ -0,0 +1,149 @@
+#! /bin/bash
+#
+# Create and start the front end.
+#
+# Get the directory of the script.
+SCRIPT_PATH=`dirname $0`
+# Get the script name.
+SCRIPT_NAME=`basename $0`
+# Source the common configuration variables.
+. $SCRIPT_PATH/c-i-a-b.common
+#
+# Check that the front-end virtual machine does not already exist.
+#
+CURRENT_HOST_NAME=$FRONT_END_NAME
+IS_RUNNING=`xm list | grep $CURRENT_HOST_NAME`
+if [ -n "$IS_RUNNING" ]
+  then
+    echo
+    echo The \"$CURRENT_HOST_NAME\" domU already exists. Aborting!
+    echo
+    exit 1
+fi
+
+# Create the VM system disk.
+COMPUTE_NODE_SYSTEM_DISK="${SYSTEM_DISK_CLONE_PREFIX}${NODE_NUMBER_STRING}${SYSTEM_DISK_CLONE_POSTFIX}"
+lvcreate -L$FRONT_END_SYSTEM_DISK_SIZE -s \
+         -n  $FRONT_END_SYSTEM_DISK \
+         $FRONT_END_SYSTEM_LOGICAL_VOLUME
+# Create a File System on the VM system disk.
+mkfs -t $FRONT_END_SYSTEM_DISK_FILE_SYSTEM \
+        $FRONT_END_SYSTEM_LOGICAL_VOLUME/$FRONT_END_SYSTEM_DISK
+# If necessary, create the swap volume for the front end.
+if [ $FRONT_END_SWAP_DISK_SIZE != $CONST_NULL_DISK_SIZE ]; then
+  lvcreate -L $FRONT_END_SWAP_DISK_SIZE \
+           -n $FRONT_END_SWAP_DISK \
+           $FRONT_END_SYSTEM_LOGICAL_VOLUME
+  mkswap $FRONT_END_SYSTEM_LOGICAL_VOLUME/$FRONT_END_SWAP_DISK
+fi
+# 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
+fi
+mount $FRONT_END_SYSTEM_LOGICAL_VOLUME/$FRONT_END_SYSTEM_DISK \
+      $FRONT_END_SYSTEM_DISK_MOUNT_POINT
+#
+# Configure the specific files from templates
+#
+# /etc/network/interfaces
+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}.${NODE_NUMBER}"
+cp templates$CURRENT_PATH/hosts \
+   $COMPUTE_NODE_DISK_MOUNT_POINT/$CURRENT_PATH
+rpl __COMPUTE_NODE_IP__ $CURRENT_HOST_IP \
+    ${COMPUTE_NODE_DISK_MOUNT_POINT}${CURRENT_PATH}/hosts
+rpl __COMPUTE_NODE_NAME__ $CURRENT_HOST_NAME \
+    ${COMPUTE_NODE_DISK_MOUNT_POINT}${CURRENT_PATH}/hosts
+# /etc/resolv.conf
+CURRENT_PATH=/etc
+cp $TEMPLATES_DIR$CURRENT_PATH/resolv.conf \
+   ${COMPUTE_NODE_DISK_MOUNT_POINT}${CURRENT_PATH}/resolv.conf
+rpl __CLUSTER_DOMAIN_NAME__ "${CLUSTER_DOMAIN_NAME}." \
+   ${COMPUTE_NODE_DISK_MOUNT_POINT}${CURRENT_PATH}/resolv.conf
+rpl __FRONT_END_STATIC_ADDRESS__ "${CLUSTER_STATIC_NETWORK_PREFIX}.$FRONT_END_STATIC_NETWORK_POSTFIX" \
+   ${COMPUTE_NODE_DISK_MOUNT_POINT}${CURRENT_PATH}/resolv.conf
+#
+# 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`
+#
+# Create the Xen configuration file from a template
+#
+CURRENT_PATH=/etc/xen
+cp templates$CURRENT_PATH/compute-node.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" \
+   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
+rpl __COMPUTE_NODE_KERNEL__ $COMPUTE_NODE_KERNEL \
+   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
+rpl __COMPUTE_NODE_RAMDISK__ $COMPUTE_NODE_RAMDISK \
+   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
+rpl __COMPUTE_NODE_MEMORY__ $COMPUTE_NODE_MEMORY \
+   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
+rpl __COMPUTE_NODE_VCPUS__ $COMPUTE_NODE_VCPUS \
+   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
+CPUS_LIST=`sed -n ${NODE_NUMBER},${NODE_NUMBER}p $SCRIPT_PATH/$COMPUTE_NODE_CPUS_FILE`
+CPUS=""
+for i in $CPUS_LIST
+  do
+    if [ "x$CPUS" == "x" ]
+      then
+        CPUS=$i
+      else
+        CPUS="$CPUS,$i"
+    fi
+done
+rpl __COMPUTE_NODE_CPUS__ $CPUS \
+   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
+rpl __COMPUTE_NODE_SYSTEM_DISK__ $SYSTEM_DISK_LOGICAL_VOLUME/$COMPUTE_NODE_SYSTEM_DISK \
+   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
+rpl __COMPUTE_NODE_SWAP_DISK__ $SYSTEM_DISK_LOGICAL_VOLUME/$COMPUTE_NODE_SWAP_DISK \
+   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
+rpl __COMPUTE_NODE_HOST_NAME__ $CURRENT_HOST_NAME \
+   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
+rpl __COMPUTE_NODE_IP__ $ADDRESS \
+   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
+rpl __COMPUTE_NODE_MAC__ $COMPUTE_NODE_MAC_ADDRESS \
+   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
+rpl __COMPUTE_NODE_BRIDGE__ $COMPUTE_NODE_BRIDGE \
+   $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
+
+#
+# Umount the compute node system disk
+#
+umount $COMPUTE_NODE_DISK_MOUNT_POINT
+#
+# Start the virtual machine
+#
+xm create $SCRIPT_PATH/$CURRENT_HOST_NAME.cfg
+#
+# Wait until the virtual machine has started
+#
+IS_RUNNING=""
+while [ -z "$IS_RUNNING" ]
+  do
+    IS_RUNNING=`xm list | grep $CURRENT_HOST_NAME`
+    sleep 1
+done
+#
+# Pin the VCPUs to "real" CPUs.
+#
+VCPU_NUM=0
+for i in $CPUS_LIST
+  do
+    xm vcpu-pin $CURRENT_HOST_NAME $VCPU_NUM $i
+    VCPU_NUM=$((VCPU_NUM + 1))
+done
\ No newline at end of file

Property changes on: trunk/shell/create-start-front-end
___________________________________________________________________
Added: svn:executable
   + *

