We can lauch vm through qemu quickly. These steps are:
1 | qemu-system-x86_64 -nographic -enable-kvm -cpu host,+x2apic,pmu=on -smp 32,sockets=2,cores=16,threads=1 -m 64G -device virtio-net-pci,netdev=n1 -netdev user,id=n1,hostfwd=tcp::1688-:22 -drive file=/home/zhaoguanjun.zgj/aliyun_3_x64_20G_nocloud_alibase_20211025.qcow2,if=none,id=virtio-disk0 -device virtio-blk-pci,drive=virtio-disk0 -monitor pty -cpu host -machine q35 -drive file=/dev/sdb1,if=none,id=drive-virtio-disk2,format=raw,cache=none,aio=native -device virtio-blk-pci,scsi=off,num-queues=4,config-wce=off,drive=drive-virtio-disk2,id=virtio-disk1 -gdb tcp::1111 |
Some params and the related meanings:
- -nographic, Disable graphical output and redirect serial I/Os to console
- -daemonize, Daemonize the qemu thread
If you want to add a mdev device, you should:
1 | 1. uuid # For example, a6613d90-c944-11ed-a67e-00e04c84d2c4 |
Live migration from A to B:
1 | A: Launch VM, source |
Then, if migration status echo ‘completed’, the VM migrate from A to B successfully.