Skip to content

VSCP-5969: Support for large-capacity volumes#23

Open
jiljithcp wants to merge 5 commits into
mainfrom
VSCP-5969
Open

VSCP-5969: Support for large-capacity volumes#23
jiljithcp wants to merge 5 commits into
mainfrom
VSCP-5969

Conversation

@jiljithcp
Copy link
Copy Markdown
Collaborator

@jiljithcp jiljithcp commented May 7, 2026

Changes related to support for large volumes.
These shall be effective once the changes for large-capacity pools are in effect.

Testing results
SMB Attributes - Unified (Large).pdf

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the MCP server’s NetApp Volumes integrations to support “large-capacity” / scale-out behavior by aligning storage-pool inputs (scale type) and volume-create payloads (largeCapacityConfig + SMB settings), while also updating the underlying client/library setup to carry newly required API fields.

Changes:

  • Force REST/JSON transport in the NetApp client factory (fallback: true) to be more resilient to API/proto drift.
  • Add storage pool scaleType support and remove the deprecated UNIFIED_LARGE_CAPACITY pool type from schemas/handlers/tests/docs.
  • Update volume creation to map pool references consistently, send largeCapacityConfig: {} for large-capacity volumes, and add SMB settings/flags support (with validation + tests).
  • Introduce patch-package + a patch for @google-cloud/netapp@0.17.1 to add LargeCapacityConfig / Volume field 46.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/utils/netapp-client-factory.ts Enables REST/JSON fallback transport for the NetApp client.
src/tools/volume-tools.ts Expands volume-create schema for pool aliasing + SMB settings inputs.
src/tools/storage-pool-tools.ts Removes UNIFIED_LARGE_CAPACITY and adds scaleType to pool-create/update schemas.
src/tools/storage-pool-tools.test.ts Updates schema tests for removed pool type and new scaleType validation.
src/tools/handlers/volume-handler.ts Implements pool ref normalization, largeCapacityConfig send, and SMB settings validation/guardrails.
src/tools/handlers/volume-handler.test.ts Adds/updates tests for SMB settings, pool aliasing, and large-capacity behavior.
src/tools/handlers/storage-pool-handler.ts Implements scaleType parsing/validation and updated pool-type guardrails.
src/tools/handlers/storage-pool-handler.test.ts Adds/updates tests for scaleType behavior and updated pool-type messaging.
README.md Updates user-facing guidance for pool types/scale types and large-capacity volumes + patch note.
GEMINI.md Updates assistant guidance for pool types/scale type and large-capacity volumes (contains a heading typo).
patches/@Google-Cloud+netapp+0.17.1.patch Adds LargeCapacityConfig and Volume field 46 to the library protos.
package.json Bumps @google-cloud/netapp, adds patch-package, adds postinstall, and ships patches/.
package-lock.json Locks updated deps for @google-cloud/netapp@0.17.1 and patch-package.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
Comment on lines 29 to 33
"scripts": {
"githooks:install": "git config core.hooksPath .githooks",
"postinstall": "patch-package",
"precommit": "npm run lint && npm test",
"prepack": "npm run build",
Comment on lines +128 to +146
// scaleType is only applicable to FLEX UNIFIED pools
if (parsedScaleType !== undefined && normalizedServiceLevel !== 'FLEX') {
return {
isError: true,
content: [
{
type: 'text' as const,
text: 'Error creating storage pool: scaleType is only applicable to FLEX UNIFIED storage pools.',
},
],
};
}
if (parsedScaleType !== undefined && parsedStoragePoolType === 1) {
return {
isError: true,
content: [
{
type: 'text' as const,
text: 'Error creating storage pool: scaleType is only applicable to UNIFIED storage pools, not FILE pools.',
Comment on lines 360 to +433
@@ -272,6 +401,47 @@ export const createVolumeHandler: ToolHandler = async (args: { [key: string]: an
const normalizedProtocolNames: Array<'NFSV3' | 'NFSV4' | 'SMB' | 'ISCSI'> =
protocols && protocols.length > 0 ? protocols : ['NFSV3'];

const { smbSettings: smbSettingsList, error: smbSettingsError } = buildSmbSettingsForCreate({
smbSettings: rawSmbSettings,
smbEncryptData,
smbHideShare,
smbAccessBasedEnumeration,
smbContinuouslyAvailable,
});
if (smbSettingsError) {
return {
isError: true,
content: [{ type: 'text' as const, text: `Error creating volume: ${smbSettingsError}` }],
};
}
if (smbSettingsList && smbSettingsList.length > 0 && !normalizedProtocolNames.includes('SMB')) {
return {
isError: true,
content: [
{
type: 'text' as const,
text: 'Error creating volume: smbSettings / SMB flags require protocols to include SMB.',
},
],
};
}

if (smbSettingsList?.includes('CONTINUOUSLY_AVAILABLE')) {
const [pool] = await netAppClient.getStoragePool({ name: storagePoolResourceName });
const poolServiceLevel = (pool?.serviceLevel || '').toString().toUpperCase();
if (poolServiceLevel === 'FLEX') {
return {
Comment thread README.md
**Large capacity volumes:** Set `largeCapacity: true` (Premium/Extreme only, minimum 15 TiB). Optional `multipleEndpoints: true`.
**Large capacity volumes:** Set `largeCapacity: true` to create a large-capacity volume. Required when the storage pool is a Unified scale-out / large-capacity pool (volumes in such pools must themselves be large-capacity). The MCP server sends `largeCapacityConfig: {}` (Volume field 46) — the legacy `largeCapacity` boolean is reserved for legacy FILE pools and is mutually exclusive. FLEX scale-out / PREMIUM / EXTREME; minimum 4916 GiB. Optional `multipleEndpoints: true`.

> Note: `LargeCapacityConfig` is not yet shipped in `@google-cloud/netapp@0.17.1`. This repo applies a small `patch-package` patch (`patches/@google-cloud+netapp+0.17.1.patch`) to add the message + Volume field 46 to the bundled proto so the gRPC client can serialize it. The patch is applied automatically via the `postinstall` script.
Comment thread GEMINI.md
- **For list tools (`gcnv_*_list`), `location` is optional.** If the user does not specify a location (e.g. "list my storage pools", "list all volumes"), omit the `location` parameter or pass `-`; the API will return resources from all locations. Do not ask for a location when the user only wants a full list.

### Request construction
### Request constructionf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants