Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
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
scaleTypesupport and remove the deprecatedUNIFIED_LARGE_CAPACITYpool 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.1to addLargeCapacityConfig/ 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 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 { | |||
| **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. |
| - **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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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