管理 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 physcial 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. 若要获取卷还原操作的帮助,请联系 Azure 支持部门。To get assistance in restoring operations for the volume, contact Azure 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.

非托管磁盘是指以页 blob 形式存储在 Azure 存储帐户中的 VHD 文件。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 非托管磁盘的 VM。We recommend you use Unmanaged Disks only for VMs that need to compatible with 3rd party tools 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% 时恢复可用空间并还原操作,必须联系 Azure 支持部门。To recover free space and restore operations on a share that's 100% utilized, you must contact Azure 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.

  • PowerShell cmdlet 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. 如果在首次迁移完成之前开始迁移其他容器,请使用作业 ID 来跟踪每个容器的状态。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 替换为要检查的作业 ID: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. 使用作业 ID 检查迁移作业的状态。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 中的命令,直到迁移状态为 CanceledYou 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 磁盘的容器)的过程很复杂,请在 Azure 支持部门的帮助下完成此操作。Because moving an attached container (one that contains a VM disk) is complex, contact Azure 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.

重要

迁移托管磁盘是一项脱机操作,需要用到 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 会设置为 Complete 。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 add 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 磁盘的容器)的过程很复杂,请在 Azure 支持部门的帮助下完成此操作。Because distributing an attached container (one that contains a VM disk) is complex, contact Azure 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.