您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

将 Windows 虚拟机重新部署到新的 Azure 节点Redeploy Windows virtual machine to new Azure node

如果在对远程桌面 (RDP) 连接或应用程序对基于 Windows 的 Azure 虚拟机 (VM) 的访问进行故障排除时遇到困难,重新部署 VM 可能会有帮助。If you have been facing difficulties troubleshooting Remote Desktop (RDP) connection or application access to Windows-based Azure virtual machine (VM), redeploying the VM may help. 重新部署 VM 时,Azure 会关闭该 VM,并将其移到 Azure 基础结构中的新节点,然后重新打开它,同时保留所有配置选项和关联的资源。When you redeploy a VM, Azure will shut down the VM, move the VM to a new node within the Azure infrastructure, and then power it back on, retaining all your configuration options and associated resources. 本文介绍了如何使用 Azure PowerShell 或 Azure 门户重新部署 VM。This article shows you how to redeploy a VM using Azure PowerShell or the Azure portal.

备注

重新部署 VM 后,临时磁盘将丢失,并将更新与虚拟网络接口关联的动态 IP 地址。After you redeploy a VM, the temporary disk is lost and dynamic IP addresses associated with virtual network interface are updated.

使用 Azure PowerShellUsing Azure PowerShell

请确保已在计算机上安装最新的 Azure PowerShell 1.x。Make sure you have the latest Azure PowerShell 1.x installed on your machine. 有关详细信息,请参阅如何安装和配置 Azure PowerShellFor more information, see How to install and configure Azure PowerShell.

以下示例部署 myResourceGroup 资源组中名为 myVM 的 VM:The following example deploys the VM named myVM in the resource group named myResourceGroup:

Set-AzVM -Redeploy -ResourceGroupName "myResourceGroup" -Name "myVM"

使用 Azure 门户Use the Azure portal

  1. 选择想要重新部署的 VM,然后选择“设置”边栏选项卡中的“重新部署”按钮。Select the VM you wish to redeploy, then select the Redeploy button in the Settings blade. 可能需要向下滚动,查看包含“重新部署”按钮的“支持和故障排除”部分,如以下示例所示:You may need to scroll down to see the Support and Troubleshooting section that contains the 'Redeploy' button as in the following example:

    Azure VM 边栏选项卡

  2. 若要确认该操作,请选择“重新部署”按钮:To confirm the operation, select the Redeploy button:

    “重新部署 VM”边栏选项卡

  3. VM 准备好重新部署时,该 VM 的“状态”会更改为“正在更新”,如以下示例所示:The Status of the VM changes to Updating as the VM prepares to redeploy, as shown in the following example:

    VM 正在更新

  4. VM 在新的 Azure 主机上启动时,“状态”将更改为“正在启动”,如以下示例所示:The Status then changes to Starting as the VM boots up on a new Azure host, as shown in the following example:

    VM 正在启动

  5. VM 完成启动过程后,“状态”返回到“正在运行”,这表示 VM 已成功重新部署:After the VM finishes the boot process, the Status then returns to Running, indicating the VM has been successfully redeployed:

    VM 正在运行

后续步骤Next steps

如果在连接 VM 时遇到问题,可以在 troubleshooting RDP connections(RDP 连接故障排除)或 detailed RDP troubleshooting steps(详细的 RDP 故障排除步骤)中找到具体的帮助信息。If you are having issues connecting to your VM, you can find specific help on troubleshooting RDP connections or detailed RDP troubleshooting steps. 如果无法访问在 VM 上运行的应用程序,还可以阅读应用程序故障排除问题If you cannot access an application running on your VM, you can also read application troubleshooting issues.