管理 Azure Stack Hub 的儲存體容量Manage storage capacity for Azure Stack Hub

本文協助 Azure Stack Hub 雲端操作員監視和管理其 Azure Stack Hub 部署的儲存體容量。This article helps Azure Stack Hub cloud operators monitor and manage the storage capacity of their Azure Stack Hub deployment. Azure Stack Hub 儲存體基礎結構會配置 Azure Stack Hub 部署的總儲存體容量子集,以便用於「儲存體服務」。The Azure Stack Hub storage infrastructure allocates a subset of the total storage capacity of the Azure Stack Hub deployment as storage services. 儲存體服務會將租用戶的資料儲存在磁碟區上對應到部署節點的共用中。Storage services store a tenant's data in shares on volumes that correspond to the nodes of the deployment.

身為雲端操作員,您可以使用的儲存體數量有限。As a cloud operator, you have a limited amount of storage to work with. 您實作的解決方案會定義儲存體數量。The amount of storage is defined by the solution you implement. 當您使用多節點的解決方案時,解決方案是由 OEM 廠商所提供,或由您安裝 Azure Stack 開發套件 (ASDK) 的硬體所提供。The solution is provided by your OEM vendor when you use a multinode solution, or it's provided by the hardware on which you install the Azure Stack Development Kit (ASDK).

Azure Stack Hub 只支援藉由新增額外的縮放單位節點來擴充儲存體容量。Azure Stack Hub only supports the expansion of storage capacity by adding additional scale unit nodes. 如需詳細資訊,請參閱 在 Azure Stack Hub 中新增額外的縮放單位節點For more information, see add additional scale unit nodes in Azure Stack Hub. 將實體磁片新增至節點將無法擴展儲存體容量。Adding physical disks to the nodes won't expand the storage capacity.

請務必 監視 可用的儲存體,以確保維護有效率的作業。It's important to monitor the available storage to ensure that efficient operations are maintained. 當磁碟區的剩餘可用容量有限時,請規劃管理可用空間,以免共用用完容量。When the remaining free capacity of a volume becomes limited, plan to manage the available space to prevent the shares from running out of capacity.

管理容量的選項包括:Your options for managing capacity include:

  • 回收容量。Reclaiming capacity.
  • 移轉儲存體物件。Migrating storage objects.

當物件存放磁碟區已使用 100% 時,儲存體服務就不再對該磁碟區有作用。When an object store volume is 100% utilized, the storage service no longer functions for that volume. 若要取得還原磁碟區作業的協助,請連絡 Microsoft 支援服務。To get assistance in restoring operations for the volume, contact Microsoft support.

了解磁碟區和共用、容器和磁碟Understand volumes and shares, containers, and disks

磁碟區和共用Volumes and shares

「儲存體服務」會將可用的儲存體分割成相等的個別磁碟區,而這些磁碟區會配置用來保存租用戶資料。The storage service partitions the available storage into separate, equal volumes that are allocated to hold tenant data. 如需 Azure Stack Hub 中磁碟區的詳細資訊,請參閱管理 Azure Stack Hub 的儲存體基礎結構For more information about volumes in Azure Stack Hub, see Manage storage infrastructure for Azure Stack Hub.

物件存放磁碟區會保存租用戶資料。Object store volumes hold tenant data. 租用戶資料包括分頁 blob、區塊 blob、附加 blob、資料表、佇列、資料庫和相關中繼資料存放區。Tenant data includes page blobs, block blobs, append blobs, tables, queues, databases, and related metadata stores. 物件存放磁碟區的數目等於 Azure Stack Hub 部署中的節點數目:The number of object store volumes is equal to the number of nodes in the Azure Stack Hub deployment:

  • 在包含四個節點的部署中,有四個物件存放磁碟區。On a four-node deployment, there are four object store volumes. 在多重節點的部署上,如果節點已移除或運作失常,磁碟區數目並不會縮減。On a multinode deployment, the number of volumes isn't reduced if a node is removed or malfunctioning.
  • 如果您使用 ASDK,則會有含單一共用的單一磁碟區。If you use the ASDK, there's a single volume with a single share.

物件存放磁碟區由儲存體服務獨家使用。The object store volumes are for the exclusive use of storage services. 您不能直接修改、新增或移除磁碟區上的任何檔案。You must not directly modify, add, or remove any files on the volumes. 只有儲存體服務應處理這些磁碟區中儲存的檔案。Only storage services should work on the files stored in these volumes.

因為儲存體物件 (Blob 等) 都各自包含在單一磁碟區中,所以每個物件的大小上限不能超過磁碟區的大小。Because the storage objects (blobs, and so on) are individually contained within a single volume, the maximum size of each object can't exceed the size of a volume. 新物件的大小上限取決於建立新物件時,在磁碟區中仍未使用的空間容量。The maximum size of new objects depends on the capacity that remains in a volume as unused space when that new object is created.

當物件存放磁碟區的可用空間不足,且回收空間的動作不成功或無法使用時,Azure Stack Hub 雲端操作員可以將儲存物件從一個磁碟區移轉到另一個。When an object store volume is low on free space and actions to reclaim space aren't successful or available, Azure Stack Hub cloud operators can migrate storage objects from one volume to another.

如需租用戶使用者如何使用 Azure Stack Hub 中 blob 儲存體的詳細資訊,請參閱 Azure Stack Hub 儲存體服務For information about how tenant users work with blob storage in Azure Stack Hub, see Azure Stack Hub Storage services.

容器Containers

租用戶使用者可建立容器,接著用來存放 blob 資料。Tenant users create containers that are then used to store blob data. 雖然使用者會決定要放置 Blob 的容器,但儲存體服務會使用演算法來判斷哪個磁碟區要放置容器。Although users decide in which container to place blobs, the storage service uses an algorithm to determine on which volume to put the container. 此演算法通常會選擇具有最多可用空間的磁碟區。The algorithm typically chooses the volume with the most available space.

將 blob 置於容器之後,該 Blob 可以成長以使用更多空間。After a blob is placed in a container, the blob can grow to use more space. 隨著您新增 Blob 且現有的 Blob 成長,磁碟區中保存該容器的可用空間會縮減。As you add new blobs and existing blobs grow, the available space in the volume that holds the container shrinks.

容器不限於單一磁碟區。Containers aren't limited to a single volume. 當容器中合併的 blob 資料成長而使用 80% 或更多的可用空間時,容器會進入「溢位」模式。When the combined blob data in a container grows to use 80% or more of the available space, the container enters overflow mode. 處於溢位模式時,在該容器中建立的任何新 blob 會配置給具有足夠空間的不同磁碟區。When in overflow mode, any new blobs that are created in that container are allocated to a different volume that has sufficient space. 經過一段時間,溢位模式中的容器可以將 blob 分散於多個磁碟區。Over time, a container in overflow mode can have blobs that are distributed across multiple volumes.

使用磁碟區中 80% (而後使用 90%) 的可用空間時,系統就會在 Azure Stack Hub 管理員入口網站中引發警示When 80% (and then 90%) of the available space in a volume is used, the system raises alerts in the Azure Stack Hub administrator portal. 雲端操作員應該檢閱可用的儲存體容量,並規劃重新平衡內容。Cloud operators should review available storage capacity and plan to rebalance the content. 使用 100% 的磁碟時,儲存體服務會停止運作,而且沒有引發任何其他警示。The storage service stops working when a disk is 100% used and no additional alerts are raised.

磁碟Disks

Azure Stack Hub 支援在 VM 中使用受控磁碟和非受控磁碟作為作業系統 (OS) 和資料磁碟。Azure Stack Hub supports the use of managed disks and unmanaged disks in VMs, as both an operating system (OS) and a data disk.

受控磁碟 會管理與 VM 磁碟相關的儲存體帳戶,從而簡化 Azure IaaS VM 的磁碟管理。Managed disks simplify disk management for Azure IaaS VMs by managing the storage accounts associated with the VM disks. 您只需要指定您需要的磁碟大小,Azure Stack Hub 就會替您建立和管理磁碟。You only have to specify the size of disk you need, and Azure Stack Hub creates and manages the disk for you. 如需詳細資訊,請參閱受控磁碟概觀For more information, see Managed Disks Overview.

建議您為 VM 使用受控磁碟,以便簡化管理和實現容量平衡。It is recommended that you use Managed Disks for VM for easier management and capacity balance. 您不需要先準備儲存體帳戶和容器就可以使用受控磁碟。You don't have to prepare a storage account and containers before using Managed Disks. 在建立多個受控磁碟時,這些磁碟會分散到多個磁碟區,以便能平衡磁碟區的容量。When creating multiple managed disks, the disks are distributed into multiple volumes, which helps to balance the capacity of volumes.

非受控磁碟 是 VHD 檔案,會以分頁 Blob 的形式儲存在 Azure 儲存體帳戶中。Unmanaged disks are VHD files that are stored as page blobs in Azure storage accounts. 租用戶建立的分頁 Blob 就是 VM 磁碟,並且會儲存在儲存體帳戶的容器中。The page blobs created by tenants are referred to as VM disks and are stored in containers in the storage accounts. 建議您僅針對需要與僅支援 Azure-Unmanaged 磁片的協力廠商工具相容的 Vm 使用非受控磁片。We recommend you use Unmanaged Disks only for VMs that need to be compatible with third party tools which only support Azure-Unmanaged Disks.

指引租用戶將每個磁碟放入不同的容器,以改善 VM 效能。The guidance to tenants is to place each disk into a separate container to improve performance of the VM.

  • 每個保存 VM 中磁碟或分頁 Blob 的容器,都會被視為擁有此磁碟 VM 所連結的容器。Each container that holds a disk, or page blob, from a VM is considered an attached container to the VM that owns the disk.
  • 未保存 VM 中任何磁碟的容器則會被視為可用的容器。A container that doesn't hold any disks from a VM is considered a free container.

用於在連結的容器上釋放空間的選項有限。The options to free up space on an attached container are limited. 若要深入瞭解,請參閱散發非受控磁碟To learn more, see Distribute unmanaged disks.

提示

當非受控磁碟已連結至租用戶可能新增到容器的 VM,雲端操作員不會直接操作這些磁碟。Cloud operators don't directly operate unmanaged disks, which are attached to VMs that tenants might add to a container. 不過,在您規劃管理儲存體共用上的空間時,了解非受控磁碟與容器和共用有何關聯很有用。However, when you plan to manage space on storage shares, it can be useful to understand how unmanaged disks relate to containers and shares.

監視共用Monitor shares

使用 Azure PowerShell 或系統管理員入口網站來監視共用,以便了解可用空間何時受限。Use Azure PowerShell or the administrator portal to monitor shares so that you can understand when free space is limited. 當您使用入口網站時,您會收到有關共用空間不足的警示。When you use the portal, you receive alerts about shares that are low on space.

使用 PowerShellUse PowerShell

身為雲端操作員,您可以使用 PowerShell Get-AzsStorageShare Cmdlet 來監視共用的儲存體容量。As a cloud operator, you can monitor the storage capacity of a share by using the PowerShell Get-AzsStorageShare cmdlet. 此 Cmdlet 會傳回每個共用上總計、已配置和可用的空間 (以位元組為單位)。The cmdlet returns the total, allocated, and free space, in bytes, on each of the shares.

範例:傳回共用的可用空間

  • 容量總計:共用上可用的空間總計 (以位元組為單位)。Total capacity: The total space, in bytes, that's available on the share. 此空間用於儲存體服務所維護的資料和中繼資料。This space is used for data and metadata that's maintained by the storage services.
  • 已使用容量:存放租用戶資料和相關中繼資料的檔案所使用的資料數量 (以位元組為單位)。Used capacity: The amount of data, in bytes, that's used by all the extents from the files that store the tenant data and associated metadata.

使用管理員入口網站Use the administrator portal

身為雲端操作員,您可以使用管理員入口網站來檢視所有共用的儲存體容量。As a cloud operator, you can use the administrator portal to view the storage capacity of all shares.

  1. 登入管理員入口網站 https://adminportal.local.azurestack.externalSign in to the administrator portal https://adminportal.local.azurestack.external.

  2. 選取 [所有服務] > [儲存體] > [檔案共用] 以開啟檔案共用清單,您可以在其中檢視使用量資訊。Select All services > Storage > File shares to open the file share list, where you can view the usage information.

    範例:Azure Stack Hub 管理員入口網站中的儲存體檔案共用

    • Total:共用上可用的空間總計 (以位元組為單位)。Total: The total space, in bytes, that's available on the share. 此空間用於儲存體服務所維護的資料和中繼資料。This space is used for data and metadata that's maintained by the storage services.
    • 已使用:存放租用戶資料和相關中繼資料的檔案所使用的資料數量 (以位元組為單位)。Used: The amount of data, in bytes, that's used by all the extents from the files that store the tenant data and associated metadata.

監視磁碟區Monitor volumes

使用 PowerShell 或管理員入口網站來監視磁碟區,以便了解可用空間何時受限。Use PowerShell or the administrator portal to monitor volumes so you can understand when free space is limited. 當您使用入口網站時,您會收到有關磁碟區空間不足的警示。When you use the portal, you receive alerts about volumes that are low on space.

使用 PowerShellUse PowerShell

身為雲端操作員,您可以使用 PowerShell Get-AzsVolume Cmdlet 來監視磁碟區的儲存體容量。As a cloud operator, you can monitor the storage capacity of a volume using the PowerShell Get-AzsVolume cmdlet. 此 Cmdlet 會傳回每個磁碟區上的總計和可用空間 (GB)。The cmdlet returns the total and free space in gigabyte (GB) on each of the volumes.

範例:傳回磁碟區的可用空間

  • 容量總計:共用上可用的空間總計,以 GB 為單位。Total capacity: The total space in GB that's available on the share. 此空間用於儲存體服務所維護的資料和中繼資料。This space is used for data and metadata that's maintained by the storage services.
  • 剩餘容量:儲存租用戶資料和相關聯中繼資料的可用空間量,以 GB 為單位。Remaining capacity: The amount of space in GB that's free to store the tenant data and associated metadata.

使用管理員入口網站Use the administrator portal

身為雲端操作員,您可以使用管理員入口網站來檢視所有磁碟區的儲存體容量。As a cloud operator, you can use the administrator portal to view the storage capacity of all volumes.

  1. 登入Azure Stack Hub 系統管理員入口網站 (https://adminportal.local.azurestack.external)。Sign in to the Azure Stack Hub administrator portal (https://adminportal.local.azurestack.external).

  2. 選取 [所有服務] > [儲存體] > [磁碟區] 以開啟磁碟區清單,您可在此檢視使用資訊。Select All services > Storage > Volumes to open the volume list where you can view the usage information.

    範例:Azure Stack Hub 系統管理員入口網站中的儲存體磁碟區

    • Total:磁碟區上的可用空間總計。Total: The total space available on the volume. 此空間用於儲存體服務所維護的資料和中繼資料。This space is used for data and metadata that's maintained by the storage services.
    • 已使用:存放租用戶資料和相關中繼資料的檔案所使用的資料數量。Used: The amount of data that's used by the all the extents from the files that store the tenant data and associated metadata.

儲存體空間警示Storage space alerts

當您使用管理員入口網站時,您會收到有關磁碟區空間不足的警示。When you use the administrator portal, you receive alerts about volumes that are low on space.

重要

身為雲端操作員,您應該防止共用達到完全使用狀態。As a cloud operator, you should prevent shares from reaching full usage. 當共用的使用率為 100% 時,儲存體服務便無法再對該共用運作。When a share is 100% utilized, the storage service no longer functions for that share. 若要在已 100% 使用的共用上復原可用空間及還原作業,您必須連絡 Microsoft 支援服務。To recover free space and restore operations on a share that's 100% utilized, you must contact Microsoft support.

  • 警告:當檔案共用使用超過 80% 時,您會在管理員入口網站中收到「警告」警示:Warning: When a file share is over 80% utilized, you receive a Warning alert in the administrator portal:

    範例:Azure Stack Hub 系統管理員入口網站中的警告警示

  • 重大:當檔案共用使用超過 90% 時,您會在管理員入口網站中收到「重大」警示:Critical: When a file share is over 90% utilized, you receive a Critical alert in the administrator portal:

    範例:Azure Stack Hub 系統管理員入口網站中的重大警示

  • 檢視詳細資料:在系統管理員入口網站中,您可以開啟警示的詳細資料,以檢視風險降低選項:View details: In the administrator portal, you can open an alert's details to view your mitigation options:

    範例:在 Azure Stack Hub 系統管理員入口網站中檢視警示詳細資料

管理可用的空間Manage available space

必須釋放磁碟區上的可用空間時,請先使用最不具侵略性的方法。When it's necessary to free space on a volume, use the least invasive methods first. 例如,嘗試在選擇移轉受控磁碟區之前回收空間。For example, try to reclaim space before you choose to migrate a managed disk.

回收容量Reclaim capacity

您可以回收已刪除的租用戶帳戶所使用的容量。You can reclaim the capacity that's used by tenant accounts that have been deleted. 當資料到達保留期時,系統會自動回收此容量,或者您可以採取動作立即將它回收。This capacity is automatically reclaimed when the data retention period is reached, or you can act to reclaim it immediately.

如需詳細資訊,請參閱管理 Azure Stack Hub 儲存體帳戶的「回收容量」一節。For more information, see the "Reclaim capacity" section of Manage Azure Stack Hub storage accounts.

在磁碟區之間移轉容器Migrate a container between volumes

此選項僅適用於 Azure Stack Hub 整合式系統。This option applies only to Azure Stack Hub integrated systems.

有些租用戶共用會因為租用戶使用模式,而使用比其他共用更多的空間。Because of tenant usage patterns, some tenant shares use more space than others. 這可能會導致在相對未使用的其他共用之前,有些共用的空間不足。This can result in some shares running low on space before other shares that are relatively unused.

您可將某些 Blob 容器手動遷移到不同的共用,以在過度使用的共用上釋放空間。You can free up space on an overused share by manually migrating some blob containers to a different share. 您可以將數個較小容器移轉至有容量可保存所有容量的單一共用。You can migrate several smaller containers to a single share that has capacity to hold them all. 使用移轉作業來移動「可用」容器。Use migration to move free containers. 可用容器是不包含 VM 磁碟的容器。Free containers are containers that don't contain a disk for a VM.

移轉會合併新共用上的所有容器 Blob。Migration consolidates all of a container's blobs on the new share.

  • 如果容器已進入溢位模式且 blob 已置於其他磁碟區上,新的共用必須有足夠的容量可保存您移轉之容器的所有 blob。If a container has entered overflow mode and has placed blobs on additional volumes, the new share must have sufficient capacity to hold all of the blobs for the container you migrate. 這包括位於其他共用上的 blob。This includes the blobs that are located on additional shares.

  • Get-AzsStorageContainer 只會識別容器的初始磁碟區上使用中的空間。The PowerShell cmdlet Get-AzsStorageContainer identifies only the space in use on the initial volume for a container. 此 Cmdlet 不會識別已置於其他磁碟區上的 Blob 所使用的空間。The cmdlet doesn't identify space that's used by blobs that are put on additional volumes. 因此,容器的完整大小可能不明顯。Therefore, the full size of a container might not be evident. 新共用上的容器彙總可能會使該新共用進入溢位狀況,以將資料置於其他共用。It's possible that consolidation of a container on a new share can send that new share into an overflow condition, where it places data onto additional shares. 因此,您可能需要重新平衡共用。As a result, you might need to rebalance the shares.

  • 如果您缺少某些資源群組的權限,且無法使用 PowerShell 來查詢溢位資料的其他磁碟區,請與這些資源群組和容器的擁有者合作,以在遷移該資料之前,了解要遷移的資料總數量。If you lack permissions to certain resource groups and can't use PowerShell to query the additional volumes for overflow data, work with the owner of those resource groups and containers to understand the total amount of data to migrate before you migrate it.

重要

容器的 Blob 移轉是需要使用 PowerShell 的離線作業。The migration of blobs for a container is an offline operation that requires the use of PowerShell. 在移轉完成前,您所遷移容器的所有 Blob 會保持離線狀態且無法使用。Until the migration is complete, all blobs for the container that you're migrating remain offline and can't be used. 您也應該避免在所有進行中的移轉完成之前升級 Azure Stack Hub。You should also avoid upgrading Azure Stack Hub until all ongoing migration is complete.

使用 PowerShell 來遷移容器Migrate containers by using PowerShell

  1. 確認您已安裝並設定 Azure PowerShellConfirm that you have Azure PowerShell installed and configured. 如需詳細資訊,請參閱使用 Azure PowerShell 來管理 Azure 資源For more information, see Manage Azure resources by using Azure PowerShell.

  2. 檢查容器以了解您打算移轉的共用上有哪些資料。Examine the container to understand what data is on the share that you plan to migrate. 若要識別可在磁碟區中移轉的最佳候選容器,請使用 Get-AzsStorageContainer Cmdlet:To identify the best candidate containers for migration in a volume, use the Get-AzsStorageContainer cmdlet:

    $farm_name = (Get-AzsStorageFarm)[0].name
    $shares = Get-AzsStorageShare -FarmName $farm_name
    $containers = Get-AzsStorageContainer -ShareName $shares[0].ShareName -FarmName $farm_name
    

    接著,檢查 $containers:Then examine $containers:

    $containers
    

    範例:$containers

  3. 找出最佳目的地共用以保存您所遷移的容器:Identify the best destination shares to hold the container you're migrating:

    $destinationshare = ($shares | Sort-Object FreeCapacity -Descending)[0]
    

    接著,檢查 $destinationshares:Then examine $destinationshares:

    $destinationshares
    

    範例:$destination shares

  4. 開始移轉容器。Start the migration for a container. 移轉不是同步進行。Migration is asynchronous. 如果您在第一次移轉完成之前開始移轉其他容器,請使用作業識別碼來追蹤每個容器的狀態。If you start the migration of additional containers before the first migration is complete, use the job ID to track the status of each.

    $job_id = Start-AzsStorageContainerMigration -StorageAccountName $containers[0].Accountname -ContainerName $containers[0].Containername -ShareName $containers[0].Sharename -DestinationShareUncPath $destinationshares[0].UncPath -FarmName $farm_name
    

    接著,檢查 $jobId。Then examine $jobId. 在下列範例中,以您想要檢查的作業識別碼取代 d62f8f7a-8b46-4f59-a8aa-5db96db4ebb0:In the following example, replace d62f8f7a-8b46-4f59-a8aa-5db96db4ebb0 with the job ID you want to examine:

    $jobId
    d62f8f7a-8b46-4f59-a8aa-5db96db4ebb0
    
  5. 使用作業識別碼來檢查移轉作業的狀態。Use the job ID to check on the status of the migration job. 當容器移轉完成時,MigrationStatus 會設定為 CompleteWhen the container migration is complete, MigrationStatus is set to Complete.

    Get-AzsStorageContainerMigrationStatus -JobId $job_id -FarmName $farm_name
    

    顯示遷移狀態的螢幕擷取畫面。

  6. 您可以取消進行中的移轉工作。You can cancel an in-progress migration job. 已取消的移轉作業會以非同步方式處理。Canceled migration jobs are processed asynchronously. 您可以使用 $jobid 追蹤取消作業:You can track cancellations by using $jobid:

    Stop-AzsStorageContainerMigration -JobId $job_id -FarmName $farm_name
    

    範例:復原狀態

  7. 您可以再次執行步驟 6 中的命令,直到移轉狀態為「已取消」 為止:You can run the command from step 6 again, until the migration status is Canceled:

    顯示已取消的遷移狀態範例的螢幕擷取畫面。

移動 VM 磁碟Move VM disks

此選項僅適用於 Azure Stack Hub 整合式系統。This option applies only to Azure Stack Hub integrated systems.

最極端的管理空間方法會牽涉到移動 VM 磁碟。The most extreme method for managing space involves moving VM disks. 因為移動所連結的容器 (包含 VM 磁碟的容器) 很複雜,請連絡 Microsoft 支援服務以完成此動作。Because moving an attached container (one that contains a VM disk) is complex, contact Microsoft support to accomplish this action.

在磁碟區之間移轉受控磁碟Migrate a managed disk between volumes

此選項僅適用於 Azure Stack Hub 整合式系統。This option applies only to Azure Stack Hub integrated systems.

有些租用戶磁碟區會因為租用戶使用模式,而使用比其他共用更多的空間。Because of tenant usage patterns, some tenant volumes use more space than others. 結果可能是在相對未使用的其他磁碟區之前,空間不足的磁碟區。The result can be a volume that runs low on space before other volume that are relatively unused.

您可以手動將一些受控磁碟移轉到其他磁碟區,以釋出過度使用磁碟區上的空間。You can free up space on an overused volume by manually migrating some managed disks to a different volume. 您可以將數個受控磁碟移轉至有足夠容量可容納其全部的單一磁碟區。You can migrate several managed disks to a single volume that has capacity to hold them all. 使用移轉來移動「離線」的受控磁碟。Use migration to move offline managed disks. 離線受控磁碟是指未連結至 VM 的磁碟。Offline managed disks are disks that aren't attached to a VM.

重要

受控磁碟的 blob 移轉是需要使用 PowerShell 的離線作業。Migration of managed disks is an offline operation that requires the use of PowerShell. 開始移轉作業之前,您必須先將候選磁碟從其擁有者 VM 中斷連結 (完成移轉作業後可以重新連結)。You must detach the candidate disks for migration from their owner VM before starting migration job (once the migration job is done, you can reattach them). 在移轉完成之前,所有您要移轉的受控磁碟都必須保持離線且無法使用的狀態,否則,移轉作業會中止,且所有未移轉的磁碟仍在其原始磁碟區上。Until migration completes, all managed disks you are migrating must remain offline and can't be used, otherwise the migration job would abort and all unmigrated disks are still on their original volumes. 您也應該避免在所有進行中的移轉完成之前升級 Azure Stack Hub。You should also avoid upgrading Azure Stack Hub until all ongoing migration completes.

使用 PowerShell 移轉受控磁碟To migrate managed disks using PowerShell

  1. 確認您已安裝並設定 Azure PowerShell。Confirm that you have Azure PowerShell installed and configured. 如需設定 PowerShell 環境的指示,請參閱安裝 Azure Stack Hub 的 PowerShellFor instructions on configuring the PowerShell environment, see Install PowerShell for Azure Stack Hub. 若要登入 Azure Stack Hub,請參閱設定操作員環境並登入 Azure Stack HubTo sign in to Azure Stack Hub, see Configure the operator environment and sign in to Azure Stack Hub.

  2. 檢查受控磁碟,瞭解您打算移轉的磁碟區上有哪些磁碟。Examine the managed disks to understand what disks are on the volume that you plan to migrate. 若要找出磁碟區中可移轉的最佳候選磁碟,請使用 Get-AzsDisk Cmdlet:To identify the best candidate disks for migration in a volume, use the Get-AzsDisk cmdlet:

    $ScaleUnit = (Get-AzsScaleUnit)[0]
    $StorageSubSystem = (Get-AzsStorageSubSystem -ScaleUnit $ScaleUnit.Name)[0]
    $Volumes = (Get-AzsVolume -ScaleUnit $ScaleUnit.Name -StorageSubSystem $StorageSubSystem.Name | Where-Object {$_.VolumeLabel -Like "ObjStore_*"})
    $SourceVolume  = ($Volumes | Sort-Object RemainingCapacityGB)[0]
    $VolumeName = $SourceVolume.Name.Split("/")[2]
    $VolumeName = $VolumeName.Substring($VolumeName.IndexOf(".")+1)
    $MigrationSource = "\\SU1FileServer."+$VolumeName+"\SU1_"+$SourceVolume.VolumeLabel
    $Disks = Get-AzsDisk -Status All -SharePath $MigrationSource | Select-Object -First 10
    

    接著,檢查 $disks:Then examine $disks:

    $Disks
    

    範例:$Disks

  3. 找出用來存放您所移轉磁碟的最佳目的地磁碟區:Identify the best destination volume to hold the disks you migrate:

    $DestinationVolume  = ($Volumes | Sort-Object RemainingCapacityGB -Descending)[0]
    $VolumeName = $DestinationVolume.Name.Split("/")[2]
    $VolumeName = $VolumeName.Substring($VolumeName.IndexOf(".")+1)
    $MigrationTarget = "\\SU1FileServer."+$VolumeName+"\SU1_"+$DestinationVolume.VolumeLabel
    
  4. 開始移轉受控磁碟。Start migration for managed disks. 移轉不是同步進行。Migration is asynchronous. 如果您在第一次移轉完成之前開始移轉其他磁碟,請使用作業名稱來追蹤每個磁碟的狀態。If you start migration of additional disks before the first migration completes, use the job name to track the status of each.

    $jobName = "MigratingDisk"
    Start-AzsDiskMigrationJob -Disks $Disks -TargetShare $MigrationTarget -Name $jobName
    
  5. 使用作業名稱來檢查移轉作業的狀態。Use the job name to check on the status of the migration job. 當磁碟移轉完成時,MigrationStatus 會設定為 完成When the disk migration is complete, MigrationStatus is set to Complete.

    $job = Get-AzsDiskMigrationJob -Name $jobName
    

    範例:移轉狀態

    如果您要在單一移轉作業中移轉多個受控磁碟,您也可以檢查作業的子工作。If you are migrating multiple managed disks in one migration job, you can also check the sub tasks of the job.

    $job.Subtasks
    

    範例:移轉的子工作狀態

  6. 您可以取消進行中的移轉工作。You can cancel an in-progress migration job. 已取消的移轉作業會以非同步方式處理。Canceled migration jobs are processed asynchronously. 您可以使用工作名稱來追蹤取消,直到狀態確認移轉作業 取消 為止:You can track cancellation by using job name until the status confirms the migration job is Canceled:

    Stop-AzsDiskMigrationJob -Name $jobName
    

    範例:已取消狀態

散發非受控磁碟Distribute unmanaged disks

此選項僅適用於 Azure Stack Hub 整合式系統。This option applies only to Azure Stack Hub integrated systems.

最極端的管理空間方法會牽涉到移動非受控磁碟。The most extreme method for managing space involves moving unmanaged disks. 如果租使用者將非受控磁片數目新增至一個容器,容器的總使用容量可能會成長超過容器進入溢位模式之前所保留磁片 的可用容量。If the tenant adds numbers of unmanaged disks to one container, the total used capacity of the container could grow beyond the available capacity of the volume that holds it before the container entering overflow mode. 若要避免單一容器耗盡磁碟區的空間,租用戶可以將一個容器的現有非受控磁碟散發到其他容器。To avoid single container exhaust the space of a volume, the tenant could distribute the existing unmanaged disks of one container to different containers. 因為散發所連結的容器 (包含 VM 磁碟的容器) 很複雜,請連絡 Microsoft 支援服務來完成此動作。Because distributing an attached container (one that contains a VM disk) is complex, contact Microsoft Support to accomplish this action.

後續步驟Next steps

若要深入了解如何為使用者提供 VM,請參閱管理 Azure Stack Hub 的儲存體容量To learn more about offering VMs to users, see Manage storage capacity for Azure Stack Hub.