locked
Azure Storage - How to tell what vhd is attached to what? RRS feed

  • Question

  • On our storage account in our vhd container we have vhd blobs. The issue is that it looks like some where renamed from what I manually named to them to some incomprehensible name. I'm not sure when this took place but sometime in the last month. So I now have no idea what base OS vhd goes where.

    1. How can tell which vhd is attached to which VM?
    2. How do I rename these VHD's without taking down the server?
    3. How can I find out which ones are not being used? It looks like 2 vhd's (30GB) haven't been modified for a month but how do I actually know they are not being attached to anything and being used? (Note: we only have vhd's no other blobs.)
    4. How do I get Azure to stop renaming the blobs to some meaningless name?

    Thanks,

    Chris

    • Edited by Thames4123 Thursday, December 19, 2013 3:47 PM formatting
    Thursday, December 19, 2013 3:46 PM

Answers

  • HI

    The best way is manage Azure disk ranther then manage the VHD directly.

    You can refer to this blog first:

    http://blogs.msdn.com/b/windowsazurestorage/archive/2012/06/28/exploring-windows-azure-drives-disks-and-images.aspx

    Then manage the disk in your Azure protal->Virtual Machin->DISK

    When you delete the disk, you can choose to retain a VHD or not.


    Please mark post as answered if it helped!

    Friday, December 20, 2013 3:28 AM
  • How can tell which vhd is attached to which VM?

    Since a VHD is essentially a page blob and is stored as a disk (OS disk or Data disk), you can list all disks and the result will include the URL of the blob. If you're using Windows Azure PowerShell Cmdlets, you can find this information by executing Get-AzureDisk cmdlet. Also see this link for more details: http://msdn.microsoft.com/en-us/library/windowsazure/jj157176.aspx

    How do I rename these VHD's without taking down the server?

    I don't think you can do that. Again because these VHDs are page blobs and blob storage do not support "Rename" operation natively, you would need to copy the VHD first and once the copy is complete, you can delete the original one.

    How can I find out which ones are not being used? It looks like 2 vhd's (30GB) haven't been modified for a month but how do I actually know they are not being attached to anything and being used? (Note: we only have vhd's no other blobs.)

    When a VHD is attached to a VM, Windows Azure puts a lock (lease) on the blob holding the VHD. Easiest way for you to check is by listing the blobs in that container and find out which blob has active lease on it. Other way obviously is to get all disks and get the URLs and comparing them with all blobs in that container.

    How do I get Azure to stop renaming the blobs to some meaningless name?

    Not sure what you mean. Could you please explain?

    Hope this helps.

    Saturday, December 21, 2013 6:31 AM

All replies

  • HI

    The best way is manage Azure disk ranther then manage the VHD directly.

    You can refer to this blog first:

    http://blogs.msdn.com/b/windowsazurestorage/archive/2012/06/28/exploring-windows-azure-drives-disks-and-images.aspx

    Then manage the disk in your Azure protal->Virtual Machin->DISK

    When you delete the disk, you can choose to retain a VHD or not.


    Please mark post as answered if it helped!

    Friday, December 20, 2013 3:28 AM
  • How can tell which vhd is attached to which VM?

    Since a VHD is essentially a page blob and is stored as a disk (OS disk or Data disk), you can list all disks and the result will include the URL of the blob. If you're using Windows Azure PowerShell Cmdlets, you can find this information by executing Get-AzureDisk cmdlet. Also see this link for more details: http://msdn.microsoft.com/en-us/library/windowsazure/jj157176.aspx

    How do I rename these VHD's without taking down the server?

    I don't think you can do that. Again because these VHDs are page blobs and blob storage do not support "Rename" operation natively, you would need to copy the VHD first and once the copy is complete, you can delete the original one.

    How can I find out which ones are not being used? It looks like 2 vhd's (30GB) haven't been modified for a month but how do I actually know they are not being attached to anything and being used? (Note: we only have vhd's no other blobs.)

    When a VHD is attached to a VM, Windows Azure puts a lock (lease) on the blob holding the VHD. Easiest way for you to check is by listing the blobs in that container and find out which blob has active lease on it. Other way obviously is to get all disks and get the URLs and comparing them with all blobs in that container.

    How do I get Azure to stop renaming the blobs to some meaningless name?

    Not sure what you mean. Could you please explain?

    Hope this helps.

    Saturday, December 21, 2013 6:31 AM