Révision 19
trunk/shell/set-xen-config (revision 19) | ||
---|---|---|
1 |
#! /bin/sh -x |
|
2 |
# |
|
3 |
# ST 2012-03-09 |
|
4 |
# |
|
5 |
# Set the Xen configuration files |
|
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 |
# File /etc/xen-tools/xen-tools.conf |
|
15 |
CURRENT_FILE=xen-tools.conf |
|
16 |
# Save the original files. |
|
17 |
CURRENT_DIR=/etc/xen-tools |
|
18 |
mv $CURRENT_DIR/$CURRENT_FILE $CURRENT_DIR/$CURRENT_FILE.orig.`date +%Y-%m-%d` |
|
19 |
# Set the new configuration file. |
|
20 |
cp $SCRIPT_PATH/$TEMPLATES_DIR$CURRENT_DIR/$CURRENT_FILE $CURRENT_DIR |
|
21 |
rpl __CLUSTER_ARCH__ $CLUSTER_ARCH $CURRENT_DIR/$CURRENT_FILE |
|
22 |
rpl __CLUSTER_IMAGE__ $CLUSTER_IMAGE $CURRENT_DIR/$CURRENT_FILE |
|
23 |
if [ "$CLUSTER_SWAP_SIZE" = "$CONST_NULL_DISK_SIZE" ]; then |
|
24 |
rpl __CLUSTER_NOSWAP__ "'$CLUSTER_NOSWAP'" $CURRENT_DIR/$CURRENT_FILE |
|
25 |
rpl __CLUSTER_SWAP_SIZE__ "'$CLUSTER_SWAP_SIZE'" $CURRENT_DIR/$CURRENT_FILE |
|
26 |
else |
|
27 |
rpl __CLUSTER_NOSWAP__ "'#$CLUSTER_NOSWAP'" $CURRENT_DIR/$CURRENT_FILE |
|
28 |
rpl __CLUSTER_SWAP_SIZE__ "'$CLUSTER_SWAP_SIZE'" $CURRENT_DIR/$CURRENT_FILE |
|
29 |
fi |
|
30 |
# |
|
31 |
# Script /etc/xen/scripts/network-bridge-internal. |
|
32 |
CURRENT_FILE=$CLUSTER_BRIDGE_SCRIPT |
|
33 |
# No orignal file to save |
|
34 |
CURRENT_DIR=/etc/xen/scripts |
|
35 |
# Set the file. |
|
36 |
cp $SCRIPT_PATH/$TEMPLATES_DIR$CURRENT_DIR/$CURRENT_FILE $CURRENT_DIR |
|
37 |
chmod u+x $CURRENT_DIR/$CURRENT_FILE |
|
38 |
# |
|
39 |
# File /etc/xen/xend-config.sxp |
|
40 |
CURRENT_FILE=xend-config.sxp |
|
41 |
# Save the original files. |
|
42 |
CURRENT_DIR=/etc/xen |
|
43 |
mv $CURRENT_DIR/$CURRENT_FILE $CURRENT_DIR/$CURRENT_FILE.orig.`date +%Y-%m-%d` |
|
44 |
# Set the new configuration file. |
|
45 |
cp $SCRIPT_PATH/$TEMPLATES_DIR$CURRENT_DIR/$CURRENT_FILE $CURRENT_DIR |
|
46 |
rpl __CLUSTER_BRIDGE_CLAUSE__ "$CLUSTER_BRIDGE_CLAUSE" \ |
|
47 |
$CURRENT_DIR/$CURRENT_FILE |
|
48 |
rpl __DOM0_CPUS_CLAUSE__ "$DOM0_CPUS_CLAUSE" $CURRENT_DIR/$CURRENT_FILE |
|
49 |
# |
|
50 |
# Restart Xend |
|
51 |
service xend restart |
|
52 |
# Pin the VPCU to the selected CPU for dom0 |
|
53 |
VCPU_NUM=0 |
|
54 |
for i in $DOM0_CPUS_LIST; do |
|
55 |
xm vcpu-pin $CONST_DOM0_NAME $VCPU_NUM $i |
|
56 |
VCPU_NUM=$((VCPU_NUM + 1)) |
|
57 |
done |
|
58 |
|
|
0 | 59 |
Formats disponibles : Unified diff