Statistiques
| Révision :

root / trunk / shell / front-end-start @ 49

Historique | Voir | Annoter | Télécharger (870 octet)

1
#! /bin/bash -x
2
#
3
# ST - 2012-05-25
4
#
5
# Start the front end.
6
#
7
# Get the directory of the script.
8
SCRIPT_PATH=`dirname $0`
9
# Get the script name.
10
SCRIPT_NAME=`basename $0`
11
# Source the common configuration variables.
12
. $SCRIPT_PATH/c-i-a-b.common
13
#
14
CURRENT_HOST_NAME=$FRONT_END_HOST_NAME
15
#
16
CPUS_LIST=$FRONT_END_CPUS_LIST
17
CPUS=""
18
for i in $CPUS_LIST
19
  do
20
    if [ "x$CPUS" == "x" ]
21
      then
22
        CPUS=$i
23
      else
24
        CPUS="$CPUS,$i"
25
    fi
26
done
27
#
28
# Start the virtual machine
29
#
30
xm create $CONST_XEN_CONFIG_DIR/$CURRENT_HOST_NAME.cfg
31
#
32
# Wait until the virtual machine has started
33
#
34
IS_RUNNING=""
35
while [ -z "$IS_RUNNING" ]
36
  do
37
    IS_RUNNING=`xm list | grep $CURRENT_HOST_NAME`
38
    sleep 1
39
done
40
#
41
# Pin the VCPUs to "real" CPUs.
42
#
43
VCPU_NUM=0
44
for i in $CPUS_LIST
45
  do
46
    xm vcpu-pin $CURRENT_HOST_NAME $VCPU_NUM $i
47
    VCPU_NUM=$((VCPU_NUM + 1))
48
done
49
#
50
exit 0