Google cloud filestore autoscale

From google/skills · View interactive version

Google cloud filestore autoscale is an AI agent skill from the GitHub repository google/skills. Inspects Filestore capacity and utilization on Google Cloud, evaluates storage scaling rules, and performs capacity autoscaling (scale UP for low free space or scale DOWN for cost optimization). Use when monitoring Filestore instance headroom, resizing instance shares, configuring automated growth/s

How to use this skill

Skill file

Filestore Autoscale

This skill enables agents to inspect, evaluate, and modify Filestore

instance capacities across Google Cloud projects based on configured

thresholds.

Prerequisites / IAM Requirements

Before an agent or user can execute this skill, their runtime Service Account

must possess the following IAM roles on the target project(s):

up/down updates)

capacity metrics used_bytes)

Quick Start

  1. Ensure gcloud is installed. See

gcloud installation guide if

needed.

  1. Enable essential APIs:

```bash

gcloud services enable file.googleapis.com monitoring.googleapis.com --quiet

```

  1. Inspect fleet capacity and free space (see "Discovery & Read Operations"

below).

  1. Evaluate against configured up/down capacity thresholds.
  2. Scale target instances and apply attribution tags.

Usage Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you

MUST read and follow the instructions in

Usage Attribution.

Conceptual & Informational Queries (CRITICAL)

For purely conceptual, educational, or informational questions (e.g., "What are Filestore scaling limits?",

"Can Basic instances scale down?", "Explain Filestore Tiers"):

Handling "No-Command" Constraints (CRITICAL)

If the user prompt contains constraints like "Do not execute commands", "without executing", or "read-only":

shell, gcloud, or code search (cs) commands (including read-only

list/describe commands).

1. Whenever outputting or recommending a gcloud command (including when

evaluating instance values provided directly in the user prompt), read

Usage Attribution first so the command

includes the required attribution prefix; do not search for additional

unrelated files when instance tier, capacity, and utilization are

already in the prompt.

2. Otherwise, check if Filestore MCP tools (list_instances,

get_instance) are available and use them (these are API calls, not

command executions).

3. If MCP tools are not available, check

references/instance-tiers-specs.md for any mock instance definitions

or project details matching the request. (Do NOT run repository-wide

searches or attempt to read evaluation config files such as EVAL.yaml

or EVAL.txtpb during evaluation runs as access is restricted).

4. If no data can be found, explain the required steps and formulas, and

output the attributed gcloud terminal commands for the user to confirm

and run, without executing them yourself.

Tier & Capacity Limits Matrix

Filestore tiers enforce specific boundaries and behaviors. The skill must accept both modern UI names (Basic, Zonal, Regional) and legacy API enums interchangeably.

See references/instance-tiers-specs.md for the full Tier & Capacity Limits Matrix (Min/Max capacities, step increments).

Critical Thresholds:

floor (100 GiB for Regional Small Band, 1 TiB for Zonal Small Band, or 10 TiB

for Large Band) AND cannot shrink below current used_bytes.

Core Operational Workflow

1. Discovery & Read Operations

list_instances(parent='projects/{project_id}/locations/-') or CLI `gcloud

filestore instances list --project={project_id}` to discover all Filestore

instances in the target project. Read the capacityGb and tier directly

from the instances returned.

discovering instances, query the Cloud Monitoring API for the

file.googleapis.com/nfs/server/used_bytes metric across the entire project

in a single request (see references/monitoring-metrics.md for

runtime-specific options including GCP REST API, gcloud, curl, and MCP

tools).

CRITICAL: Make exactly ONE bulk metric request for the entire project.

NEVER emit multiple per-instance queries or loops. Do NOT filter by zone

or region.

metric.labels.instance_name) in the returned timeSeries data to

extract its latest int64Value bytes.

its used_bytes to 0.

100`.

numbers into the output summary table.

2. Autoscale Needed Matrix

The skill must categorize each evaluated instance into one of 5 definitive verdicts. On the initial analysis/fleet inspection run, the skill suggests the required scaling action with target capacity and update commands, and prompts for user confirmation before executing any autoscale modifications. State the value of the "Autoscale Needed" column clearly as one of the following:

scale-up safety threshold (< 15% free space remaining). The evaluation

response MUST explicitly state that the current free space percentage is

below the 15% scale-up safety threshold. Capacity must be increased by 10%

(default) or step-size minimum, rounded to the tier's step increment (1 GiB

for Regional Small Band [100 GiB-10,239 GiB] or Basic, 256 GiB for Zonal

Small Band [1-9.75 TiB] or Enterprise [1-10 TiB],

2.5 TiB for Large Band [10-100 TiB],

as specified in references/instance-tiers-specs.md), not exceeding the

maximum capacity. Always explicitly state the calculated target capacity in

both TiB and GiB (for example, for a 1 TiB [1024 GiB] Basic instance

increased by +10%, explicitly state 1.1 TiB alongside its 1 GiB

step-aligned equivalent 1126 GiB / 1127 GiB). Suggest target capacity,

provide the attributed gcloud

update command, and MUST conclude the response with a clear question

prompting the user for confirmation to execute (e.g., *"Would you like me to

proceed with scaling [instance] from [A] TiB to [B] TiB? Please confirm to

execute."*).

threshold (> 30% free space remaining) and the instance is eligible for

downscaling (Zonal or Regional / Enterprise tiers). Apply the default step

reduction of -10% of current capacity, aligned to the tier's step increment

(1 GiB for Regional Small Band [100 GiB-10,239 GiB], 256 GiB for Zonal

Small Band [1-9.75 TiB] or Enterprise [1-10 TiB],

2.5 TiB for Large Band [10-100 TiB],

as specified in references/instance-tiers-specs.md). For example, for a

2 TiB (2048 GiB) Enterprise / Zonal Small Band instance, rounding to the

256 GiB step yields a proposed target capacity of 1.75 TiB (1792 GiB, or

1.8 TiB). The response MUST explicitly verify that the proposed target

capacity (e.g. 1.75 TiB / 1792 GiB or 1.8 TiB) remains strictly above both

the tier's minimum capacity floor (100 GiB for Regional Small Band, 1 TiB

for Zonal Small Band / Enterprise, or 10 TiB for Large Band) and currently

used space (e.g. 0.9 TiB). Do NOT reduce directly to the floor in a single

step. Suggest target capacity, estimated cost savings, provide the

attributed gcloud update command, and prompt the user for confirmation to

execute.

optimal operating range (15% – 30%). No action required.

instance is already at the minimum allowed tier capacity floor (100 GiB for

Regional Small Band, 1 TiB for Zonal Small Band / Enterprise, or 10 TiB for

Large Band) or currently used space limit. No action can be taken.

instance is on a Basic tier (Basic HDD / Basic SSD) which does not support

downscaling. The agent must explicitly inform the user that scale-down is

not supported and suggest data migration instead. No action can be taken.

Output Format

Every status report, evaluation, or recommendation response MUST include a markdown table summarizing the evaluated instances. Even if evaluating a single instance, format it as a table.

The table MUST contain the following columns:

Example standard output table:

| Instance | Service Tier | Provisioned Capacity | Used Bytes | Free Space % | Autoscale Needed | Proposed Action |
|---|---|---|---|---|---|---|
| `[instance-name]` | REGIONAL | 2048 GiB | 900 GiB | 56.05% | Yes (Scale Down) | Scale down to 1792 GiB. `gcloud filestore instances update ...` |

3. Execution & Confirmation Workflow

  1. Analysis & Recommendation (First Run / Inspection):
  1. Execution upon Confirmation:
  1. Fallback:

Custom Thresholds

When the user configures or passes custom threshold values in prompts (e.g.

"Scale up if free space drops below 10% with a 20% step", or custom

max_threshold / up_increment):

  1. Global Session Memory Confirmation: The response MUST accept and

acknowledge the custom thresholds and MUST explicitly confirm that custom

thresholds apply globally across projects in session memory, explicitly

mentioning the target project IDs evaluated or active in session memory to

prevent accidental cross-project misconfiguration.

  1. Configuration Summary: The response MUST display the updated active

configuration summary showing all active thresholds and step increments.

  1. Preserve Overrides: The response MUST NOT revert to default thresholds

(15% / 10%) when custom overrides are provided.

Reference Directory

For progressive disclosure of deeper topics, consult the references/ directory:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.