How to deploy Azure Netapp Files (NFS and SMB) for testing

This post has been republished via RSS; it originally appeared at: Azure Global articles.

 

Introduction

 

The Azure Netapp Files service has become very popular storage solution, satisfying the I/O requirements for many customer workloads (e.g. Oil and Gas, Manufacturing and Financial). Procedures for deploying Azure Netapp Files using the NFS and SMB protocols and accessing it from a Linux client and Windows client respectively will be discussed. The AzureCAT HPC azurehpc and Azure azure-quickstart-templates repositories will be used for the deployment.

 

Procedure to deploy Azure Netapp Files using the NFS protocol

 

  1. Use the azurehpc repository to deploy the network, Linux client, Windows client, ANF account, ANF pool and ANF volume (NFS). First get the azurehpc repository.

    1.       git clone git@github.com:Azure/azurehpc.git
    2.  Create a config.json file for the deployment. The config.json deploys a Linux client and windows client. ANF/NFS is mounted on the Linux client (See the appendix for the complete config.json file.)
    1.  Deploy infrastructure (Make sure you are in the same directory as your config.json)
      1.  azure-build
  1.  Log-in to Linux headnode

    1.  azhpc-connect headnode
  2.  Check that anf is mount correctly

    1.  df -h
      Filesystem Size Used Avail Use% Mounted on
      /dev/sda2 30G 4.4G 26G 15% /
      devtmpfs 32G 0 32G 0% /dev
      tmpfs 32G 0 32G 0% /dev/shm
      tmpfs 32G 9.1M 32G 1% /run
      tmpfs 32G 0 32G 0% /sys/fs/cgroup
      /dev/sda1 497M 65M 433M 13% /boot
      /dev/sdb1 126G 61M 120G 1% /mnt/resource
      10.2.3.4:/anfvol1 100T 256K 100T 1% /netapps
      tmpfs 6.3G 0 6.3G 0% /run/user/1000

 

Procedure to deploy Azure Netapp Files using the SMB protocol

 

  1.  Deploy an Active directory server using active-directory-new-domain from the azure-quickstart-templates.
    1.  First get the repository and go to the active-directory-new-domain directory
      1.  git clone git@github.com:Azure/azure-quickstart-templates.git
    2.  Edit azuredeploy.json to allow it to be deployed via az cli and use the existing azurehpc infrastructure. The detailed edits are documented in the appendix.
    3.  Edit azuredeploy.parameters.json
      1.  {
        "$schema": "https://schema.management.azure.com/schemas/2015-01-01/
        deploymentParameters.json#",
        "contentVersion": "1.0.0.0",
        "parameters": {
        "adminUsername": {
        "value": "hpcadmin"
        },
        "adminPassword": {
        "value": "hpcadmin.123"
        },
        "domainName": {
        "value": "anf.local"
        },
        "dnsPrefix": {
        "value": "anf"
        }
        }
        }
    4.  Deploy AD server, note: deploy AD in its own resource group.

      1.  az group deployment create -g anf-smb-ad-wus2 --template-file 
        azuredeploy.json --parameters @azuredeploy.parameters.json
    5.  Using the ANF pools, create ANF volume using the SMB protocol, set volume size and SMB share name.
    6.  Log-in to windows client using the user/password defined in the azurehpc deployment.
    7.  Change Windows client DNS server (set it to the private IP of the AD server)
      1.  First find the Interfaceindex
        1.  PS C:\Users\azureuser> Get-NetIPConfiguration
          InterfaceAlias : Ethernet
          InterfaceIndex : 6
          InterfaceDescription : Microsoft Hyper-V Network Adapter
          NetProfile.Name : Network
          IPv4Address : 10.2.4.5
          IPv6DefaultGateway :
          IPv4DefaultGateway : 10.2.4.1
          DNSServer : 168.63.129.16
        2.  Change DNS server
          1.  Set-DnsClientServerAddress -InterfaceIndex 6 -ServerAddresses 10.2.1.4
        3.  Check the DNS server is working.
          1.  PS C:\Users\hpcadmin> nslookup anf.local
            Server: UnKnown
            Address: 10.2.1.4

            DNS request timed out.
            timeout was 2 seconds.
            DNS request timed out.
            timeout was 2 seconds.
            Name: anf.local
            Address: 10.2.1.4

    8.  Join the Windows client to AD (you will be prompted for a password)
      1.  PS C:\Users\azureuser> Add-Computer -DomainName anf.local -Credential anf\hpcadmin
      2. Restart the Windows client.

    9.  Map network drive, go to the Azure portal to the ANF SMB volume you created and take note of the SMB mounting instructions (e.g \\testing-2e7d.anf.local\anfvol2). 
      1.  File explorer --> network --> map network drive
      2.  Specify drive (e.g Z:) and file share location (e.g \\testing-2e7d.anf.local\anfvol2)

    10.  Check that the ANF/SMB file share is mounted and available on the Windows client.
      1.  Click on "This PC", should see the mounted ANF/SMB drive, click on properties to see more details about the file share.

 

Testing Azure Netapp Files

The azurehpc repository contains scripts for running IOR and FIO throughput and IOPS storage benchmarks, see azurehpc/apps/ior and azurehpc/apps/fio.

 

 

Appendix

 

Azurehpc config.json file used to deploy, ANF/NFS, headnode and Windows client.

 


{
"location": "variables.location",
"resource_group": "variables.resource_group",
"install_from": "headnode",
"admin_user": "hpcadmin",
"variables": {
"hpc_image": "OpenLogic:CentOS-HPC:7.6:latest",
"win_image": "MicrosoftWindowsDesktop:Windows-10:rs5-pron:latest",
"win_password": "",
"location": "",
"resource_group": "",
"vm_type": "Standard_D16s_v3",
"win_vm_type": "Standard_D16s_v3",
"vnet_resource_group": "variables.resource_group"
},
"vnet": {
"resource_group": "variables.vnet_resource_group",
"name": "hpcvnet",
"address_prefix": "10.2.0.0/20",
"subnets": {
"admin": "10.2.1.0/24",
"viz": "10.2.2.0/24",
"storage": "10.2.3.0/24",
"compute": "10.2.4.0/22"
}
},
"storage": {
"hpcnetapp": {
"type": "anf",
"subnet": "storage",
"pools": {
"anfpool" : {
"size": 8,
"service_level": "Premium",
"volumes": {
"anfvol1" : {
"size": 4,
"mount": "/netapps"
} } }} } },
"resources": {
"headnode": {
"type": "vm",
"vm_type": "variables.vm_type",
"public_ip": true,
"image": "variables.hpc_image",
"accelerated_networking": true,
"subnet": "compute",
"tags": [
"cndefault",
"nfsserver",
"loginnode",
"localuser",
"disable-selinux",
"mount-anfpool"
]
},
"winnode": {
"type": "vm",
"vm_type": "variables.win_vm_type",
"accelerated_networking": true,
"password": "variables.win_password",
"public_ip": true,
"image": "variables.win_image",
"subnet": "compute",
"tags": [
]
}
},
"install": [
{
"script": "disable-selinux.sh",
"tag": "disable-selinux",
"sudo": true
},
{
"script": "cndefault.sh",
"tag": "cndefault",
"sudo": true
},
{
"script": "nfsserver.sh",
"tag": "nfsserver",
"sudo": true
},
{
"script": "auto_netappfiles_mount_anfpool.sh",
"tag": "mount-anfpool",
"sudo": true
},
{
"script": "nfsclient.sh",
"args": [
"$(<hostlists/tags/nfsserver)"
],
"tag": "nfsclient", "sudo": true
},
{
"script": "localuser.sh",
"args": [
"$(<hostlists/tags/nfsserver)"
],
"tag": "localuser",
"sudo": true
}
]
}

 

Edits required to the active-directory-new-domain azuredeploy.json arm template to allow it to use the azurehpc deployed infrastructure

 

  1. Set the AD subnet address range, use admin subnet address range that was used in the azurehpc deployment.
    1. "adSubnetName": "admin",
      "adSubnetAddressPrefix": "10.2.1.0/24"
  2. Change virtualNetworkName, use same vnet deployed by azurehpc
    1. "virtualNetworkName": "hpcvnet",
  3. Change virtualNetworkAddressRange, use same address range that was deployed by azurehpc.
    1. "virtualNetworkAddressRange": "10.2.0.0/20",
  4. Set IP for AD server (pick any unused IP from the admin subnet)

    1. "adNicIPAddress": "10.2.1.4",
  5. Set vnetRg, to be the resource group containing the vnet.

    1. "vnetRg": ""
  6. Set location of raw git files.

    1. "_artifactsLocation": {
      "type": "string",
      "metadata": {
      "description": "The location of resources, such as templates and
      DSC modules, that the template depends on"
      },
      "defaultValue": "https://raw.githubusercontent.com/Azure/
      azure-quickstart-templates/master/active-directory-new-domain"
  7. Modify templateLink locations for files.

    1. "templateLink": {
      "uri": "[concat(parameters('_artifactsLocation'), '/nestedtemplates/vnet.json',
      parameters('_artifactsLocationSasToken'))]",
      "templateLink":
      {"uri": "[concat(parameters('_artifactsLocation'), '/nestedtemplates/vnet-with-dns-server.json',
      parameters('_artifactsLocationSasToken'))]",
  8. Remove deployment of VNet, will use azurehpc vnet instead. Also remove all references to VNet.

  9. Modify path to CreateADPDC.zip

    1. "ModulesUrl": "[concat(parameters('_artifactsLocation'), '/DSC/CreateADPDC..zip', 
      parameters('_artifactsLocationSasToken'))]",

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.