我们正在计划我们的AHV迁移,并希望在他们协商补丁中断窗口期间迁移75%的虚拟机(约400台),以最小化有多少应用程序团队为我们设置时间表。这些中断窗口大多在凌晨3点。
我们希望找到一种自动化/脚本化的方式来进行切换,这样我们就可以设置一个作业在该窗口中运行该脚本。我看到一些REST调用看起来可以做到这一点。有人真的做过吗?如果是这样的话,他们是否介意分享一段他们的Powershell/REST代码?
提前谢谢!
最佳答案大卫爱尔兰人
\u00a0<\/p>
I can give you some guidance on the sequence of APIs we need to call to cutover VMs.<\/p>
workload in our APIs is a VM, so wherever workload id is mentioned we need VM uuid to be passed.<\/p>
- We can use \"https:\/\/{move_ip}\/move\/v2\/plans\/{id}\/workloads\/list\" to get a list of all workloads\/VMs list in a migplan by passing in migplan uuid\/id. In the response, we get a list of VMs under VMStatus, there we can get VM uuid that we can use to call cutover API. Under VMStatus, we also get State of the VM. When the value is 5, it means the VM is ready for cutover.<\/li>
- For performing cutover of a particular VM, we can call https:\/\/{move_ip}\/move\/v2\/plans\/{id}\/workloads\/{wid}\/action by passing in VM id in the path parameter 'wid' and passing in the payload:<\/li> <\/ol>
{\"Spec\": {<\/code>
\"Action\": \"cutover\"<\/code>
}}<\/code><\/p> <\/blockquote>","className":"post__content__best_answer"}">