

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 禁用自动快照
<a name="disable-snapshots"></a>

自动快照由您的 for ONTAP 文件系统中的卷 FSx 的默认快照策略启用。如果您不需要数据快照（例如，如果您使用的是测试数据），则可以通过将卷的快照[策略设置为`none`使用 AWS 管理控制台、 AWS CLI 和 API 以及 ONTAP CLI 来禁用快](snapshots-ontap.md#snapshot-policies)照，如以下过程所述。

## 禁用自动快照（AWS 控制台）
<a name="w2aac26c11c19b5b1"></a>禁用自动快照（控制台）

1. 打开亚马逊 FSx 控制台，网址为[https://console.aws.amazon.com/fsx/](https://console.aws.amazon.com/fsx/)。

1. 导航到**文件系统**，然后选择要为其更新卷的 ONTAP 文件系统。

1. 选择**卷**选项卡。

1. 选择要更新的卷。

1. 在**操作**中，选择**更新卷**。

   系统将显示**更新卷**对话框，其中包含该卷的当前设置。

1. 对于**快照策略**，选择**无**。

1. 选择**更新**即可更新卷。

## 禁用自动快照 (AWS CLI)
<a name="w2aac26c11c19b5b3"></a>
+ 使用 [update- AWS vol](https://docs.aws.amazon.com/cli/latest/reference/fsx/update-volume.html) ume CLI 命令（或[UpdateVolume](https://docs.aws.amazon.com/fsx/latest/APIReference/API_UpdateVolume.html)等效的 API 命令）将设置`none`为`SnapshotPolicy`，如以下示例所示。

  ```
  aws fsx update-volume \
      --volume-id fsvol-1234567890abcdefa \
      --name new_vol \
      --ontap-configuration CopyTagsToBackups=true,JunctionPath=/new_vol, \
             SizeInMegabytes=2048,SnapshotPolicy=none, \
             StorageEfficiencyEnabled=true, \
             TieringPolicy=all
  ```

## 禁用自动快照（ONTAP CLI）
<a name="w2aac26c11c19b5b5"></a>

设置卷的快照策略，使用 `none` 默认策略来关闭自动快照。

1. 使用 [https://docs.netapp.com/us-en/ontap-cli-9131/volume-snapshot-policy-show.html](https://docs.netapp.com/us-en/ontap-cli-9131/volume-snapshot-policy-show.html) ONTAP CLI 命令可显示 `none` 策略。

   ```
   ::> snapshot policy show -policy none
   
   Vserver: FsxIdabcdef01234567892
                            Number of Is
   Policy Name              Schedules Enabled Comment
   ------------------------ --------- ------- ----------------------------------
   none                             0 false   Policy for no automatic snapshots.
       Schedule               Count     Prefix                 SnapMirror Label
       ---------------------- -----     ---------------------- -------------------
       -                          -     -                      -
   ```

1. 使用 [https://docs.netapp.com/us-en/ontap-cli-9131/volume-modify.html](https://docs.netapp.com/us-en/ontap-cli-9131/volume-modify.html) ONTAP CLI 命令将卷的快照策略设置为 `none` 以禁用自动快照。将以下占位符值替换为您自己的数据：
   + *`svm_name`* - 使用 SVM 的名字。
   + *`vol_name`* - 使用卷名。

   当系统提示继续操作时，请输入 **y**。

   ```
   ::> volume modify -vserver svm_name -volume vol_name -snapshot-policy none
   
   Warning: You are changing the Snapshot policy on volume "vol_name" to "none". Snapshot copies on this volume
            that do not match any of the prefixes of the new Snapshot policy will not be deleted. However, when
            the new Snapshot policy takes effect, depending on the new retention count, any existing Snapshot copies
            that continue to use the same prefixes might be deleted. See the 'volume modify' man page for more information. 
   Do you want to continue? {y|n}: y
   Volume modify successful on volume vol_name of Vserver svm_name.
   ```