Azure VM 升级或降级停机时间

Azure VM upgrade or downgrade downtime

这是我第一次使用 Azure,我已经习惯了 AWS。在 AWS 中,当您降级或升级您的实例时,预计会出现停机时间。在 Azure 文档中,升级或降级 VM 时没有指定停机时间,这是否意味着没有停机时间?如果有,停机时间是多久?

涉及停机时间。根据部署模型(资源管理器或经典),调整大小将涉及仅停止 VM(前者)或删除并重新创建具有新大小的 VM(后者)。

来自https://azure.microsoft.com/en-in/blog/resize-virtual-machines/

调整资源管理器 (ARM) 虚拟机s

If your VM(s) are deployed using the Resource Manager (ARM) deployment model you can resize VMs by first stopping your VM, selecting a new VM size and then restarting the VM. If the VM you wish to resize is part of an availability set, then you must stop all VMs in the availability set before changing the size of any VM in the availability set.

调整经典 (ASM) 虚拟机的大小

Resizing a VM deployed using Classic (ASM) deployment model is more difficult if the new size is not supported by the hardware cluster where the VM is currently deployed. Unlike VMs deployed through the Azure Resource Manager deployment model it is not possible to resize the VM while the VM is in a stopped state. So for VMs using the classic deployment model the VMs must be deleted and then recreated using the same OS and data disks.

在 Azure 中,有两种类型的 Microsoft Azure 平台事件会影响虚拟机的可用性:planned maintenance and unplanned maintenance.
为了减少因这些事件中的一个或多个而导致的停机时间的影响,我们建议您的虚拟机采用以下高可用性最佳做法:
1.Configure 冗余可用性集中的多个虚拟机
2.Configure 每个应用程序层分为单独的可用性集
3.Combine 具有可用性集的负载均衡器
4.Use 每个可用性集的多个存储帐户

注意:避免将单个 实例虚拟机留在其自身的可用性集中。此配置中的 VM 有资格获得 SLA 保证,并在 Azure 计划内维护事件期间面临停机时间,除非单个 VM 使用 Azure Premium Storage。对于使用高级存储的单个 VM,适用 Azure SLA。

有关 Azure VM SLA 的更多信息,请参阅 link

是否可以关闭 VM 取决于要更改的新 VM 大小在现有硬件集群上是否可用以及 VM 是否部署在可用性集中。

Microsoft 文档上有一篇很好的文章 here,解释了何时可以更改大小而不取消分配 VM,以及何时必须取消分配 VM。

简而言之,使用 Powershell,您可以更改 VM 的大小,并且如果新的 VM 大小在您的硬件集群上可用,则您不必停止和释放 VM。

请注意,由于 VM 大小更新,VM 仍会关闭并重新启动,通常平均需要 2 分钟才能启动,运行 windows VM 没有根据我的个人经验进行任何定制。