执行机密虚拟机热迁移
- 为启用迁移功能,可在源端服务器的QEMU启动参数中添加virtcca-migration-cap=1。
<qemu:commandline> <qemu:arg value='-object'/> <qemu:arg value='tmm-guest,id=tmm0,sve-vector-length=128,num-pmu-counters=1,virtcca-migration-cap=1'/> </qemu:commandline> - 启动待迁移的虚拟机。
virsh start <cvm-name>
cvm-name为待迁移虚拟机名称。
- 执行以下命令进行机密虚拟机热迁移。
virsh migrate --live --verbose --copy-storage-all <cvm-name> --cvm-miguri <远端migcvm监听ip> qemu+ssh://<dest-ip>/system
其中:
- cvm-name为待迁移虚拟机名称。
- dest-ip为对端服务器的IP地址。
- --copy-storage-all 用于非共享存储场景,迁移过程中全量复制虚拟机镜像文件到目标节点。
- --verbose参数用于显示迁移进度,若增加了--copy-storage-all参数,则进度为两段,第一段为文件传输进度,第二段为热迁移进度。
非共享存储场景迁移会提示以下错误。
error: Unsafe migration: Migration without shared storage is unsafe
可通过添加--unsafe参数规避。
virsh migrate --live --verbose --unsafe --copy-storage-all <cvm-name> --cvm-miguri <远端migcvm监听ip> qemu+ssh://<dest-ip>/system
父主题: 使能机密虚拟机热迁移