aws / amazon-ecs-init

Amazon Elastic Container Service RPM
http://aws.amazon.com/ecs
Apache License 2.0
198 stars 119 forks source link

VolumeDriver.Create: encountered error(s) in creating the volume #519

Open chaudhariatul opened 1 year ago

chaudhariatul commented 1 year ago

Summary

Docker volumes using NetApp Trident plugin fails with VolumeDriver.Create: encountered error(s) in creating the volume: [Failed to create volume ecs-wptask-9-wp_volume01-fff4ff96bbc5ffffba601 on storage pool aggr1 from backend ontapnas_10.10.20.226: error checking for existing volume: API status: failed, Reason: Invalid character '-' in volume name. It can have '_' and alphanumeric characters., Code: 13001]

Description

This issue occurs while using EC2 instances with Docker plugin for FSx NetApp Ontap. Volume names

...
    "containerDefinitions": [
        {
            "name": "wordpress01",
            "image": "wordpress:php8.1-apache",
            "cpu": 0,
            "portMappings": [
                {
                    "name": "wordpress01-80-tcp",
                    "containerPort": 80,
                    "hostPort": 0,
                    "protocol": "tcp",
                    "appProtocol": "http"
                }
            ],
            "essential": true,
            "environment": [],
            "mountPoints": [
                {
                    "sourceVolume": "wp_volume01",
                    "containerPath": "/data",
                    "readOnly": false
                }
            ],
            "volumesFrom": []
        }
    ],
    "family": "wptask",
    "networkMode": "bridge",
    "revision": 9,
    "volumes": [
        {
            "name": "wp_volume01",
            "dockerVolumeConfiguration": {
                "scope": "task",
                "driver": "netapp:latest",
                "driverOpts": {
                    "size": "10G"
                }
            }
        }
    ]
...

Expected Behavior

Docker volume as defined in "Volumes" -> "name" should be created.

Observed Behavior

New volume name is ecs-wptask-9-wp_volume01-fff4ff96bbc5ffffba601

Environment Details

  1. FSx NetApp ontap fsxadmin password updated
  2. ECS Autoscaling group EC2 launch template updated to installed Docker plugin : https://netapp-trident.readthedocs.io/en/stable-v21.07/docker/deploying.html
chaudhariatul commented 1 year ago

Note: "scope": "shared" works fine.