SMB volume creation using terraform

KrishnaveniAnumala-7706 20 Reputation points
2025-05-21T15:07:38.58+00:00

Hello,

We are trying to migrate the shares from onprem to azure

1.Can we create SMB volume using terraform code? if yes, please provide the sample code to provision

Regards,

Krishnaveni A

Azure NetApp Files
Azure NetApp Files

An Azure service that provides enterprise-grade file shares powered by NetApp.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    1 deleted comment

    Comments have been turned off. Learn more

  2. Vinod Kumar Reddy Chilupuri 4,190 Reputation points Microsoft External Staff Moderator
    2025-05-21T15:51:26.9866667+00:00

    Hi Krishnaveni Anumala,

    Migrating your Powermax and Isilon shares to Azure, specifically focusing on creating SMB volumes using Terraform.

    1. Creating SMB Volumes with Terraform: While the official Azure documentation doesn't provide a direct Terraform example for creating SMB volumes on Azure NetApp Files, you can accomplish this by using the Azure Provider for Terraform. You’ll generally utilize resources like azurerm_netapp_volume in your Terraform code. Here’s a basic template.
         provider "azurerm" {
         features {}
         }
         resource "azurerm_netapp_account" "example" {
         name                = "example-account"
         resource_group_name = azurerm_resource_group.example.name
         location           = azurerm_resource_group.example.location
         sku {
         name = "Standard"
         }
         }
         resource "azurerm_netapp_pool" "example" {
         name                = "example-pool"
         netapp_account_name = azurerm_netapp_account.example.name
         resource_group_name = azurerm_resource_group.example.name
         location           = azurerm_resource_group.example.location
         service_level      = "Standard"
         size               = 4398046511104 # Size in bytes
         }
         resource "azurerm_netapp_volume" "example" {
         name                  = "example-volume"
         netapp_account_name   = azurerm_netapp_account.example.name
         netapp_pool_name      = azurerm_netapp_pool.example.name
         resource_group_name   = azurerm_resource_group.example.name
         location              = azurerm_resource_group.example.location
         subnet_id             = azurerm_subnet.example.id
         service_level         = "Standard"
         usage_threshold       = 10000000000 # Size in bytes
         volume_type           = "SMB"
         }
         
      
      Make sure to tweak the parameters to match your requirements.
    2. Azure RM Provider Support: Yes, the Azure Resource Manager (ARM) provider for Terraform does support the creation of SMB volumes via the Azure NetApp Files. You'll find the necessary support in the Azure RM provider documentation.
    3. Alternative Methods: If you run into issues with Terraform or need an alternative, you can create SMB volumes directly through the Azure Portal or using Azure CLI.
    • Create an SMB volume using the Azure Portal:
      Go to the Azure NetApp Files resource.
      Choose the capacity pool where you want to provision the volume.
      Click on “Add volume” and fill out the necessary fields like volume name, quota, etc.Using
    • Azure CLI.
    az netappfiles volume create --resource-group example-rg \
      --account-name example-account \
      --pool-name example-pool \
      --name example-volume \
      --location eastus \
      --service-level Standard \
      --usage-threshold 100 \
      --protocol-types SMB \
      --subnet-id example-subnet-id
    

    Create an SMB volume for Azure NetApp Files

    Configure Azure Files using Terraform

    Hope the above suggestion helps! Please let us know do you have any further queries.

    Please do consider to “Accept the answer” wherever the information provided helps you, this can be beneficial to other community members.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.