Skip to main content

Create a FlexCache volume in the cluster

Contributors

POST /storage/flexcache/flexcaches

Introduced In: 9.6

Creates a FlexCache in the cluster.

Required properties

  • name - Name of FlexCache volume.

  • origins.volume.name or origins.volume.uuid - Name or UUID of origin volume.

  • origins.svm.name - Name of origin Vserver.

  • svm.name or svm.uuid - Name or UUID of Vserver where FlexCache will be created.

  • path - Path to mount the FlexCache volume

  • prepopulate.dir_paths - List of directory-paths to be prepopulated for the FlexCache volume.

  • prepopulate.exclude_dir_paths - List of directory-paths to be excluded from prepopulation for he FlexCache volume.

Default property values

If not specified in POST, the following default property values are assigned:

  • size - 10% of origin volume size or 1GB per constituent, whichever is greater.

  • guarantee.type - none. FlexCache is thin provisioned by default.

  • constituents_per_aggregate - 4 if aggregates.name or aggregates.uuid is used.

  • use_tiered_aggregate - false if aggr-list is not used. This property is only used when auto-provisioning a FlexCache volume.

  • is_disconnected_mode_off_for_locks - false. This property specifies if the origin will honor the cache side locks when doing the lock checks in the disconnected mode.

  • dr_cache - false if FlexCache is not a DR cache. This property is used to create a DR FlexCache.

  • global_file_locking_enabled - false. This property specifies whether global file locking is enabled on the FlexCache volume.

  • writeback.enabled - false. This property specifies whether writeback is enabled for the FlexCache volume.

  • relative_size.enabled - false. This property specifies whether the relative sizing is enabled for the FlexCache volume.

  • relative_size.percentage - 10. This property specifies the percent size FlexCache volume should have relative to the total size of the origin volume.

  • override_encryption - false. If true, this property is used to create a plaintext FlexCache volume for an encrypted origin volume.

  • atime_scrub.enabled - false. This property specifies whether scrubbing of inactive files based on atime is enabled for the FlexCache volume.

  • atime_scrub.period - 30. This property specifies the atime duration in days after which the file can be scrubbed from the FlexCache volume if it stays unused beyond the duration.

  • cifs_change_notify.enabled - false. This property specifies whether a CIFS change notification is enabled for the FlexCache volume.

  • volume flexcache create

  • volume flexcache prepopulate start

Parameters

Name Type In Required Description

return_timeout

integer

query

False

The number of seconds to allow the call to execute before returning. When doing a POST, PATCH, or DELETE operation on a single record, the default is 0 seconds. This means that if an asynchronous operation is started, the server immediately returns HTTP code 202 (Accepted) along with a link to the job. If a non-zero value is specified for POST, PATCH, or DELETE operations, ONTAP waits that length of time to see if the job completes so it can return something other than 202.

  • Default value: 1

  • Max value: 120

  • Min value: 0

return_records

boolean

query

False

The default is false. If set to true, the records are returned.

  • Default value:

Request Body

Name Type Description

_links

_links

aggregates

array[aggregates]

atime_scrub

atime_scrub

FlexCache volume atime-based scrub

cifs_change_notify

cifs_change_notify

Notifies that a change has been made to the FlexCache volume CIFS.

constituents_per_aggregate

integer

Number of FlexCache constituents per aggregate when the 'aggregates' field is mentioned.

dr_cache

boolean

If set to true, a DR cache is created.

global_file_locking_enabled

boolean

Specifies whether or not a FlexCache volume has global file locking mode enabled. Global file locking mode is a mode where protocol read locking semantics are enforced across all FlexCaches and origins of a FlexCache volume. When global file locking mode is enabled, the "is_disconnected_mode_off_for_locks" flag is always set to "true".

guarantee

guarantee

name

string

FlexCache name

origins

array[flexcache_relationship]

override_encryption

boolean

If set to true, a plaintext FlexCache volume for an encrypted origin volume is created.

path

string

The fully-qualified path in the owning SVM's namespace at which the FlexCache is mounted. The path is case insensitive and must be unique within a SVM's namespace. Path must begin with '/' and must not end with '/'. Only one FlexCache be mounted at any given junction path.

prepopulate

prepopulate

FlexCache prepopulate

relative_size

relative_size

FlexCache Relative Size

size

integer

Physical size of the FlexCache. The recommended size for a FlexCache is 10% of the origin volume. The minimum FlexCache constituent size is 1GB.

svm

svm

FlexCache SVM

use_tiered_aggregate

boolean

Specifies whether or not a Fabricpool-enabled aggregate can be used in FlexCache creation. The use_tiered_aggregate is only used when auto-provisioning a FlexCache volume.

uuid

string

FlexCache UUID. Unique identifier for the FlexCache.

writeback

writeback

FlexCache Writeback

Example request
{
  "_links": {
    "self": {
      "href": "/api/resourcelink"
    }
  },
  "aggregates": [
    {
      "_links": {
        "self": {
          "href": "/api/resourcelink"
        }
      },
      "name": "aggr1",
      "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
    }
  ],
  "guarantee": {
    "type": "string"
  },
  "name": "vol1",
  "origins": [
    {
      "cluster": {
        "_links": {
          "self": {
            "href": "/api/resourcelink"
          }
        },
        "name": "cluster1",
        "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
      },
      "create_time": "2018-06-04 15:00:00 -0400",
      "ip_address": "10.10.10.7",
      "size": 0,
      "state": "string",
      "svm": {
        "_links": {
          "self": {
            "href": "/api/resourcelink"
          }
        },
        "name": "svm1",
        "uuid": "02c9e252-41be-11e9-81d5-00a0986138f7"
      },
      "volume": {
        "_links": {
          "self": {
            "href": "/api/resourcelink"
          }
        },
        "name": "volume1",
        "uuid": "028baa66-41bd-11e9-81d5-00a0986138f7"
      }
    }
  ],
  "path": "/user/my_fc",
  "prepopulate": {
    "dir_paths": [
      "/dir1"
    ],
    "exclude_dir_paths": [
      "/dir1/dir2"
    ]
  },
  "svm": {
    "_links": {
      "self": {
        "href": "/api/resourcelink"
      }
    },
    "name": "svm1",
    "uuid": "02c9e252-41be-11e9-81d5-00a0986138f7"
  },
  "uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
}

Response

Status: 202, Accepted
Name Type Description

job

job_link

Example response
{
  "job": {
    "_links": {
      "self": {
        "href": "/api/resourcelink"
      }
    },
    "uuid": "string"
  }
}

Headers

Name Description Type

Location

Useful for tracking the resource location

string

Response

Status: 201, Created

Error

Status: Default

ONTAP Error Response Codes

Error Code Description

66846735

The peer state of the relationship is not peered or the FlexCache application is not supported by the relationship

66846762

The origin volume in the SVM is offline

66846863

The preserve-msid parameter is not supported when creating the FlexCache volume in the same SVM as the origin of a FlexCache volume

66846870

Either the SVM name or origin volume name is missing

66846871

Constituents per aggregate are specified but aggregate name is missing

66846872

More than one origin volume is specified

66846873

The specified SVM UUID is incorrect for the specified SVM name

66846874

The specified aggregate UUID is incorrect for the specified aggregate name

66846875

The specified aggregate name does not exist

66846876

The specified SVM does not exist or is not peered

66846877

The specified origin SVM name is of zero length

66846878

The specified SVM UUID is invalid

66846730

Failed to create a FlexCache volume

66846760

The specified SVM is not a data Vserver

66846787

The specified aggregate is a SnapLock aggregate

66846812

The specified aggregate is a Composite aggregate

66846812

The specified junction path is under a FlexCache volume

66846834

FlexCache encryption requires a cluster version of 9.6 or higher

66846835

A volume encryption license is not found

66847013

Creating a FlexCache volume with override-encryption property set to true requires an effective cluster version of 9.14.0 or later on both origin and cache clusters

Name Type Description

error

returned_error

Example error
{
  "error": {
    "arguments": [
      {
        "code": "string",
        "message": "string"
      }
    ],
    "code": "4",
    "message": "entry doesn't exist",
    "target": "uuid"
  }
}

Definitions

See Definitions

href

Name Type Description

href

string

Name Type Description

self

href

aggregates

Aggregate

Name Type Description

_links

_links

name

string

uuid

string

atime_scrub

FlexCache volume atime-based scrub

Name Type Description

enabled

boolean

Specifies whether scrubbing of inactive files based on atime is enabled for the FlexCache volume. When scrubbing is enabled, files whose atime is older than the specified duration are evicted from the cache volume. The scrubber runs once a day and looks for files whose atime has exceeded the provisioned value.

period

integer

Specifies the atime duration in days after which a cached file is considered inactive. Inactive files are purged from the FlexCache volumes when the scrubber runs once a day.

cifs_change_notify

Notifies that a change has been made to the FlexCache volume CIFS.

Name Type Description

enabled

boolean

Specifies whether a CIFS change notification is enabled for the FlexCache volume.

guarantee

Name Type Description

type

string

The type of space guarantee of this volume in the aggregate.

cluster

Name Type Description

_links

_links

name

string

uuid

string

svm

SVM, applies only to SVM-scoped objects.

Name Type Description

_links

_links

name

string

The name of the SVM. This field cannot be specified in a PATCH method.

uuid

string

The unique identifier of the SVM. This field cannot be specified in a PATCH method.

volume

Name Type Description

_links

_links

name

string

The name of the volume. This field cannot be specified in a POST or PATCH method.

uuid

string

Unique identifier for the volume. This corresponds to the instance-uuid that is exposed in the CLI and ONTAPI. It does not change due to a volume move.

  • example: 028baa66-41bd-11e9-81d5-00a0986138f7

  • Introduced in: 9.6

  • x-nullable: true

flexcache_relationship

Name Type Description

cluster

cluster

create_time

string

Creation time of the relationship.

ip_address

string

Cluster managerment IP of the remote cluster.

size

integer

Size of the remote volume.

state

string

Volume state

svm

svm

SVM, applies only to SVM-scoped objects.

volume

volume

prepopulate

FlexCache prepopulate

Name Type Description

dir_paths

array[string]

exclude_dir_paths

array[string]

recurse

boolean

Specifies whether or not the prepopulate action should search through the dir_paths recursively. If not set, the default value true is used.

relative_size

FlexCache Relative Size

Name Type Description

enabled

boolean

Specifies whether the relative sizing is enabled for the FlexCache volume. Relative sizing is introduced as a part of follow the origin feature. When relative sizing is enabled, it blocks any modifications done manually in the absolute size of the FlexCache volume. The size of the FlexCache volume is calculated and entered automatically based on the size of the origin volume.

percentage

integer

Specifies the percent size the FlexCache volume should have relative to the total size of the origin volume. This property is only relevant to a FlexCache volume that has the relative size property enabled.

svm

FlexCache SVM

Name Type Description

_links

_links

name

string

The name of the SVM. This field cannot be specified in a PATCH method.

uuid

string

The unique identifier of the SVM. This field cannot be specified in a PATCH method.

writeback

FlexCache Writeback

Name Type Description

enabled

boolean

Indicates whether or not writeback is enabled for the FlexCache volume. Writeback is a storage method where data is first written to the FlexCache volume and then written to the origin of a FlexCache volume.

flexcache

Defines the cache endpoint of FlexCache.

Name Type Description

_links

_links

aggregates

array[aggregates]

atime_scrub

atime_scrub

FlexCache volume atime-based scrub

cifs_change_notify

cifs_change_notify

Notifies that a change has been made to the FlexCache volume CIFS.

constituents_per_aggregate

integer

Number of FlexCache constituents per aggregate when the 'aggregates' field is mentioned.

dr_cache

boolean

If set to true, a DR cache is created.

global_file_locking_enabled

boolean

Specifies whether or not a FlexCache volume has global file locking mode enabled. Global file locking mode is a mode where protocol read locking semantics are enforced across all FlexCaches and origins of a FlexCache volume. When global file locking mode is enabled, the "is_disconnected_mode_off_for_locks" flag is always set to "true".

guarantee

guarantee

name

string

FlexCache name

origins

array[flexcache_relationship]

override_encryption

boolean

If set to true, a plaintext FlexCache volume for an encrypted origin volume is created.

path

string

The fully-qualified path in the owning SVM's namespace at which the FlexCache is mounted. The path is case insensitive and must be unique within a SVM's namespace. Path must begin with '/' and must not end with '/'. Only one FlexCache be mounted at any given junction path.

prepopulate

prepopulate

FlexCache prepopulate

relative_size

relative_size

FlexCache Relative Size

size

integer

Physical size of the FlexCache. The recommended size for a FlexCache is 10% of the origin volume. The minimum FlexCache constituent size is 1GB.

svm

svm

FlexCache SVM

use_tiered_aggregate

boolean

Specifies whether or not a Fabricpool-enabled aggregate can be used in FlexCache creation. The use_tiered_aggregate is only used when auto-provisioning a FlexCache volume.

uuid

string

FlexCache UUID. Unique identifier for the FlexCache.

writeback

writeback

FlexCache Writeback

Name Type Description

_links

_links

uuid

string

The UUID of the asynchronous job that is triggered by a POST, PATCH, or DELETE operation.

error_arguments

Name Type Description

code

string

Argument code

message

string

Message argument

returned_error

Name Type Description

arguments

array[error_arguments]

Message arguments

code

string

Error code

message

string

Error message

target

string

The target parameter that caused the error.