Creating a Snapshot Policy

Create a snapshot policy for automatic snapshot creation and deletion. A snapshot policy contains up to 10 schedules for automatic snapshots. A snapshot policy won't create snapshots without schedules.

If you don't create a schedule when you create a policy and you want to add one or more schedules to an existing policy, see Adding a Schedule to a Snapshot Policy.

    1. Open the navigation menu and click Storage. Click File Storage.
    2. In the List scope section, under Compartment, select a compartment.
    3. Under Additional resources, click Snapshot Policies.
    4. Click Create Snapshot Policy.
    5. In the Create Snapshot Policy window, provide the following details:
      1. Snapshot Policy name: Enter a name for the snapshot policy. Avoid entering confidential information.
      2. (Optional) Snapshot Policy prefix: A prefix to apply to all snapshots created by this policy.
      3. Availability Domain: Specify the availability domain that you want to create the snapshot policy in. The first availability domain selected in the leftmost panel list is used as default.
      4. Create in Compartment: Specify the compartment that you want to create the snapshot policy in.
    6. (Optional) Create one or more schedules for the snapshot policy by clicking +Add schedule. If you don't add schedules now, you can add a schedule to a snapshot policy at any time after the snapshot policy is created. A snapshot policy can have a maximum of 10 schedules, and schedules within a snapshot policy must be a combination of Schedule Type, Schedule Effective From, and Snapshot Retention Duration that's unique to the policy.
      1. (Optional) Schedule Prefix: Enter a prefix for all snapshots created by the schedule. Avoid entering confidential information.
      2. Schedule type: Select the frequency at which the snapshots are taken:
        • Hourly: A snapshot is created hourly, but not necessarily at the top of each hour.
          Note

          A snapshot policy can only contain one schedule set to create snapshots hourly.
        • Daily: A snapshot is created every 24 hours.
        • Weekly: A snapshot is created on selected day of the week.
        • Monthly: A snapshot is created on a selected day of month.
        • Yearly: A snapshot is created on a selected month and day of the year.
      3. (Optional) Schedule effective from: Choose whether the schedule becomes effective immediately, or at a selected date and time. For more information, see Schedule Types and Timing.
      4. (Optional) Schedule details: Depending on the schedule type, select the Time format and add the details in the corresponding fields. If you don't choose a specific value, and leave the default value of Automatic, the system chooses an available value for you.
      5. (Optional) Snapshot Retention Duration: The duration that the snapshot is retained before it's deleted by the system. If you don't provide a value, the system sets a default value. For more information, see retention time.
      6. (Optional) Click +Add schedule to add more schedules to the policy.
    7. (Optional) To add tags to the snapshot policy, click Show tagging options.
      If you have permissions to create a resource, then you also have permissions to apply free-form tags to that resource. To apply a defined tag, you must have permissions to use the tag namespace. For more information about tagging, see Resource Tags. If you're not sure whether to apply tags, skip this option or ask an administrator. You can apply tags later.
    8. To create the snapshot policy, click Create.
    9. (Optional) To save the configuration as a Resource Manager stack, click Save as stack. For more information, see Managing Stacks.
  • Use the oci fs filesystem-snapshot-policy create command and required parameters to create a snapshot policy:

    oci fs filesystem-snapshot-policy create --availability-domain <availability_domain> --compartment-id <compartment_id> [OPTIONS]

    To create schedules at the time you create the policy, include the optional schedules parameter. For example:

    oci fs filesystem-snapshot-policy create --availability-domain <availability_domain> --compartment-id <compartment_id> --schedules '[{"timeZone":"UTC", "period":"DAILY", "hourOfDay":18}, {"timeZone":"UTC", "period":"WEEKLY", "hourOfDay":12, "dayOfWeek":"TUESDAY"}]'

    For a complete list of flags and variable options for CLI commands, see the CLI Command Reference.

  • Use CreateFilesystemSnapshotPolicy to create a snapshot policy.

    For information about using the API and signing requests, see REST API documentation and Security Credentials. For information about SDKs, see SDKs and the CLI.