{"record":{"id":"264a089369e1f9a6","repo":"hashicorp/nomad","slug":"expand-is-not-implemented-by-this-controller-plugi","errorCode":null,"errorMessage":"expand is not implemented by this controller plugin","messagePattern":"expand is not implemented by this controller plugin","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/csi_endpoint.go","lineNumber":1349,"sourceCode":"\t\tif newMax < vol.Capacity {\n\t\t\treturn fmt.Errorf(\"max requested capacity (%s) less than or equal to current (%s)\",\n\t\t\t\thumanize.Bytes(uint64(newMax)),\n\t\t\t\thumanize.Bytes(uint64(vol.Capacity)))\n\t\t}\n\t}\n\n\t// Values are validated, so go ahead and update vol to commit to state,\n\t// even if the external volume does not need expanding.\n\tvol.RequestedCapacityMin = newMin\n\tvol.RequestedCapacityMax = newMax\n\n\t// Only expand if new min is greater than current capacity.\n\tif newMin <= vol.Capacity {\n\t\treturn nil\n\t}\n\n\tif !plugin.HasControllerCapability(structs.CSIControllerSupportsExpand) {\n\t\treturn errors.New(\"expand is not implemented by this controller plugin\")\n\t}\n\n\tcapability, err := csi.VolumeCapabilityFromStructs(vol.AttachmentMode, vol.AccessMode, vol.MountOptions)\n\tif err != nil {\n\t\tlogger.Debug(\"unable to get capability from volume\", \"error\", err)\n\t\t// We'll optimistically send a nil capability, as an \"unknown\"\n\t\t// attachment mode (likely not attached) is acceptable per the spec.\n\t}\n\n\tmethod := \"ClientCSI.ControllerExpandVolume\"\n\tcReq := &cstructs.ClientCSIControllerExpandVolumeRequest{\n\t\tExternalVolumeID: vol.ExternalID,\n\t\tSecrets:          vol.Secrets,\n\t\tCapacityRange:    capacity,\n\t\tVolumeCapability: capability,\n\t}\n\tcReq.PluginID = plugin.ID\n\tcResp := &cstructs.ClientCSIControllerExpandVolumeResponse{}","sourceCodeStart":1331,"sourceCodeEnd":1367,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/csi_endpoint.go#L1331-L1367","documentation":"During controller-driven volume expansion, expandVolume only expands when the requested minimum capacity exceeds the volume's current capacity AND the CSI controller plugin advertises CSIControllerSupportsExpand. If the plugin lacks that capability, this error is returned because the controller cannot perform the resize.","triggerScenarios":"Submitting a volume-scale request ('nomad volume scale' or volume update via API) for a CSI volume whose controller plugin does not declare the EXPAND_VOLUME controller capability, while newMin > vol.Capacity.","commonSituations":"Using a storage driver whose controller does not support online/offline expansion (common with some CSI drivers); attempting to grow a volume after deploying a plugin that only supports attach/detach; scaling a volume in a job file without checking plugin capabilities.","solutions":["Check plugin capabilities: 'nomad plugin status <plugin>' and confirm EXPAND controller capability is listed","Expand the volume externally via the storage vendor's own tooling, then re-register/update the volume capacity in Nomad","Upgrade or switch to a CSI plugin/driver version that supports controller expansion","If newMin <= current capacity, no expansion is attempted — verify the requested size actually exceeds vol.Capacity"],"exampleFix":"// before\nnomad volume scale ebs-vol min-capacity=100GiB  // plugin lacks expand\n// after: expand via vendor CLI then update Nomad record\naws ec2 modify-volume --volume-id vol-xxx --size 100\nnomad volume update ebs-vol.hcl","handlingStrategy":"validation","validationCode":"// shell: confirm the plugin supports expansion before scaling\nnomad plugin status <pluginID> -json | jq -e '.ControllersSupportedFunctions // .ControllerInfo.SupportedFunctions | has(\"EXPAND_VOLUME\")' \\\n  || { echo 'plugin cannot expand volumes'; exit 1; }","typeGuard":null,"tryCatchPattern":"// Go client\nif _, err := client.CSI().VolumeScale(volID, newMin, newMax); err != nil {\n    if strings.Contains(err.Error(), \"expand is not implemented\") {\n        return expandExternally(volID, newMin) // vendor CLI path\n    }\n    return err\n}","preventionTips":["Check 'nomad plugin status' capabilities before planning resizes","Prefer CSI drivers with documented controller expansion","Expand externally and update the volume record when the driver lacks the capability","Verify requested size exceeds current capacity to trigger (or skip) expansion deliberately"],"tags":["nomad","csi","storage","volume-expansion"],"backgroundTag":"csi-capability-unsupported","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}