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