hashicorp/nomad · error

max requested capacity (%s) less than or equal to current (%

Error message

max requested capacity (%s) less than or equal to current (%s)

What it means

Returned by the CSIVolumeEndpoint.expandVolume RPC when a requested new capacity would shrink or not grow the volume beyond its current provisioned size. CSI controller plugin expansion only supports growing volumes; Nomad validates that the new maximum is strictly greater than the volume's current Capacity and at least the requested minimum before issuing the controller RPC. The error is returned to the client before any state is mutated.

Source

Thrown at nomad/csi_endpoint.go:1332

		return nil
	}

	// New values same as current, so nothing to do.
	if vol.RequestedCapacityMax == newMax &&
		vol.RequestedCapacityMin == newMin {
		logger.Debug("requested capacity unchanged")
		return nil
	}

	// If max is specified, it cannot be less than min or current capacity.
	if newMax > 0 {
		if newMax < newMin {
			return fmt.Errorf("max requested capacity (%s) less than or equal to min (%s)",
				humanize.Bytes(uint64(newMax)),
				humanize.Bytes(uint64(newMin)))
		}
		if newMax < vol.Capacity {
			return fmt.Errorf("max requested capacity (%s) less than or equal to current (%s)",
				humanize.Bytes(uint64(newMax)),
				humanize.Bytes(uint64(vol.Capacity)))
		}
	}

	// Values are validated, so go ahead and update vol to commit to state,
	// even if the external volume does not need expanding.
	vol.RequestedCapacityMin = newMin
	vol.RequestedCapacityMax = newMax

	// Only expand if new min is greater than current capacity.
	if newMin <= vol.Capacity {
		return nil
	}

	if !plugin.HasControllerCapability(structs.CSIControllerSupportsExpand) {
		return errors.New("expand is not implemented by this controller plugin")
	}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Increase the requested capacity so it is strictly greater than the volume's current Capacity (`nomad volume status <vol>` shows the current capacity).
  2. If you intended to shrink the volume, that is not supported: create a new larger/smaller volume, migrate data, then deregister and delete the old one.
  3. Verify the capacity_min and capacity_max values in the volume spec are not swapped and that max >= min and max > current.

Example fix

# before
nomad volume expand web-data 10GiB   # volume currently 50GiB -> error
# after
nomad volume expand web-data 100GiB
Defensive patterns

Strategy: validation

Validate before calling

current := vol.Status.CurrentCapacity // or from `nomad volume status -json`
requested, _ := units.ParseSize("100GiB")
if requested <= current {
    return fmt.Errorf("requested %d bytes must exceed current %d bytes; CSI cannot shrink volumes", requested, current)
}

Type guard

func isShrinkAttempt(err error) bool {
    return err != nil && strings.Contains(err.Error(), "less than or equal to current")
}

Prevention

When it happens

Trigger: Calling `nomad volume expand <vol> <size>` (or submitting a job/CSIVolume with a larger capacity_max) where the new max is lower than the volume's currently recorded Capacity, or where the new max is less than or equal to the requested capacity_min.

Common situations: Typo in byte size (e.g. intending 100GiB but writing 10GiB while the volume already holds 50GiB); operator not realizing a volume was already expanded and re-running the expand with an older/smaller value; attempting to shrink a volume to reclaim storage — CSI has no shrink support; min/max fields swapped in a volume spec.

Related errors


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/d91e20aca8f3202f. Report an issue: GitHub.