if [ $(netstat -tlnp|grep 59128|wc -l) -le 0 ]
then
echo "restart vm 128"
qm shutdown 128
/usr/bin/kvm -id 128 -name WSW7MMZ -chardev socket,id=qmp,path=/var/run/qemu-server/128.qmp,server,nowait -mon chardev=qmp,mode=control -chardev socket,id=qmp-event,path=/var/run/qmeventd.sock,reconnect=5 -mon
chardev=qmp-event,mode=control -pidfile /var/run/qemu-server/128.pid -daemonize -smbios type=1,uuid=da46a669-****-4f86-b346-54103ff925c6 -smp 2,sockets=1,cores=2,maxcpus=2 -nodefaults -boot menu=on,strict=on,re
boot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg -vnc unix:/var/run/qemu-server/128.vnc,x509,password -no-hpet -cpu kvm64,+lahf_lm,+sep,+kvm_pv_unhalt,+kvm_pv_eoi,hv_spinlocks=0x1fff,hv_vapic,hv_ti
me,hv_reset,hv_vpindex,hv_runtime,hv_relaxed,hv_synic,hv_stimer,enforce -m 4096 -spice port=59128,addr=0.0.0.0,disable-ticketing -k de -device pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e -device pci-bri
dge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f -device piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2 -device qxl-vga,id=vga,bus=pci.0,addr=0x2 -chardev socket,path=/var/run/qemu-server/128.qga,server,nowait,id=qg
a0 -device virtio-serial,id=qga0,bus=pci.0,addr=0x8 -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0 -spice tls-port=61002,addr=127.0.0.1,tls-ciphers=HIGH,seamless-migration=on -device virtio-seri
al,id=spice,bus=pci.0,addr=0x9 -chardev spicevmc,id=vdagent,name=vdagent -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -iscsi initiator-
name=iqn.1993-08.org.debian:01:be92499b2040 -drive if=none,id=drive-ide2,media=cdrom,aio=threads -device ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200 -drive file=/var/lib/datastore2/images/128/
vm-128-disk-1.qcow2,if=none,id=drive-virtio0,format=qcow2,cache=none,aio=native,detect-zeroes=on -device virtio-blk-pci,drive=drive-virtio0,id=virtio0,bus=pci.0,addr=0xa,bootindex=100 -netdev type=tap,id=net0,if
name=tap128i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown,vhost=on -device virtio-net-pci,mac=1E:F9:1C:B8:E4:2C,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300 -rt
c driftfix=slew,base=localtime -machine type=pc -global kvm-pit.lost_tick_policy=discard
fi