{"record":{"id":"f0b0862cbaca81ae","repo":"kubernetes/kops","slug":"error-modifying-volume-v","errorCode":null,"errorMessage":"error modifying volume: %v","messagePattern":"error modifying volume: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/ebsvolume.go","lineNumber":187,"sourceCode":"\t\t\t}\n\t\t}\n\n\t\tif len(changes.VolumeType) > 0 ||\n\t\t\tchanges.VolumeIops != nil ||\n\t\t\tchanges.VolumeThroughput != nil ||\n\t\t\tchanges.SizeGB != nil {\n\n\t\t\trequest := &ec2.ModifyVolumeInput{\n\t\t\t\tVolumeId:   a.ID,\n\t\t\t\tVolumeType: e.VolumeType,\n\t\t\t\tIops:       e.VolumeIops,\n\t\t\t\tThroughput: e.VolumeThroughput,\n\t\t\t\tSize:       e.SizeGB,\n\t\t\t}\n\n\t\t\t_, err := t.Cloud.EC2().ModifyVolume(ctx, request)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error modifying volume: %v\", err)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// getEBSVolumeTagsToDelete loops through the currently set tags and builds\n// a list of tags to be deleted from the EBS Volume\nfunc (e *EBSVolume) getEBSVolumeTagsToDelete(currentTags map[string]string) map[string]string {\n\ttagsToDelete := map[string]string{}\n\tfor k, v := range currentTags {\n\t\tif _, ok := e.Tags[k]; !ok {\n\t\t\ttagsToDelete[k] = v\n\t\t}\n\t}\n\n\treturn tagsToDelete\n}","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/ebsvolume.go#L169-L205","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nvolumeSize: 10   // shrinking from 20 is unsupported\n// after\nvolumeSize: 40   // only grow, or create a new volume and migrate","handlingStrategy":"validation","validationCode":"// Only ever grow volumes; check last-modification window\ndesc, _ := ec2Client.DescribeVolumes(ctx, &ec2.DescribeVolumesInput{VolumeIds: []string{volID}})\nv := desc.Volumes[0]\nif newSize < *v.Size { return errors.New(\"EBS volumes cannot be shrunk\") }\nif v.ModifiedAt != nil && time.Since(*v.ModifiedAt) < 6*time.Hour {\n    return errors.New(\"volume modified <6h ago; AWS limits modification frequency\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["aws","ec2","ebs","volume-resize"],"backgroundTag":"ebs-modify-volume-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}