How can I enable the use of osDisk.managedDisk.storageAccountType in my Azure subscription ?

Julian Steven Molina Campos 20 Reputation points
2024-07-03T19:54:44.8+00:00

I am trying to use spot instances with ephemeral disks to save costs within a VMSS, but when I run this command:

az vmss create \
  --name vmssagentspool \
  --resource-group Lenguage_VirtualAgents \
  --image Ubuntu2204 \
  --vm-sku Standard_E2as_v4 \
  --storage-sku StandardSSD_LRS \
  --authentication-type SSH \
  --generate-ssh-keys \
  --instance-count 1 \
  --disable-overprovision \
  --upgrade-policy-mode manual \
  --single-placement-group false \
  --platform-fault-domain-count 1 \
  --load-balancer "" \
  --orchestration-mode Uniform \
  --priority Spot \
  --eviction-policy Delete \
  --max-price 0.02 \
  --ephemeral-os-disk
  

I get the following error:

{"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX/resourceGroups/XXXXXXXXX/providers/Microsoft.Resources/deployments/vmss_deploy_XXXXXXXXX","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"BadRequest","message":"'osDisk.managedDisk.storageAccountType' is not enabled for the Subscription. Please register the Subscription for 'Microsoft.Compute/AdditionalStorageTypesForEphemeralOSDiskPreview' to use the feature."}]}}

I don't understand how I can register my subscription to use the ephemeral disks feature.

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,873 questions
Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets
Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.
361 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. hossein jalilian 4,770 Reputation points
    2024-07-03T22:02:18.1566667+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    To enable the use of osDisk.managedDisk.storageAccountType with ephemeral disks in Azure, you need to register your subscription for the feature. Here’s how you can do it:

    • Use the Azure CLI to register your subscription for the preview feature. Run the following command:
        az feature register --namespace Microsoft.Compute --name AdditionalStorageTypesForEphemeralOSDiskPreview
        
      
    • After registering, you can check the registration status using:
        az feature show --namespace Microsoft.Compute --name AdditionalStorageTypesForEphemeralOSDiskPreview
        
      
    • If needed, you might have to refresh the registration provider:
        az provider register --namespace Microsoft.Compute
        
      

    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful