Home / Reference / FlexCache

FlexCache on ONTAP

A FlexCache volume is a read cache of an origin volume that lives on other aggregates or a remote peered cluster: edge sites serve repeated reads at LAN speed while real-time invalidation keeps the cache coherent with the origin. This guide covers when it fits (and when it does not), the deployment runbook with real ONTAP 9.x CLI, sizing rules, monitoring, and troubleshooting.

FlexCache architecture: origin cluster behind WAN, edge cluster holding a FlexCache volume of hot data

What FlexCache is — and what it is not

A FlexCache volume presents the same namespace as its origin volume, but blocks clients read are fetched from the origin only once and then served locally until invalidated. It is populate-on-demand, block-level, and coherent by design.

FlexCacheSnapMirrorFabricPool
PurposeAccelerate reads close to users/GPUsCopy data for DR/backupTier cold blocks to object storage
WritesCommitted to the origin; also kept in cache brieflyReplicated async/sync to targetN/A (tiering policy per temperature)
CohesionReal-time invalidation from origin → cachesUpdate interval (or sync mode)Same aggregate namespace
Fills on demand?Yes — blocks arrive on first missNo — full baseline copy firstn/a
Protects data?No — eviction can drop any cached block; origin remains authoritativeYesExtends capacity, not DR

Key properties worth internalizing:

Where FlexCache shines (and where it backfires)

Good fits:

Bad fits:

Prerequisites & design decisions

Checklist

Sizing guidance

Step-by-step deployment runbook

1 — Verify cluster peering (remote-origin case)

# On BOTH clusters: peer must be healthy, IC LIFs up
cluster peer show
network interface show -role intercluster

# Confirm application authorization exists (or add it)
cluster peer show -instance <peer-cluster-name>

If not yet peered, follow the Cluster & SVM Peering guide: generate passphrases, create peer relationships with IC LIFs on both clusters, verify with cluster ping-cluster.

2 — Create the FlexCache volume (edge side)

# Edge cluster: cache of an origin on the peered cluster
volume flexcache create \
  -vserver            svm_edge \
  -volume             fc_media_cache \
  -aggregate-list     aggr1_node1,aggr1_node2,aggr2_node3,aggr2_node4 \
  -size               2TB \
  -origin-vserver     svm_hq \
  -origin-volume      media_library

# Simpler: let ONTAP spread chunks across a cluster-wide pool
volume flexcache create -vserver svm_edge -volume fc_build_cache \
  -auto-provision-cluster-mode true -size 5TB \
  -origin-vserver svm_hq -origin-volume toolchain_nfs

# Same-cluster cache (edge == origin cluster): no peering needed
volume flexcache create -vserver svm_hq -volume fc_local_hot \
  -auto-provision-cluster-mode true -size 1TB \
  -origin-vserver svm_hq -origin-volume project_files

The command returns quickly (control path); initial population happens lazily as clients read. Namespace, exports, and qtrees appear immediately under the same junction structure as the origin.

3 — Mount and test from a client

showmount -e svm_edge.example.com        # junction paths visible?
mkdir -p /mnt/media && mount -t nfs svm_edge.example.com:/media_library /mnt/media

# First read of a large file = miss (crosses WAN); second read = LAN-speed hit
dd if=/mnt/media/dataset/big.bin of=/dev/null bs=1M count=10000   # slow-ish
dd if=/mnt/media/dataset/big.bin of=/dev/null bs=1M count=10000   # much faster

4 — Verify the cache is doing its job

# Instance-level view: state, origin mapping, per-cache details
volume flexcache show
volume flexcache show-instance

# From the ORIGIN side: which caches consume me?
volume flexcache origin show
volume flexcache origin show-cache-stats -vserver svm_hq -volume media_library

# Hit-rate counters: discover available objects, then watch them
statistics catalog counter show | grep -i flexcache
statistics show -object flexcache -interval 5 -iterations 6

# Latency split (local vs origin-served components)
qos statistics volume latency show -vserver svm_edge -volume fc_media_cache

Healthy signatures: flexcache_reads-family counters climbing faster than remote-fetch counters over time; QoS latency histograms for the cache volume staying well below what WAN RTT would inject.

5 — Manage lifecycle

# Find caches nobody has used lately (run on origin, ONTAP 9.10+)
volume flexcache report-idle-caches -idle-days 30

# Grow a busy cache (online)
volume size -vserver svm_edge -volume fc_media_cache -new-size 4TB

# Decommission cleanly: delete from the CACHE side
volume flexcache delete -vserver svm_edge -volume fc_old_cache
volume flexcache origin show     # origin confirms it dropped out

REST API equivalents (ONTAP 9.10+)

Automation-friendly sites can do this without SSH. Discover and act via the ONTAP REST API from the edge cluster management IP:

# List existing FlexCache volumes (filter by type)
curl -sku admin https://192.0.2.20/api/storage/volumes?type=flexcache\
  -H "Accept: application/hal+json"

# Create (same fields as the CLI; origin referenced across the peer)
curl -sku admin -X POST https://192.0.2.20/api/storage/volumes \
  -H "Content-Type: application/json" \
  -d '{"name":"fc_ci_cache","svm":{"name":"svm_edge"},
       "aggregates":[{"name":"aggr1_node1"},{"name":"aggr2_node3"}],
       "size":2147483648000,
       "flexcache":{"origin":{"volume":{"name":"toolchain_nfs"},
                                 "svm":{"name":"svm_hq"}}}}'

# Job status returned in the POST response (poll with the job URL/job.uuid)

See the ONTAP REST API automation guide for auth patterns, error bodies, and pagination conventions.

Tuning & operational gotchas

Troubleshooting matrix

SymptomDiagnosticsLikely cause / fix
volume flexcache create fails with peering/application errorcluster peer health show; cluster peer show -instancePeer relationship missing, unhealthy IC LIFs, or FlexCache application not authorized — repair peer, ensure LIFs home correctly, re-run create.
Create fails asking about aggregatesvolume flexcache show-instance; storage aggregate show-spaceExplicit -aggregate-list too small/not enough free space — provision more aggrs or switch to -auto-provision-cluster-mode true.
Junction visible but client mounts hang on first filestatistics show -object flexcache; check origin-side volume flexcache origin showCache cannot reach origin (routing/firewall on IC path, wrong IPsace). Fix connectivity; verify with cluster ping-cluster -node <edge-node>.
Hit rate stays ~0%volume flexcache origin show-cache-stats; workload profilingWorking set truly doesn't repeat (stream-once/write-heavy) — wrong workload for cache; remove it or repoint clients.
Edge reads fast all week, suddenly crawlevent log show -message-name *flx* -node *; qos statistics volume latency showWorking set exceeded cache size → thrash eviction cycle, or origin degradation shifting cost of every miss upward. Resize cache; check origin health.
Client sees stale-looking attribute seconds after someone rewrote fileCompare origin vs cache path directly; check EMS on origin for invalidation warningsRare: invalidation message missed under severe network disruption. Re-trigger the lookup from the client (ls/re-open) or restart NFS service at off-hours if persistent.
Want to delete cache but volume flexcache delete warns busyvolume show -volume X -fields files,mount-junction-path; vserver show-mounts equivalent via network connections active showLive client handles on the cache junction. Unmount clients, then delete; last resort follow KB procedure for forced cleanup — never force-delete blindly on prod.

FAQ

Can I cache an SVM-root or DP volume?
No — origins are regular read-write data volumes. SnapMirror destinations make bad origins precisely because their blocks churn via resync.
Does the client need special software?
No. Plain NFS against the edge junction; nothing kernel-side changes vs mounting the origin, because protocol surface is identical.
What happens when the origin goes down?
For stretches, previously cached (not-yet-invalidated) data may continue serving depending on release/flags, but correctness demands treating origin outage as cache-read-only-at-best. Do not architect around surviving origin loss with FlexCache — that is what MetroCluster/SnapMirror Business Continuity are for (MetroCluster guide, SM-AS guide).
How many caches per origin?
Platform/release-dependent limit — check your release's Maximum Limit Numbers. Plan fan-out explicitly rather than discovering the ceiling mid-rollout.
SnapMirror my cache volume elsewhere?
Nonsensical: cache contents are transient by definition. Mirror the origin instead; edge caches rebuild naturally when relaunched against the mirror (tiering reference covers a different cold-data pattern entirely).

Related pages