root / trunk / shell / compute-node-model-start @ 59
Historique | Voir | Annoter | Télécharger (897 octet)
1 |
#! /bin/bash -x |
---|---|
2 |
# |
3 |
# ST - 2012-07-03 |
4 |
# |
5 |
# Start the compute node model. |
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=$COMPUTE_NODE_MODEL_HOST_NAME |
15 |
# |
16 |
CPUS_LIST=$COMPUTE_NODE_MODEL_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 |