Azure 受控磁碟簡介Introduction to Azure managed disks

Azure 受控磁碟是虛擬硬碟 (VHD)。An Azure managed disk is a virtual hard disk (VHD). 您可以將它視為內部部署伺服器中虛擬化的實體磁碟。You can think of it like a physical disk in an on-premises server but, virtualized. Azure 受控磁碟會儲存為分頁 Blob,它是 Azure 中的隨機 IO 儲存物件。Azure managed disks are stored as page blobs, which are a random IO storage object in Azure. 我們稱受控磁碟為「受控」,因為它是對分頁 Blob、Blob 容器和 Azure 儲存體帳戶的抽象概念。We call a managed disk ‘managed’ because it is an abstraction over page blobs, blob containers, and Azure storage accounts. 使用受控磁碟,您所要做的就是佈建磁碟,Azure 會負責執行剩餘的部分。With managed disks, all you have to do is provision the disk, and Azure takes care of the rest.

當您選擇將 Azure 受控磁碟與工作負載一起使用時,Azure 會為您建立並管理磁碟。When you select to use Azure managed disks with your workloads, Azure creates and manages the disk for you. 這些可用的磁碟類型為超固態硬碟 (SSD) (預覽)、進階 SSD、標準 SSD 和標準硬碟磁碟機 (HDD)。The available types of disks are Ultra Solid State Drives (SSD) (Preview), Premium SSD, Standard SSD, and Standard Hard Disk Drives (HDD). 如需每種個別磁碟類型的相關詳細資訊,請參閱選取適用於 IaaS VM 的磁碟類型For more information about each individual disk type, see Select a disk type for IaaS VMs.

受控磁碟的好處Benefits of managed disks

讓我們來複習一下使用受控磁碟時的一些好處。Let's go over some of the benefits you gain by using managed disks.

高耐久性及可用性Highly durable and available

受控磁碟設計成確保可用性達 99.999%。Managed disks are designed for 99.999% availability. 受控磁碟達到此目標的方式,是提供三個您資料的複本,而達到高持久性。Managed disks achieve this by providing you with three replicas of your data, allowing for high durability. 如果一個或甚至兩個複本遇到問題,其餘複本有助於確保資料的持續性,以及遇到失敗時的高容錯力。If one or even two replicas experience issues, the remaining replicas help ensure persistence of your data and high tolerance against failures. 此結構讓 Azure 針對以基礎結構即服務 (IaaS) 磁碟穩定地展現企業級持久性,提供領先界業的年度零失敗率。This architecture has helped Azure consistently deliver enterprise-grade durability for infrastructure as a service (IaaS) disks, with an industry-leading ZERO% annualized failure rate.

簡單且可調整的 VM 部署Simple and scalable VM deployment

您可以使用受控磁碟在每個區域的一個訂用帳戶中建立最多 50,000 個同類型虛擬機器磁碟,這可讓您在單一訂用帳戶中建立數千部虛擬機器Using managed disks, you can create up to 50,000 VM disks of a type in a subscription per region, allowing you to create thousands of VMs in a single subscription. 這項功能也可讓您使用 Marketplace 映像,在一個虛擬機器擴展集內建立最多 1,000 部虛擬機器,進一步增加虛擬機器擴展集的延展性。This feature also further increases the scalability of virtual machine scale sets by allowing you to create up to 1,000 VMs in a virtual machine scale set using a Marketplace image.

整合可用性設定組Integration with availability sets

受控磁碟會與可用性設定組整合,以確定可用性設定組中的虛擬機器磁碟彼此充分隔離,以避免出現單一失敗點。Managed disks are integrated with availability sets to ensure that the disks of VMs in an availability set are sufficiently isolated from each other to avoid a single point of failure. 磁碟會自動放置在不同的儲存體縮放單位 (戳記)。Disks are automatically placed in different storage scale units (stamps). 如果因為硬體或軟體失敗造成戳記失敗,則只有磁碟在這些戳記上的 VM 執行個體才會失敗。If a stamp fails due to hardware or software failure, only the VM instances with disks on those stamps fail. 例如,假設您的應用程式在五個 VM 上執行,且這些 VM 位於可用性設定組中。For example, let's say you have an application running on five VMs, and the VMs are in an Availability Set. 這些磁碟的 VM 不會全部以相同的戳記儲存,因此,如果有一個戳記失效,應用程式的其他執行個體會繼續執行。The disks for those VMs won't all be stored in the same stamp, so if one stamp goes down, the other instances of the application continue to run.

整合可用性設定組Integration with Availability Zones

受控磁碟支援可用性區域,這是高可用性供應項目,可保護您的應用程式不受資料中心故障影響。Managed disks supports Availability Zones, which is a high-availability offering that protects your applications from datacenter failures. 「可用性區域」是 Azure 地區內獨特的實體位置。Availability Zones are unique physical locations within an Azure region. 每個區域皆由一或多個配備獨立電力、冷卻系統及網路的資料中心所組成。Each zone is made up of one or more datacenters equipped with independent power, cooling, and networking. 若要確保復原能力,在所有已啟用的地區中都至少要有三個個別的區域。To ensure resiliency, there’s a minimum of three separate zones in all enabled regions. 使用「可用性區域」時,Azure 可提供業界最佳的 99.99% VM 執行時間 SLA。With Availability Zones, Azure offers industry best 99.99% VM uptime SLA.

Azure 備份支援Azure Backup support

為了防止發生區域災難,可使用 Azure 備份透過時間型備份和備份保留原則,來建立備份作業。To protect against regional disasters, Azure Backup can be used to create a backup job with time-based backups and backup retention policies. 如此即可隨心所欲地執行簡易虛擬機器還原。This allows you to perform easy VM restorations at will. 目前 Azure 備份支援的磁碟大小上限為四個 TiB 磁碟。Currently Azure Backup supports disk sizes up to four tebibyte (TiB) disks. 如需詳細資訊,請參閱搭配使用受控磁碟 VM 與 Azure 備份For more information, see Using Azure Backup for VMs with managed disks.

細微的存取控制Granular access control

您可以使用 Azure 角色型存取控制 (RBAC) 將受控磁碟的特定權限指派給一個或多個使用者。You can use Azure role-based access control (RBAC) to assign specific permissions for a managed disk to one or more users. 受控磁碟公開各種不同的作業,包括讀取、寫入 (建立/更新)、刪除和擷取磁碟的共用存取簽章 (SAS) URIManaged disks expose a variety of operations, including read, write (create/update), delete, and retrieving a shared access signature (SAS) URI for the disk. 您可以授權某人只能存取他份內工作所需的作業。You can grant access to only the operations a person needs to perform their job. 例如,如果您不想讓某人將受控磁碟複製到儲存體帳戶,您可以選擇不要授權存取該受控磁碟的匯出動作。For example, if you don't want a person to copy a managed disk to a storage account, you can choose not to grant access to the export action for that managed disk. 同樣地,如果您不想讓某人使用 SAS URI 來複製受控磁碟,您可以選擇不要授與有關受控磁碟的這種權限。Similarly, if you don't want a person to use an SAS URI to copy a managed disk, you can choose not to grant that permission to the managed disk.

磁碟角色Disk roles

Azure 中有三個主要磁碟角色:資料磁碟、OS 磁碟和暫存磁碟。There are three main disk roles in Azure: the data disk, the OS disk, and the temporary disk. 這些角色對應至您的虛擬機器連結的磁碟。These roles map to disks that are attached to your virtual machine.


資料磁碟Data disk

資料磁碟是連接至虛擬機器的受控磁碟,用來儲存應用程式資料或其他您需要保留的資料。A data disk is a managed disk that's attached to a virtual machine to store application data, or other data you need to keep. 資料磁碟註冊為 SCSI 磁碟機,並以您選擇的字母標示。Data disks are registered as SCSI drives and are labeled with a letter that you choose. 每個資料磁碟都有 32,767 GiB 的容量上限。Each data disk has a maximum capacity of 32,767 gibibytes (GiB). 虛擬機器的大小會決定您可以連接之磁碟的數量,以及您可以用來裝載磁碟的儲存體類型。The size of the virtual machine determines how many data disks you can attach to it and the type of storage you can use to host the disks.

作業系統磁碟OS disk

每個虛擬機器都有一個連接的作業系統磁碟。Every virtual machine has one attached operating system disk. 作業系統磁碟有預先安裝作業系統,在建立虛擬機器時即已選取。That OS disk has a pre-installed OS, which was selected when the VM was created.

此磁碟的最大容量為 2,048 GiB。This disk has a maximum capacity of 2,048 GiB.

暫存磁碟Temporary disk

每個虛擬機器皆包含一個暫存磁碟,此非受控磁碟。Every VM contains a temporary disk, which is not a managed disk. 暫存磁碟為應用程式和處理程序提供短期的儲存空間,且僅供用來儲存分頁檔之類的資料。The temporary disk provides short-term storage for applications and processes and is intended to only store data such as page or swap files. 暫存磁碟上的資料可能會在維護事件期間或當您重新佈署虛擬機器時遺失。Data on the temporary disk may be lost during a maintenance event event or when you redeploy a VM. 在 Azure Linux VM 上,暫存磁碟預設為 /dev/sdb,而在 Windows VM 上,暫存磁碟預設為 E:。On Azure Linux VMs, the temporary disk is /dev/sdb by default and on Windows VMs the temporary disk is E: by default. 在 VM 的成功標準重新開機期間,暫存磁碟上的資料將保留。During a successful standard reboot of the VM, the data on the temporary disk will persist.

受控磁碟快照集Managed disk snapshots

受控磁碟快照集是受控磁碟的完整唯讀複本,預設會儲存為標準受控磁碟。A managed disk snapshot is a read-only full copy of a managed disk that is stored as a standard managed disk by default. 快照集可讓您在任何時間點備份受控磁碟。With snapshots, you can back up your managed disks at any point in time. 這些快照集可在來源磁碟外獨立存在,還能用來建立新的受控磁碟。These snapshots exist independent of the source disk and can be used to create new managed disks. 它們是根據使用的大小來計費。They are billed based on the used size. 例如,如果建立佈建容量為 64 GiB 的受控磁碟快照集,而實際使用資料大小為 10 GiB,則只會對已使用的 10 GiB 資料大小收取快照集費用。For example, if you create a snapshot of a managed disk with provisioned capacity of 64 GiB and actual used data size of 10 GiB, that snapshot is billed only for the used data size of 10 GiB.

若要深入了解如何建立受控磁碟的快照集,請參閱下列資源︰To learn more about how to create snapshots with managed disks, see the following resources:


受控磁碟也支援建立受管理的自訂映像。Managed disks also support creating a managed custom image. 您可以從儲存體帳戶中的自訂 VHD 或直接從一般化 (系統預備的) 虛擬機器建立映像。You can create an image from your custom VHD in a storage account or directly from a generalized (sysprepped) VM. 此程序會擷取單一映像。This process captures a single image. 此映像包含與虛擬機器相關聯的所有受控磁碟,包括作業系統和資料磁碟。This image contains all managed disks associated with a VM, including both the OS and data disks. 這個受控自訂映像可讓您使用自訂映像建立數百部虛擬機器,而不需要複製或管理任何儲存體帳戶。This managed custom image enables creating hundreds of VMs using your custom image without the need to copy or manage any storage accounts.

如需建立映像的詳細資訊,請參閱下列文章︰For information on creating images, see the following articles:

映像與快照集的比較Images versus snapshots

請務必了解映像和快照集之間的差異。It's important to understand the difference between images and snapshots. 受控磁碟可讓您為已解除配置的一般化虛擬機器建立映像。With managed disks, you can take an image of a generalized VM that has been deallocated. 此映像包含所有附加至虛擬機器的磁碟。This image includes all of the disks attached to the VM. 您可以使用此映像建立虛擬機器,它會包含所有磁碟。You can use this image to create a VM, and it includes all of the disks.

快照集是在建立快照當下的磁碟複本,A snapshot is a copy of a disk at the point in time the snapshot is taken. 只適用於一個磁碟。It applies only to one disk. 如果您的虛擬機器有一個磁碟 (作業系統磁碟),您可以建立它的快照集或映像,然後從快照集或映像建立虛擬機器。If you have a VM that has one disk (the OS disk), you can take a snapshot or an image of it and create a VM from either the snapshot or the image.

快照集只會感知到本身包含的磁碟,對其他任何磁碟一概不知。A snapshot doesn't have awareness of any disk except the one it contains. 若要在需要協調多個磁碟的情況下 (例如等量分割) 使用,這會出現問題。This makes it problematic to use in scenarios that require the coordination of multiple disks, such as striping. 快照集必須能夠彼此協調,但目前不支援。Snapshots would need to be able to coordinate with each other and this is currently not supported.

後續步驟Next steps

請參閱磁碟類型的相關文章,深入了解 Azure 提供的各種磁碟類型,找出何種類型最符合您的需求。Learn more about the individual disk types Azure offers and which type is a good fit for your needs in our article on disk types.