About "Stateless Vm"

ajcheng

New Member
Sep 3, 2012
9
0
1
hi ,

i try to create a vm :when the vm restart,it's back to the initial state.

like snapshot rollback .i want the vm aotu rollbak.

now,i use command "-snapshot" to start vm, like this

/usr/bin/kvm -id 100 -chardev socket,id=qmp,path=/var/run/qemu-server/100.qmp,server,nowait -mon chardev=qmp,mode=control -vnc unix:/var/run/qemu-server/100.vnc,x509,password -pidfile /var/run/qemu-server/100.pid -daemonize -name win7-template -smp sockets=2,cores=2 -nodefaults -boot menu=on -vga qxl -no-hpet -cpu kvm64,hv_spinlocks=0xffff,hv_relaxed,+x2apic,+sep -k en-us -spice tls-port=61000,addr=127.0.0.1,tls-ciphers=DES-CBC3-SHA,seamless-migration=on -device virtio-serial,id=spice,bus=pci.0,addr=0x9 -chardev spicevmc,id=vdagent,name=vdagent -device virtserialport,chardev=vdagent,name=com.redhat.spi ce.0 -m 4048 -device piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -drive file=/var/lib/vz/template/iso/cn_windows_7_ultimate_with_sp1_x86_dvd_618763.iso, if=none,id=drive-ide2,media=cdrom,aio=native -device ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=100 -drive file=/var/lib/vz/images/100/vm-100-disk-1.qcow2,if=none,id=drive-virtio0,format=qcow2,aio=native,cache=none -device virtio-blk-pci,drive=drive-virtio0,id=virtio0,bus=pci.0,addr=0xa,bootindex=20 0 -drive file=/var/lib/vz/template/iso/virtio-win-0.1-30.iso,if=none,id=drive-ide0,media=cdrom,aio=native -device ide-cd,bus=ide.0,unit=0,drive=drive-ide0,id=ide0,bootindex=101 -netdev type=tap,id=net0,ifname=tap100i0,script=/var/lib/qemu-server/pve-bridge,vhost=on -device virtio-net-pci,mac=C2:A4:72:F6:C4:1C,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootinde x=300 -rtc driftfix=slew,base=localtime -global kvm-pit.lost_tick_policy=discard -snapshot

so when the vm restart , it's rollback.

but this way is to trouble,any other ways ? i think the best way to solve is modify the configuration file.

thank you for your mind!