Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

ACI gets stuck in 'Pending' if multiple volume mounts with identical mounthPath are used #28

Open
jwefers opened this issue Nov 28, 2018 · 2 comments

Comments

@jwefers
Copy link

jwefers commented Nov 28, 2018

When creating an ACI and specifying multiple volumeMounts with the same mountPath, the service accepts the request and the ACI goes straight into 'Pending' forever. Not forever, because after about half an hour, it goes into something like 'backOff'. The REST service should validate this and return a BadRequest.

PowerShell to reproduce (you can use absolutely any docker image, the ACI will not reach 'Pulling' state):

Invoke-WebRequest `
    -UseBasicParsing `
    -Method PUT `
    -ContentType "application/json" `
    -Headers  @{
    Authorization = "Bearer $authToken"
} `
    -Uri "https://management.azure.com/subscriptions/$subscription/resourceGroups/$resourceGroup/providers/Microsoft.ContainerInstance/containerGroups/$containerGroupName?api-version=2018-10-01" `
    -Body (@{
        id         = "/subscriptions/$subscription/resourceGroups/$resourceGroup/providers/Microsoft.ContainerInstance/containerGroups/$containerGroupName"
        location   = "west europe"
        name       = "$containerGroupName"
        properties = @{
            osType                   = "Linux"
            containers               = @(
                @{
                    name       = "$containerName"
                    properties = @{
                        image        = "$ContainerRegistryServer/$ImageName"
                        resources    = @{
                            requests = @{
                                cpu        = 1
                                memoryInGB = 0.3
                            }
                        }
                        volumeMounts = @(
                                @{
                                    name      = "mount1"
                                    mountPath = "/mnt/"
                                    readOnly  = $true
                                },
                                @{
                                    name      = "mount2"
                                    mountPath = "/mnt/"
                                    readOnly  = $true
                                }
                            )
                    }
                }
            )
            volumes                  = @(
                @{
                    name   = "mount1"
                    secret = @{
                        parameters = "eAA=" # just the string 'x' as base64
                    }
                },
                @{
                    name   = "mount2"
                    secret = @{
                        parameters = "eAA=" # just the string 'x' as base64
                    }
                }
            )
            restartPolicy            = "Never"
            imageRegistryCredentials = @(
                @{
                    server   = $ContainerRegistryServer
                    username = $spCreds.username
                    password = $spCreds.password
                }
            )
        } 
    } | ConvertTo-Json -Depth 99)
@yangl900
Copy link

Thanks for reporting! ACK the issue. There is a validation missing from the REST api. We plan to get this fixed by Dec 7th.

@OliverWill
Copy link

OliverWill commented Apr 11, 2019

Adding to this: If - by accident - you set a mount path that is not absolute, e.g. "mymount" instead of "/mymount" the deployment is pending for half an hour and then fails. It should be checked that mount path has to be absolute.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants