kubernetes/kops · error
error creating PersistentVolume: %v
Error message
error creating PersistentVolume: %v
What it means
RenderAWS failed when calling EC2 CreateVolume to create the desired EBS PersistentVolume. kOps wraps the AWS error verbatim; the volume was not created and the task's ID remains unset, aborting reconciliation of that task.
Source
Thrown at upup/pkg/fi/cloudup/awstasks/ebsvolume.go:154
func (_ *EBSVolume) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *EBSVolume) error {
ctx := context.TODO()
if a == nil {
klog.V(2).Infof("Creating PersistentVolume with Name:%q", *e.Name)
request := &ec2.CreateVolumeInput{
Size: e.SizeGB,
AvailabilityZone: e.AvailabilityZone,
VolumeType: e.VolumeType,
KmsKeyId: e.KmsKeyId,
Encrypted: e.Encrypted,
Iops: e.VolumeIops,
Throughput: e.VolumeThroughput,
TagSpecifications: awsup.EC2TagSpecification(ec2types.ResourceTypeVolume, e.Tags),
}
response, err := t.Cloud.EC2().CreateVolume(ctx, request)
if err != nil {
return fmt.Errorf("error creating PersistentVolume: %v", err)
}
e.ID = response.VolumeId
}
if err := t.AddAWSTags(*e.ID, e.Tags); err != nil {
return fmt.Errorf("error adding AWS Tags to EBS Volume: %v", err)
}
if a != nil {
if len(changes.Tags) > 0 {
tagsToDelete := e.getEBSVolumeTagsToDelete(a.Tags)
if len(tagsToDelete) > 0 {
return t.DeleteTags(*e.ID, tagsToDelete)
}
}
if len(changes.VolumeType) > 0 ||View on GitHub (pinned to 4c8573c808)
Solutions
- Read the wrapped AWS error; fix the invalid parameter (AZ, type, size, IOPS, throughput)
- Verify the AZ of the volume matches a subnet AZ of the instance group
- Check AWS service quotas for EBS volumes in the region
- Grant ec2:CreateVolume in the IAM policy
Example fix
// before volumeType: gp2 volumeThroughput: 300 // invalid for gp2 // after volumeType: gp3 volumeThroughput: 300
Defensive patterns
Strategy: validation
Validate before calling
// Validate volume params against AZ and type before CreateVolume
if volType == "gp2" && throughput > 0 { return errors.New("throughput only supported on gp3") }
subnets, _ := ec2Client.DescribeSubnets(ctx, &ec2.DescribeSubnetsInput{SubnetIds: []string{subnetID}})
// ensure requested AZ matches subnet AZ Prevention
- Match volume AZ to instance subnet AZ
- Only set throughput/IOPS on supporting volume types
- Check EBS quotas before provisioning
- Include ec2:CreateVolume in IAM policy
When it happens
Trigger: CreateVolume call fails — unsupported AvailabilityZone, invalid volume type/parameters (e.g. Throughput set on a type that doesn't support it, bad IOPS for io1/io2/gp3), exceeding volume limits, missing ec2:CreateVolume permission.
Common situations: Master availability zone mismatches; requesting gp3 throughput on older APIs; volume quota exhausted in the AZ; IAM policies too narrow.
Related errors
- error deleting Volume %q: %v
- error describing volumes: %v
- error listing volumes: %v
- found multiple Volumes with name: %s
- error adding AWS Tags to EBS Volume: %v
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/0ded2d978e33d35e.
Report an issue: GitHub.