{"record":{"id":"0ded2d978e33d35e","repo":"kubernetes/kops","slug":"error-creating-persistentvolume-v","errorCode":null,"errorMessage":"error creating PersistentVolume: %v","messagePattern":"error creating PersistentVolume: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/ebsvolume.go","lineNumber":154,"sourceCode":"func (_ *EBSVolume) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *EBSVolume) error {\n\tctx := context.TODO()\n\tif a == nil {\n\t\tklog.V(2).Infof(\"Creating PersistentVolume with Name:%q\", *e.Name)\n\n\t\trequest := &ec2.CreateVolumeInput{\n\t\t\tSize:              e.SizeGB,\n\t\t\tAvailabilityZone:  e.AvailabilityZone,\n\t\t\tVolumeType:        e.VolumeType,\n\t\t\tKmsKeyId:          e.KmsKeyId,\n\t\t\tEncrypted:         e.Encrypted,\n\t\t\tIops:              e.VolumeIops,\n\t\t\tThroughput:        e.VolumeThroughput,\n\t\t\tTagSpecifications: awsup.EC2TagSpecification(ec2types.ResourceTypeVolume, e.Tags),\n\t\t}\n\n\t\tresponse, err := t.Cloud.EC2().CreateVolume(ctx, request)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error creating PersistentVolume: %v\", err)\n\t\t}\n\n\t\te.ID = response.VolumeId\n\t}\n\n\tif err := t.AddAWSTags(*e.ID, e.Tags); err != nil {\n\t\treturn fmt.Errorf(\"error adding AWS Tags to EBS Volume: %v\", err)\n\t}\n\n\tif a != nil {\n\t\tif len(changes.Tags) > 0 {\n\t\t\ttagsToDelete := e.getEBSVolumeTagsToDelete(a.Tags)\n\t\t\tif len(tagsToDelete) > 0 {\n\t\t\t\treturn t.DeleteTags(*e.ID, tagsToDelete)\n\t\t\t}\n\t\t}\n\n\t\tif len(changes.VolumeType) > 0 ||","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/ebsvolume.go#L136-L172","documentation":"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.","triggerScenarios":"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.","commonSituations":"Master availability zone mismatches; requesting gp3 throughput on older APIs; volume quota exhausted in the AZ; IAM policies too narrow.","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"],"exampleFix":"// before\nvolumeType: gp2\nvolumeThroughput: 300   // invalid for gp2\n// after\nvolumeType: gp3\nvolumeThroughput: 300","handlingStrategy":"validation","validationCode":"// Validate volume params against AZ and type before CreateVolume\nif volType == \"gp2\" && throughput > 0 { return errors.New(\"throughput only supported on gp3\") }\nsubnets, _ := ec2Client.DescribeSubnets(ctx, &ec2.DescribeSubnetsInput{SubnetIds: []string{subnetID}})\n// ensure requested AZ matches subnet AZ","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["aws","ec2","ebs","volume-creation"],"backgroundTag":"ebs-create-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"}