在 Azure Stack HCI 中扩展卷Extending volumes in Azure Stack HCI

适用于:Azure Stack HCI 版本 20H2;Windows Server 2019Applies to: Azure Stack HCI, version 20H2; Windows Server 2019

本主题说明如何使用 Windows Admin Center 在 Azure Stack HCI 群集上重设卷的大小。This topic provides instructions for resizing volumes on an Azure Stack HCI cluster by using Windows Admin Center.

警告

不支持:重设存储空间直通使用的基础存储的大小。Not supported: resizing the underlying storage used by Storage Spaces Direct. 如果在虚拟化存储环境(包括 Azure)中运行存储空间直通,则不支持重设虚拟机所用存储设备的大小或更改其特征,那样做会导致数据变得不可访问。If you are running Storage Spaces Direct in a virtualized storage environment, including in Azure, resizing or changing the characteristics of the storage devices used by the virtual machines isn't supported and will cause data to become inaccessible. 相反,应按照添加服务器或驱动器部分的说明来添加更多容量,然后再扩展卷。Instead, follow the instructions in the Add servers or drives section to add additional capacity before extending volumes.

使用 Windows Admin Center 扩展卷Extending volumes using Windows Admin Center

  1. 在 Windows Admin Center 中连接到 Azure Stack HCI 群集,然后在“工具”窗格中选择“卷”。 In Windows Admin Center, connect to an Azure Stack HCI cluster, and then select Volumes from the Tools pane.

  2. 在“卷” 页上选择“清单”选项卡,然后选择要重设大小的卷。 On the Volumes page, select the Inventory tab, and then select the volume that you want to resize.

    卷的存储容量在卷详细信息页上指示。On the volume detail page, the storage capacity for the volume is indicated. 还可以直接从“仪表板”打开卷详细信息页。You can also open the volumes detail page directly from the Dashboard. 在“仪表板”上的“警报”窗格中选择警报(此警报会通知你卷的存储容量是否足够),然后选择“转到卷” 。On the Dashboard, in the Alerts pane, select the alert, which notifies you if a volume is running low on storage capacity, and then select Go To Volume.

  3. 在卷详细信息页的顶部,选择“重设大小”。 At the top of the volumes detail page, select Resize.

  4. 输入一个新且更大的大小,然后选择“重设大小” 。Enter a new larger size, and then select Resize.

    卷的这个更大的存储容量在卷详细信息页上指示,“仪表板”上的警报会清除。On the volumes detail page, the larger storage capacity for the volume is indicated, and the alert on the Dashboard is cleared.

使用 PowerShell 扩展卷Extending volumes using PowerShell

存储池中的容量Capacity in the storage pool

在重设卷大小之前,请确保存储池中有足够的容量来容纳占用量更大的新项目。Before you resize a volume, make sure you have enough capacity in the storage pool to accommodate its new, larger footprint. 例如,将三向镜像卷的大小从 1 TB 重设为 2 TB 时,其占用量会从 3 TB 增长到 6 TB。For example, when resizing a three-way mirror volume from 1 TB to 2 TB, its footprint would grow from 3 TB to 6 TB. 为了使重设大小的操作成功,至少需要在存储池中有 (6 - 3) = 3 TB 的可用容量。For the resize to succeed, you would need at least (6 - 3) = 3 TB of available capacity in the storage pool.

熟悉存储空间中的卷Familiarity with volumes in Storage Spaces

在存储空间直通中,每个卷都包含若干堆积对象:群集共享卷 (CSV),这是一个卷;分区;磁盘,这是一个虚拟磁盘;一个或多个存储层(如果适用)。In Storage Spaces Direct, every volume is comprised of several stacked objects: the cluster shared volume (CSV), which is a volume; the partition; the disk, which is a virtual disk; and one or more storage tiers (if applicable). 若要重设卷的大小,需要重设其中几个对象的大小。To resize a volume, you will need to resize several of these objects.

关系图显示了卷的各个层,包括群集分片卷层、卷层、分区层、磁盘层、虚拟磁盘层和存储层。

若要自行熟悉这些卷,请尝试在 PowerShell 中运行具有相应名词的 Get- cmdlet,。To familiarize yourself with them, try running Get- with the corresponding noun in PowerShell.

例如:For example:

Get-VirtualDisk

若要跟踪堆栈中对象之间的关联,请通过管道将一个 Get- cmdlet 传递到下一个中。To follow associations between objects in the stack, pipe one Get- cmdlet into the next.

例如,下面展示了如何将 Get- cmdlet 从虚拟磁盘传递到其卷:For example, here's how to get from a virtual disk up to its volume:

Get-VirtualDisk <FriendlyName> | Get-Disk | Get-Partition | Get-Volume

步骤 1 - 重设虚拟磁盘的大小Step 1 – Resize the virtual disk

虚拟磁盘可能使用存储层,也可能不使用,具体取决于其创建方式。The virtual disk may use storage tiers, or not, depending on how it was created.

若要进行检查,请运行以下 cmdlet:To check, run the following cmdlet:

Get-VirtualDisk <FriendlyName> | Get-StorageTier

如果该 cmdlet 不返回任何内容,则表明虚拟磁盘不使用存储层。If the cmdlet returns nothing, the virtual disk doesn't use storage tiers.

无存储层No storage tiers

如果虚拟磁盘没有存储层,可以使用 Resize-VirtualDisk cmdlet 直接重设其大小。If the virtual disk has no storage tiers, you can resize it directly using the Resize-VirtualDisk cmdlet.

-Size 参数中提供新大小。Provide the new size in the -Size parameter.

Get-VirtualDisk <FriendlyName> | Resize-VirtualDisk -Size <Size>

重设 VirtualDisk 的大小时,接下来会自动重设 Disk 的大小。When you resize the VirtualDisk, the Disk follows automatically and is resized too.

动态图显示了卷的虚拟磁盘变大,而其上紧邻的磁盘层会因此而自动变大。

有存储层With storage tiers

如果虚拟磁盘使用存储层,可以使用 Resize-StorageTier cmdlet 单独重设每个层的大小。If the virtual disk uses storage tiers, you can resize each tier separately using the Resize-StorageTier cmdlet.

按照虚拟磁盘中的关联获取存储层的名称。Get the names of the storage tiers by following the associations from the virtual disk.

Get-VirtualDisk <FriendlyName> | Get-StorageTier | Select FriendlyName

然后,在 -Size 参数中为每个层提供新大小。Then, for each tier, provide the new size in the -Size parameter.

Get-StorageTier <FriendlyName> | Resize-StorageTier -Size <Size>

提示

如果层是不同的物理媒体类型(例如 MediaType = SSDMediaType = HDD),则需确保存储池中每个媒体类型有足够的容量来容纳每个层占用量更大的新项目。If your tiers are different physical media types (such as MediaType = SSD and MediaType = HDD) you need to ensure you have enough capacity of each media type in the storage pool to accommodate the new, larger footprint of each tier.

重设 StorageTier 的大小时,接下来会自动重设 VirtualDiskDisk 的大小。When you resize the StorageTier(s), the VirtualDisk and Disk follow automatically and are resized too.

动态图显示了两个存储层先后变大,而其上的虚拟磁盘层和磁盘层也变大了。

步骤 2 - 重设分区大小Step 2 – Resize the partition

接下来,使用 Resize-Partition cmdlet 重设分区大小。Next, resize the partition using the Resize-Partition cmdlet. 虚拟磁盘应有两个分区:第一个分区为保留分区,不应进行修改;第二个分区是需要重设大小的分区,应使用 PartitionNumber = 2Type = Basic 进行设置。The virtual disk is expected to have two partitions: the first is Reserved and should not be modified; the one you need to resize has PartitionNumber = 2 and Type = Basic.

-Size 参数中提供新大小。Provide the new size in the -Size parameter. 建议使用受支持的最大大小,如下所示。We recommend using the maximum supported size, as shown below.

# Choose virtual disk
$VirtualDisk = Get-VirtualDisk <FriendlyName>

# Get its partition
$Partition = $VirtualDisk | Get-Disk | Get-Partition | Where PartitionNumber -Eq 2

# Resize to its maximum supported size
$Partition | Resize-Partition -Size ($Partition | Get-PartitionSupportedSize).SizeMax

重设 Partition 的大小时,接下来会自动重设 VolumeClusterSharedVolume 的大小。When you resize the Partition, the Volume and ClusterSharedVolume follow automatically and are resized too.

动态图显示了卷底部的虚拟磁盘层随着其上各层变大也变大。

就这么简单!That's it!

提示

可以通过运行 Get-Volume 来验证该卷是否有新大小。You can verify the volume has the new size by running Get-Volume.

后续步骤Next steps

如需其他重要的存储管理任务的分步说明,另请参阅:For step-by-step instructions on other essential storage management tasks, see also: