summaryrefslogtreecommitdiffstats
path: root/kvm-wrapper.sh
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2015-07-02 18:25:21 +0200
committerDominique Martinet <asmadeus@codewreck.org>2015-07-02 18:26:37 +0200
commit8d8396b475183d98081327ff80d45863fc643d3d (patch)
tree3b7c9d9fb02c3a176d2a284477e1b201977b6dd9 /kvm-wrapper.sh
parent79aa5c8e41d32daa880c3945adb2a51e502587bf (diff)
create: allocate a random node in cluster to run on
Diffstat (limited to 'kvm-wrapper.sh')
-rwxr-xr-xkvm-wrapper.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/kvm-wrapper.sh b/kvm-wrapper.sh
index 2e8c573..f49981c 100755
--- a/kvm-wrapper.sh
+++ b/kvm-wrapper.sh
@@ -773,7 +773,9 @@ function kvm_create_descriptor ()
awk '/#xxDEFAULTxx#/,0 { print "#" $0}' $CONFFILE|grep -v "#xxDEFAULTxx#" >> "$VM_DESCRIPTOR"
sed -i 's/#KVM_MACADDR\[0\]="`random_mac`/KVM_MACADDR[0]="'`random_mac`'/g' "$VM_DESCRIPTOR"
- sed -i 's/#KVM_CLUSTER_NODE="`hostname -s`/KVM_CLUSTER_NODE="'`hostname -s`'/g' "$VM_DESCRIPTOR"
+ #sed -i 's/#KVM_CLUSTER_NODE="`hostname -s`/KVM_CLUSTER_NODE="'`hostname -s`'/g' "$VM_DESCRIPTOR"
+ local NODENAME=$(grep KVM_CLUSTER_NODE "$VM_DESCRIPTOR" | cut -d= -f2)
+ sed -i 's/#KVM_CLUSTER_NODE=.*/KVM_CLUSTER_NODE="'$(eval echo "$NODENAME")'"/g' "$VM_DESCRIPTOR"
if [[ -n "$3" ]]; then
qcow_create_disk "$2" "$3"