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

使用 Azure 门户在可用性区域中创建 Windows 虚拟机Create a Windows virtual machine in an availability zone with the Azure portal

本文逐步说明如何使用 Azure 门户在 Azure 可用性区域中创建虚拟机。This article steps through using the Azure portal to create a virtual machine in an Azure availability zone. 可用性区域是 Azure 区域中物理上独立的区域。An availability zone is a physically separate zone in an Azure region. 使用可用性区域可以在整个数据中心发生故障或服务中断(这种情况很少见)时保护应用和数据。Use availability zones to protect your apps and data from an unlikely failure or loss of an entire datacenter.

备注

Azure 可用性区域处于预览状态,已准备好在开发和测试方案中使用。Azure Availability Zones is in preview and is ready for your development and test scenarios. 仅针对经挑选的一些 Azure 资源、区域和大小系列提供此支持。Support is available for select Azure resources, regions, and size families. 有关如何开始使用以及可以使用可用性区域尝试哪些 Azure 资源、区域和大小系列的详细信息,请参阅可用性区域概述For more information on how to get started, and which Azure resources, regions, and size families you can try with Availability Zones, see Overview of Availability Zones. 可以在 Azure 网站上提供反馈You can provide feedback on the Azure website. 若需支持,请联系 StackOverflow创建 Azure 支持票证For support, contact StackOverflow or open an Azure support ticket.

登录 AzureLog in to Azure

登录 Azure 门户 ( https://portal.azure.com )。Log in to the Azure portal at https://portal.azure.com.

创建虚拟机Create virtual machine

  1. 单击 Azure 门户左上角的“新建”按钮。Click the New button found on the upper left-hand corner of the Azure portal.

  2. 选择“计算”,然后选择“Windows Server 2016 Datacenter”。Select Compute, and then select Windows Server 2016 Datacenter.

  3. 输入虚拟机信息。Enter the virtual machine information. 在此处输入的用户名和密码用于登录到虚拟机。The user name and password entered here is used to log in to the virtual machine. 完成后,单击“确定”。When complete, click OK.

    在门户边栏选项卡中输入 VM 的基本信息

  4. 为 VM 选择大小。Select a size for the VM. 若要查看更多的大小,请选择“全部查看”或更改“支持的磁盘类型”筛选器。To see more sizes, select View all or change the Supported disk type filter. 请小心选择一个可用性区域预览版中支持的大小,如 DS1_v2 StandardTake care to select one of the sizes supported in the availability zones preview, such as DS1_v2 Standard.

    显示 VM 大小的屏幕截图

  5. 在“设置” > “高可用性”下,从“可用性区域”下拉列表中选择一个带编号的区域,保留其余默认值,并单击“确定”。Under Settings > High availability, select one of the numbered zones from the Availability zone dropdown, keep the remaining defaults, and click OK.

    选择可用性区域

  6. 在摘要页上,单击“购买”以开始虚拟机部署。On the summary page, click Purchase to start the virtual machine deployment.

  7. VM 将固定到 Azure 门户仪表板。The VM will be pinned to the Azure portal dashboard. 完成部署后,会自动打开 VM 摘要。Once the deployment has completed, the VM summary automatically opens.

IP 地址和托管磁盘的区域Zone for IP address and managed disk

当 VM 部署在可用性区域中时,IP 地址和托管磁盘资源将部署在同一可用性区域中。When the VM is deployed in an availability zone, the IP address and managed disk resources are deployed in the same availability zone. 可以使用 Azure PowerShell 确认区域设置。You can confirm the zone settings using Azure PowerShell. 如果需要进行安装或升级,请参阅安装 Azure PowerShell 模块If you need to install or upgrade, see Install Azure PowerShell module.

以下示例获取名为 myResourceGroup 的资源组中资源的相关信息。The following examples get information about the resources in a resource group named myResourceGroup. 替换为用于创建 VM 的资源组的名称。Substitute the name of the resource group you used to create the VM.

使用 Get-AzureRmPublicIpAddress 查找公共 IP 地址的区域:Find the zone of the public IP address with Get-AzureRmPublicIpAddress:

Get-AzureRmPublicIpAddress -ResourceGroupName myResourceGroup

输出中的 Zones 设置显示,公共 IP 地址与 VM 位于相同的可用性区域中:The Zones setting in the output shows that the public IP address is in the same availability zone as the VM:

Name                     : myVM-ip
ResourceGroupName        : myResourceGroup
Location                 : eastus2
Id                       : /subscriptions/e44f251c-c67e-4760-9ed6-bf99a306ecff/resourceGroups/danlep0911/providers/Micr
                           osoft.Network/publicIPAddresses/myVM-ip
Etag                     : W/"b67e14c0-7e8a-4d12-91c5-da2a5dfad132"
ResourceGuid             : 314bf57d-9b25-4474-9282-db3561d536aa
ProvisioningState        : Succeeded
Tags                     :
PublicIpAllocationMethod : Dynamic
IpAddress                : 13.68.16.25
PublicIpAddressVersion   : IPv4
IdleTimeoutInMinutes     : 4
IpConfiguration          : {
                             "Id": "/subscriptions/e44f251c-c67e-4760-9ed6-bf99a306ecff/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/myVM11842/ipConfigurations/ipconfig1"
                           }
DnsSettings              : null
Zones                    : {2}

此外,还在相同的可用性区域中创建了 VM 的托管磁盘资源。The managed disk resource for the VM is also created in the same availability zone. 可以使用 Get-AzureRmDisk 验证此结果:You can verify this with Get-AzureRmDisk:

Get-AzureRmDisk -ResourceGroupName myResourceGroup

输出显示,托管磁盘与 VM 位于相同的可用性区域中:The output shows that the managed disk is in the same availability zone as the VM:

ResourceGroupName  : myResourceGroup
AccountType        : PremiumLRS
OwnerId            : /subscriptions/d5b9d4b7-6fc1-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.
                     Compute/virtualMachines/myVM
ManagedBy          : /subscriptions/d5b9d4b7-6fc1-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.
                     Compute/virtualMachines/myVM
Sku                : Microsoft.Azure.Management.Compute.Models.DiskSku
Zones              : {2}
TimeCreated        : 9/7/2017 6:57:26 PM
OsType             : Windows
CreationData       : Microsoft.Azure.Management.Compute.Models.CreationData
DiskSizeGB         : 127
EncryptionSettings :
ProvisioningState  : Succeeded
Id                 : /subscriptions/d5b9d4b7-6fc1-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.
                     Compute/disks/myVM_OsDisk_1_bd921920bb0a4650becfc2d830000000
Name               : myVM_OsDisk_1_bd921920bb0a4650becfc2d830000000
Type               : Microsoft.Compute/disks
Location           : eastus2
Tags               : {}

后续步骤Next steps

本文已介绍如何在可用性区域中创建 VM。In this article, you learned a how to create a VM in an availability zone. 详细了解 Azure VM 的区域和可用性Learn more about regions and availability for Azure VMs.