title: Expand Azure Virtual Machine Scale set (VMSS) data disks
body: <p>I have a VM with 2 virtual machine scale set. There's a requirement to expand the datadisk. I have successfully expanded the VM's datadisk (attached disk). After which I am trying to expand the size of scale set 
  data disks but with failure. </p>
  
  <p>This is what I have done to expand the VM attached disk:</p>
  
  <pre><code>az disk update --resource-group e4s --name e4s-vm-0_disk2_a3d99285cfbc4f0987c8a9c8e4c1f7ef --size-gb 130
  </code></pre>
  
  <p>ssh to the instance and executed:</p>
  
  <pre><code>sudo mdadm --assemble --update=devicesize /dev/md0 /dev/sdc
  sudo mount /dev/md0 /mnt/data
  sudo xfs_growfs /mnt/data
  </code></pre>
  
  <p>After which <code>df -h</code> had shown the expanded size correctly.</p>
  
  <p>For the VMSS, this is what I have done:</p>
  
  <pre><code>az vmss update -n e4s-ss -g e4s --set virtualMachineProfile.storageProfile.dataDisks[0].diskSizeGb=130
  </code></pre>
  
  <p>Checked the scale set model:</p>
  
  <pre><code>az disk update --resource-group e4s -n e4s-vm-0_disk2_a3d99285cfbc4f0987c8a9c8e4c1f8ef --size-gb 130
  
  [
    {
      "caching": "None",
      "createOption": "empty",
      "diskSizeGb": 130,
      "lun": 0,
      "managedDisk": {
        "storageAccountType": "Premium_LRS"
      },
      "name": null
    }
  ]
  </code></pre>
  
  <p>In portal also it's showing the size as 130
  <a href="https://i.stack.imgur.com/JnjrX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JnjrX.png" alt="enter image description here"></a>
  Updated the sc</p>
  
  <p>Since the upgrade policy is manual so updated it:</p>
  
  <pre><code>az vmss update-instances -n e4s-ss -g e4s --instance-ids 1
  az vmss update-instances -n e4s-ss -g e4s --instance-ids 2
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/w1aH0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w1aH0.png" alt="enter image description here"></a></p>
  
  <p>After ssh connection to one of the vmss executed the same commands which were executed after expanding the VM disk. But the newly expanded size is not being displayed.</p>