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

Julian Steven Molina Campos 40 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,925 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.
363 questions
{count} votes

2 answers

Sort by: Most helpful
  1. hossein jalilian 5,475 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


  2. Iheanacho Chukwu 165 Reputation points
    2024-07-19T18:56:41.7633333+00:00

    Hello @Julian Steven Molina Campos

    To register your subscription to use the ephemeral disks feature, you need to enable the 'Microsoft.Compute/AdditionalStorageTypesForEphemeralOSDiskPreview' feature as shown in your error message. However, you need to have the Azure role, Microsoft.Features/register/action, as a pre-requisite to enable a feature. If you are an owner or contributor, you will have a enough privilege, if not you will need someone within your subscription who has this roles to help you.

    The feature can be enabled using the az cli command below:

    az provider register --namespace "Microsoft.Compute"
    az feature registration create --namespace "Microsoft.Compute" --name "AdditionalStorageTypesForEphemeralOSDiskPreview"
    

    After the registration is completed allow sometime, for the process to complete, as it could take awhile for feature to be enabled.

    You can check the registration status with the command below:

    az feature registration show --namespace "Microsoft.Compute" --name "AdditionalStorageTypesForEphemeralOSDiskPreview"
    

    For more information on this, you can review the az feature registration documentation.

    If you experience any issues, kindly raise a support request to the Azure Support team to help you with this.

    0 comments No comments