-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrunvm-daemon
More file actions
executable file
·55 lines (46 loc) · 1.39 KB
/
runvm-daemon
File metadata and controls
executable file
·55 lines (46 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# vm name
name=$7
#file=migbench.img
file=$1
#file=vm512-29.img
image=/var/lib/libvirt/images/nfs/c11node9/$file
#ram=536
#ram=1024
#ram=128
ram=$2
vcpu=$3 # 1-8
telnetport=$4 # starting 4446
vncport=$5 # starting 1 (5901)
qemudir=/root/qemu
#version=qemu-kvm-1.2.0
#version=qemu-1.6.0
#version=qemu-1.5.50
#version=qemu-postcopy # qemu 1.1.50
version=hybrid # qemu 1.6.50
# generate a random mac address for the qemu nic
#mac=`printf 'DE:AD:BE:EF:%02X:%02X\n' $((RANDOM%256)) $((RANDOM%256))`
#mac=DE:AD:BE:EF:0C:0F
mac=$6
echo $name $file $ram $vcpu $telnetport :$vncport $mac
#./qemu-postcopy/x86_64-softmmu/qemu-system-x86_64 \
#./qemu-1.5.2/x86_64-softmmu/qemu-system-x86_64 \
$qemudir/$version/x86_64-softmmu/qemu-system-x86_64 \
-name $name \
-drive file=$image \
-enable-kvm \
-m $ram \
-smp $vcpu \
-monitor telnet:0:$telnetport,server,nowait \
-vnc :$vncport \
-device virtio-net-pci,netdev=hn0,id=nic1,mac=$mac -netdev tap,helper=$qemudir/$version/qemu-bridge-helper,id=hn0 \
-daemonize
#-incoming tcp:0:$listenport \
#-device e1000,netdev=user.0 -netdev user,id=user.0,hostfwd=tcp::5555-:22 \
#-device rtl8139,netdev=hostnet0,id=net0 \
#-name $name \
#-qmp tcp:0:4445,server --monitor stdio \
#-qmp tcp:0:4446,server \
#echo access VM: telnet localhost 4446
#echo script: nc localhost 4446
#echo Do not enter \'quit\' unless you want to stop the VM