启用卷保证

如果禁用了 FlexVol 卷保证,则该卷就会假定保证类型为 none。如果卷禁用了卷保证,则应尽快为这些卷创建更多可用空间以解决此类情况。

开始之前

FlexVol 卷必须处于联机状态。

关于此任务

已启用的保证会在聚合中预先分配空间。如果卷禁用了保证,则可能会禁止执行需要更多空间的操作(例如写入,甚至还包括删除)。如果卷保证被禁用,则应重新启用该保证,才能手动增加卷大小。如果卷禁用了保证而启用了自动增长功能,则该卷的大小仍然可能自动增加。

您可以先查看卷的保证状态,或者尝试启用该保证。如果启用保证失败,则 Data ONTAP 会指明原因(通常是空间不足)并指定聚合中需要具有的可用空间量。保证类型 none 始终不会被禁用,因为不会为此保证类型分配任何空间。

步骤

  1. 可选: 使用带有 –fields-space-guarantee-space-guarantee-enabled 参数的 volume show 命令查看卷的保证状态和保证类型。
    示例
    以下示例中的命令显示了名为 vs0 的 Storage Virtual Machine (SVM) 上卷 vol2 的保证状态。保证已禁用 (false)。
    cluster1::> volume show -vserver vs0 -volume vol2 -fields space-guarantee, space-guarantee-enabled
    
    vserver volume space-guarantee space-guarantee-enabled
    ------- ------ --------------- -----------------------
    vs0     vol2   volume          false
    
    以上输出显示了指定卷的保证类型以及保证已启用还是已禁用。如果 space-guarantee-enabled 列中的值为 true,则表示保证已启用;如果该值为 false,则表示保证已禁用。
  2. 启用或重新启用保证。
    要启用保证的卷 命令
    单个卷 volume modify vol_name -space-guarantee guarantee_type

    此命令将为单个卷启用指定类型的保证,前提是有足够空间可用于执行此操作。如果指定的保证与当前为该卷配置的保证不同,则 Data ONTAP 会将保证更改为指定的保证并启用该保证。

    所有具有相同保证类型的卷 volume modify { -space-guarantee guarantee_type -space-guarantee-enabled false } -space-guarantee guarantee_type

    此命令将为所有具有指定保证类型的卷启用保证。

    请确保查询字符串中用花括号指定的保证类型与指定的目标保证类型相同。否则,此命令会更改卷的保证类型。

    以下示例中的命令为名为 v1 和 v3 的卷重新启用了保证,而且这两个卷的保证类型均为 volume

    cluster1::> volume modify { -space-guarantee volume -space-guarantee-enabled false } -space-guarantee volume
    
    Volume modify successful on volume: v1
    
    Volume modify successful on volume: v3
    2 entries were modified.
    
    此时将启用保证,或者您会收到一条错误消息,指出要启用保证,需要在聚合中创建多少空间。

    如果已使用此命令重新启用了多个相同类型的保证,则会为所有具有指定保证类型的卷启用保证,但前提有足够的可用空间可以启用这些保证。

  3. 如果聚合中没有足够空间可用于启用保证,则必须创建更多空间。
    示例
    以下示例显示了尝试为名为 testvol 的卷启用保证时显示的错误消息:
    cluster1::> volume modify testvol -s volume
    Error: command failed: Unable to set volume attribute "space-guarantee" for volume "testvol" 
    on Vserver "vs1". 
    Reason: Request to enable guarantee for this volume failed because there is not enough space 
    in the aggregate. Create 4.81MB of free space in the aggregate.
    
  4. 尝试重新启用保证,并查看命令输出以检查是否已启用保证。
    如果仍未启用保证,则必须尝试通过其他方法创建更多空间。
  5. 可选: 如果已使用其中一个命令重新启用了多个相同类型的保证,请使用 volume show 命令与 -fields space-guarantee,space-guarantee-enabled 参数来验证是否已启用所有保证。
    示例
    cluster1::> volume show -aggregate testaggr -fields space-guarantee,space-guarantee-enabled
      (volume show)
    vserver volume space-guarantee space-guarantee-enabled 
    ------- ------ --------------- ----------------------- 
    thevs   v1     volume          true                    
    thevs   v2     volume          true                    
    thevs   v3     volume          true                    
    thevs   v4     none            true                    
    thevs   v5     none            true                    
    5 entries were displayed.
    
    已启用的保证会在 space-guarantee-enabled 列中显示值 true。任何未启用的保证则在该列中显示值 false