none
Azure Resource Manager (ARM) - listing and removing data disks

    Question

  • I am using Resource Manager to allocated VMs and OS disks and Data Disks.

    I have deleted a VM using the portal. This VM had an OS Disk and a Data Disk allocated.

    1) How can I get a list of (Data) disks associated with my Resource Group?

    2) There does not seem to be a Remove-AzureRmVMDataDisk PowerShell command. How can I remove old Data Disks?

    3) When deleting the VM it is unclear whether the OSDisk is automatically removed or not. Is it?

    4) Is the Data disk deleted when the VM is deleted?

    Thank you


    Marcel

    Tuesday, February 9, 2016 9:29 PM

Answers

  • Hi Marcel,

    1. Only the "management plane" Azure Storage PowerShell cmdlets would be impacted by the ARM version of cmdlets, like trying to create a storage account. Anything having to do with "the data plane", that's the actual data stored in the storage account like blobs, containers, queues, tables and files,has not changed. So, the original cmdlets should work just fine, regardless of whether the storage account is classic or ARM. You could try Get-AzureDisk to get the information about the disks stored in the Azure disk repository for the current subscription.
    2. There is Remove-AzureRmVMDataDisk cmdlet, you might have to check the version of PowerShell you are using and update your PowerShell to the Latest version.
    3. The OS Disk for a VM would not be automatically removed on deleting a VM, unless you choose the option Delete the attached Disks when deleting the VM. Also, please be advised that It's not possible to detach an operating system disk, unlike the data disk, unless you also delete the virtual machine.
    4. Deleting the Data disk when deleting the VM is a choice. You could refer this link for a better understanding: https://azure.microsoft.com/en-in/documentation/articles/storage-windows-detach-disk/

    Regards,
    Malar.

    Wednesday, February 10, 2016 6:38 AM

All replies

  • Hi Marcel,

    1. Only the "management plane" Azure Storage PowerShell cmdlets would be impacted by the ARM version of cmdlets, like trying to create a storage account. Anything having to do with "the data plane", that's the actual data stored in the storage account like blobs, containers, queues, tables and files,has not changed. So, the original cmdlets should work just fine, regardless of whether the storage account is classic or ARM. You could try Get-AzureDisk to get the information about the disks stored in the Azure disk repository for the current subscription.
    2. There is Remove-AzureRmVMDataDisk cmdlet, you might have to check the version of PowerShell you are using and update your PowerShell to the Latest version.
    3. The OS Disk for a VM would not be automatically removed on deleting a VM, unless you choose the option Delete the attached Disks when deleting the VM. Also, please be advised that It's not possible to detach an operating system disk, unlike the data disk, unless you also delete the virtual machine.
    4. Deleting the Data disk when deleting the VM is a choice. You could refer this link for a better understanding: https://azure.microsoft.com/en-in/documentation/articles/storage-windows-detach-disk/

    Regards,
    Malar.

    Wednesday, February 10, 2016 6:38 AM
  • Hello Nagamalar

    Thank you for answering my questions. Is there a way to remove the OS Disks if the VM has been deleted? They discuss a lease and I am confused.

    Thank you


    Marcel

    Wednesday, February 10, 2016 3:13 PM
  • Hello Malar,

    The article you cite does not work for disks created using Resource Manager (not classic VMs). The disks are not shown in the Virtual Machines 'Disks' list. I have reused the data disk, but still need to remove the old OS disks.

    Further, Get-AzureDisk only returns disks that were created using Service Manager (classic). There is no Get-AzureRmDisk or Get-AzureRmVMDisk. A similar situation for  Remove-AzureDisk - it does not find the (resource manager) disks Remove-AzureRmDisk or Remove-AzureRmVmDisk  does not exist. For Data disks, Remove-AzureRmVMDataDisk needs a VM.

    I have the latest Azure PowerShell Module from https://github.com/Azure/azure-powershell/releases (1.2.1). (installed and rebooted to make sure).

    Frustrated.


    Marcel

    Thursday, February 11, 2016 9:52 PM