Azure 中的 Windows 虛擬機器Windows virtual machines in Azure

Azure 虛擬機器 (VM) 是由 Azure 所提供的隨選且可調整的數種運算資源類型之一。Azure Virtual Machines (VM) is one of several types of on-demand, scalable computing resources that Azure offers. 一般而言,當您對於運算環境所需的控制權比其他選擇可提供的還要多時,則您會選擇 VM。Typically, you choose a VM when you need more control over the computing environment than the other choices offer. 本文提供您在建立 VM 之前應該的事項、建立方式及管理方式的相關資訊。This article gives you information about what you should consider before you create a VM, how you create it, and how you manage it.

Azure VM 讓您能夠有彈性地進行虛擬化,而不需購買並維護執行它的實體硬體。An Azure VM gives you the flexibility of virtualization without having to buy and maintain the physical hardware that runs it. 不過,您仍然需要執行工作來維護 VM,例如設定、修補和安裝在 VM 上執行的軟體。However, you still need to maintain the VM by performing tasks, such as configuring, patching, and installing the software that runs on it.

Azure 虛擬機器可用於許多用途。Azure virtual machines can be used in various ways. 部份範例如下:Some examples are:

  • 開發和測試 – Azure VM 提供了一個快速且簡單的方法,用以建立為應用程式撰寫程式碼並進行測試時所需之特定組態的電腦。Development and test – Azure VMs offer a quick and easy way to create a computer with specific configurations required to code and test an application.
  • 雲端中的應用程式 – 因為您應用程式的需求可能會變動,在 Azure VM 上執行它在經濟上是合理的。Applications in the cloud – Because demand for your application can fluctuate, it might make economic sense to run it on a VM in Azure. 當您需要 VM 時便支付額外的 VM,而當您不需要時便關閉這些 VM。You pay for extra VMs when you need them and shut them down when you don’t.
  • 擴充的資料中心 – 可輕鬆將 Azure 虛擬網路中的虛擬機器連線到您組織的網路。Extended datacenter – Virtual machines in an Azure virtual network can easily be connected to your organization’s network.

您的應用程式所使用的 VM 數目可以擴大及擴增為符合您需求的任何內容。The number of VMs that your application uses can scale up and out to whatever is required to meet your needs.

我在建立 VM 之前需要先考慮什麼?What do I need to think about before creating a VM?

當您在 Azure 中建置應用程式基礎結構時,總是會有許多設計考量There are always a multitude of design considerations when you build out an application infrastructure in Azure. 在您開始之前,仔細考量 VM 的這些層面很重要︰These aspects of a VM are important to think about before you start:

  • 應用程式資源的名稱The names of your application resources
  • 將儲存資源的位置The location where the resources are stored
  • VM 的大小The size of the VM
  • 可建立的 VM 數目上限The maximum number of VMs that can be created
  • VM 上執行的作業系統The operating system that the VM runs
  • VM 啟動後的設定The configuration of the VM after it starts
  • VM 需要的相關資源The related resources that the VM needs

位置Locations

Azure 中所建立的所有資源分散在世界各地的多個地理區域All resources created in Azure are distributed across multiple geographical regions around the world. 通常,當您建立 VM 時,區域稱為位置Usually, the region is called location when you create a VM. 針對 VM,位置會指定虛擬硬碟所儲存的位置。For a VM, the location specifies where the virtual hard disks are stored.

下表顯示一些您可以取得可用位置清單的方式。This table shows some of the ways you can get a list of available locations.

方法Method 描述Description
Azure 入口網站Azure portal 當您建立 VM 時,請從清單中選取位置。Select a location from the list when you create a VM.
Azure PowerShellAzure PowerShell 使用 Get-AzLocation 命令。Use the Get-AzLocation command.
REST APIREST API 使用列出位置作業。Use the List locations operation.
Azure CLIAzure CLI 使用 az account list-locations 作業。Use the az account list-locations operation.

可用性Availability

Azure 已宣布推出業界領先的單一執行個體虛擬機器 99.9% 服務等級協定 (前提是您部署的所有磁碟都是進階儲存體的 VM)。Azure announced an industry leading single instance virtual machine Service Level Agreement of 99.9% provided you deploy the VM with premium storage for all disks. 為了讓您的部署符合標準的 99.95% VM 服務等級協定資格,您還必須在可用性設定組內部署兩個或更多執行工作負載的 VM。In order for your deployment to qualify for the standard 99.95% VM Service Level Agreement, you still need to deploy two or more VMs running your workload inside of an availability set. 可用性設定組可確保您的 VM 會分散在 Azure 資料中心內的多個容錯網域,以及部署至具有不同維護期間的主機。An availability set ensures that your VMs are distributed across multiple fault domains in the Azure data centers as well as deployed onto hosts with different maintenance windows. 完整 Azure SLA 說明保證的 Azure 整體可用性。The full Azure SLA explains the guaranteed availability of Azure as a whole.

VM 大小VM size

您使用的 VM 大小是由所您要執行的工作負載所決定。The size of the VM that you use is determined by the workload that you want to run. 您所選的大小會決定例如處理電源、記憶體和儲存體容量等因素。The size that you choose then determines factors such as processing power, memory, and storage capacity. Azure 提供了各種不同的大小,以支援許多類型的用法。Azure offers a wide variety of sizes to support many types of uses.

Azure 可依據 VM 的大小和作業系統,以每小時價格方式收費。Azure charges an hourly price based on the VM’s size and operating system. 針對不足一小時的部分,Azure 只會收取已使用分鐘數的費用。For partial hours, Azure charges only for the minutes used. 儲存體是個別定價與收費。Storage is priced and charged separately.

VM 限制VM Limits

您的訂用帳戶都有預設配額限制,而此限制會在您要部署多個 VM 以供專案使用時造成影響。Your subscription has default quota limits in place that could impact the deployment of many VMs for your project. 每一訂用帳戶目前的限制是每一區域 20 個 VM。The current limit on a per subscription basis is 20 VMs per region. 只要提出支援票證來要求增加,即可提高配額限制Limits can be raised by filing a support ticket requesting an increase

作業系統磁碟和映像Operating system disks and images

虛擬機器是使用虛擬硬碟 (VHD) 來儲存其作業系統 (OS) 和資料。Virtual machines use virtual hard disks (VHDs) to store their operating system (OS) and data. VHD 也能夠使用於您可以選擇用來安裝 OS 的映像。VHDs are also used for the images you can choose from to install an OS.

Azure 提供許多 Marketplace 映像來與不同版本和類型的 Windows Server 作業系統搭配使用。Azure provides many marketplace images to use with various versions and types of Windows Server operating systems. Marketplace 映像是依映像發行者、供應項目、SKU 和版本 (版本通常會指定為最新版本) 來識別。Marketplace images are identified by image publisher, offer, sku, and version (typically version is specified as latest). 僅支援 64 位元作業系統。Only 64-bit operating systems are supported. 如需所支援客體作業系統、角色和功能的詳細資訊,請參閱 Microsoft Azure 虛擬機器的 Microsoft 伺服器軟體支援For more information on the supported guest operating systems, roles, and features, see Microsoft server software support for Microsoft Azure virtual machines.

下表顯示您可找到映像資訊的一些方法。This table shows some ways that you can find the information for an image.

方法Method 描述Description
Azure 入口網站Azure portal 當您選取要使用的影像時,會自動為您指定值。The values are automatically specified for you when you select an image to use.
Azure PowerShellAzure PowerShell Get-AzVMImagePublisher -Location locationGet-AzVMImagePublisher -Location location
Get-AzVMImageOffer -Location location -Publisher publisherNameGet-AzVMImageOffer -Location location -Publisher publisherName
Get-AzVMImageSku -Location location -Publisher publisherName -Offer offerNameGet-AzVMImageSku -Location location -Publisher publisherName -Offer offerName
REST APIREST APIs 列出映像發行者List image publishers
列出映像供應項目List image offers
列出映像 SKUList image skus
Azure CLIAzure CLI az vm image list-publishers --location locationaz vm image list-publishers --location location
az vm image list-offers --location location --publisher publisherNameaz vm image list-offers --location location --publisher publisherName
az vm image list-skus --location location --publisher publisherName --offer offerNameaz vm image list-skus --location location --publisher publisherName --offer offerName

您可以選擇上傳並使用您自己的映像,當您這麼做時,不會使用發行者名稱、供應項目和 SKU。You can choose to upload and use your own image and when you do, the publisher name, offer, and sku aren’t used.

延伸模組Extensions

VM 擴充會透過 post 部署設定及自動化工作為您的 VM 提供其他功能。VM extensions give your VM additional capabilities through post deployment configuration and automated tasks.

可以使用擴充功能來完成這些常見工作︰These common tasks can be accomplished using extensions:

此資料表中的資源可供 VM 使用,且建立 VM 時必須存在或建立。The resources in this table are used by the VM and need to exist or be created when the VM is created.

資源Resource 必要Required 描述Description
資源群組Resource group Yes VM 必須包含在資源群組中。The VM must be contained in a resource group.
儲存體帳戶Storage account Yes VM 需要儲存體帳戶儲存其虛擬硬碟。The VM needs the storage account to store its virtual hard disks.
虛擬網路Virtual network Yes VM 必須是虛擬網路的成員。The VM must be a member of a virtual network.
公用 IP 位址Public IP address No 可以有公用 IP 位址指派給 VM,以從遠端存取它。The VM can have a public IP address assigned to it to remotely access it.
網路介面Network interface Yes VM 需要網路介面以在網路中進行通訊。The VM needs the network interface to communicate in the network.
資料磁碟Data disks No VM 可以包含資料磁碟來擴充儲存體功能。The VM can include data disks to expand storage capabilities.

後續步驟Next steps

建立您的第一個 VM!Create your first VM!