kubernetes/kops · error
error modifying volume: %v
Error message
error modifying volume: %v
What it means
EC2 ModifyVolume failed while applying volume type/size/IOPS/throughput changes to an existing EBS master/etcd volume; AWS commonly rejects unsupported modifications (e.g. shrinking size, lowering IOPS below the type minimum, or unsupported type transitions).
Source
Thrown at upup/pkg/fi/cloudup/awstasks/ebsvolume.go:187
}
}
if len(changes.VolumeType) > 0 ||
changes.VolumeIops != nil ||
changes.VolumeThroughput != nil ||
changes.SizeGB != nil {
request := &ec2.ModifyVolumeInput{
VolumeId: a.ID,
VolumeType: e.VolumeType,
Iops: e.VolumeIops,
Throughput: e.VolumeThroughput,
Size: e.SizeGB,
}
_, err := t.Cloud.EC2().ModifyVolume(ctx, request)
if err != nil {
return fmt.Errorf("error modifying volume: %v", err)
}
}
}
return nil
}
// getEBSVolumeTagsToDelete loops through the currently set tags and builds
// a list of tags to be deleted from the EBS Volume
func (e *EBSVolume) getEBSVolumeTagsToDelete(currentTags map[string]string) map[string]string {
tagsToDelete := map[string]string{}
for k, v := range currentTags {
if _, ok := e.Tags[k]; !ok {
tagsToDelete[k] = v
}
}
return tagsToDelete
}View on GitHub (pinned to 4c8573c808)
Solutions
- Ensure the new size is larger than the current size (EBS cannot shrink); migrate data to a new volume instead
- Wait 6+ hours since the last modification if the AWS rate limit hit
- Verify the volume type supports the requested throughput/IOPS
- Grant ec2:ModifyVolume in the IAM policy
Example fix
// before volumeSize: 10 // shrinking from 20 is unsupported // after volumeSize: 40 // only grow, or create a new volume and migrate
Defensive patterns
Strategy: validation
Validate before calling
// Only ever grow volumes; check last-modification window
desc, _ := ec2Client.DescribeVolumes(ctx, &ec2.DescribeVolumesInput{VolumeIds: []string{volID}})
v := desc.Volumes[0]
if newSize < *v.Size { return errors.New("EBS volumes cannot be shrunk") }
if v.ModifiedAt != nil && time.Since(*v.ModifiedAt) < 6*time.Hour {
return errors.New("volume modified <6h ago; AWS limits modification frequency")
} Prevention
- Never decrease volumeSize in the spec; migrate instead
- Wait 6 hours between modifications of the same volume
- Only set throughput on gp3
- Grant ec2:ModifyVolume in IAM
When it happens
Trigger: ModifyVolume fails while reconciling changes to an existing volume — requesting a smaller size (shrink unsupported), invalid size/type/throughput combination, exceeding the 1000-modify-per-6h AWS limit per volume, missing ec2:ModifyVolume permission.
Common situations: Editing the instance group's volume size downward; changing throughput on a non-gp3 volume; re-running updates too frequently hitting the once-per-6-hours modification limit.
Related errors
- error deleting Volume %q: %v
- error describing volumes: %v
- error listing volumes: %v
- found multiple Volumes with name: %s
- error creating PersistentVolume: %v
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/f0b0862cbaca81ae.
Report an issue: GitHub.