azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

Cannot mount path on ACI from az container create

Open xavis opened this issue 2 years ago • 5 comments

Describe the bug

Currently I'm running the following command:

az container create --resource-group $containers_resource_group \ --name $container_name \ --image $image_name \ --registry-login-server $acr_name.azurecr.io \ --registry-username $acr_name \ --registry-password $acr_password \ --cpu $container_cpu \ --dns-name-label $container_name-$container_count \ --memory $container_memory \ --ports 80 \ --protocol TCP \ --restart-policy Never \ --os-type Linux \ --azure-file-volume-account-name $STORAGE_NAME \ --azure-file-volume-account-key $STORAGE_KEY \ --azure-file-volume-share-name $STORAGE_FILE_SHARE \ --azure-file-volume-mount-path $PATHTOMOUNT

I created a file share in my storage account and I want to mount it in /files, so PATHTOMOUNT="/files"

But I am not able to do that I always receive the error:

The volume mount path cannot contain ':'

If I remove the root slash PATHTOMOUNT="files" It works but I need to mount the files in my desired folder.

Related command

az container create --resource-group $containers_resource_group
--name $container_name
--image $image_name
--registry-login-server $acr_name.azurecr.io
--registry-username $acr_name
--registry-password $acr_password
--cpu $container_cpu
--dns-name-label $container_name-$container_count
--memory $container_memory
--ports 80
--protocol TCP
--restart-policy Never
--os-type Linux
--azure-file-volume-account-name $STORAGE_NAME
--azure-file-volume-account-key $STORAGE_KEY
--azure-file-volume-share-name $STORAGE_FILE_SHARE
--azure-file-volume-mount-path $PATHTOMOUNT

Errors

The volume mount path cannot contain ':'

Issue script & Debug output

DEBUG: cli.azure.cli.core.azclierror: Traceback (most recent call last): File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 651, in execute File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/invocation.py", line 113, in _validation File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 859, in _validate_arg_level File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/container/_validators.py", line 18, in validate_volume_mount_path knack.util.CLIError: The volume mount path cannot contain ':'

ERROR: cli.azure.cli.core.azclierror: The volume mount path cannot contain ':' ERROR: az_command_data_logger: The volume mount path cannot contain ':' DEBUG: cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x03A4C808>] INFO: az_command_data_logger: exit code: 1 INFO: cli.main: Command ran in 1.285 seconds (init: 0.346, invoke: 0.939) INFO: telemetry.main: Begin splitting cli events and extra events, total events: 1 INFO: telemetry.client: Accumulated 0 events. Flush the clients. INFO: telemetry.main: Finish splitting cli events and extra events, cli events: 1 INFO: telemetry.save: Save telemetry record of length 3691 in cache WARNING: telemetry.check: Negative: The C:\Users\javier.sanchez.azure\telemetry.txt was modified at 2023-06-02 14:44:41.854090, which in less than 600.000000 s

Expected behavior

It should be able to mount my file share in that directory regarding to docs.

Environment Summary

azure-cli 2.49.0

core 2.49.0 telemetry 1.0.8

Extensions: aks-preview 0.5.131

Dependencies: msal 1.20.0 azure-mgmt-resource 22.0.0

Additional context

No response

xavis avatar Jun 02 '23 13:06 xavis

Thank you for opening this issue, we will look into it.

yonzhan avatar Jun 02 '23 13:06 yonzhan

Any update on this?

I am seeing it with: --azure-file-volume-mount-path /mnt/share

Environment: azure-cli 2.53.0

core 2.53.0 telemetry 1.1.0

Dependencies: msal 1.24.0b2 azure-mgmt-resource 23.1.0b2

kfaubel avatar Oct 16 '23 10:10 kfaubel

I am facing the same issue. Any updates on this?

Ulipenitz avatar Jan 01 '24 13:01 Ulipenitz

Same here as earlier comments 🤔

elglogins avatar Jan 22 '24 23:01 elglogins

I got this exact error when running az cli on windows. However, I could make a workaround by installing and running az cli in an Ubuntu WSL2 installation.

niklashallenfur avatar Mar 01 '24 10:03 niklashallenfur