Question

I'd like to add an empty data disk to a virtual drive under a new storage location. When I have the virtual machine select and click Add -> Empty Data Disk I'm not able to change the storage location. Does anyone know how to change the default storage location when adding an empty disk? Thanks

UPDATE

I believe this is the command that needs to be run. But running it on the vm doesn't do anything.

Get-AzureVM "service" -Name "vmname" `| Add-AzureDataDisk -CreateNew -DiskSizeInGB 1000 -DiskLabel "sqlsa1" -MediaLocation "http://mystoragelocation.blob.core.windows.net/" -LUN 4 '| Update-AzureVM
Était-ce utile?

La solution

I haven't tried this yet, but I believe you can add a new empty data disk via PowerShell, and specify the location in blob storage. Check out the Add-AzureDataDisk cmdlet and the -MediaLocation parameter.

Autres conseils

I hit this issue and was able to finally resolve it. I just wanted to share what I've done so far in case it is helpful.

To start with I had to create the .vhd on my computer. If you open "Disk Management" (Start -> Run -> mmc then choose File -> Add Snap In). In Disk Management from the "More Options" menu you can create a new .vhd. Make sure to use a fixed size disk. Azure won't let you use the expanding disk size (I'm pretty sure you only get charged for what you use, not the full size of the fixed disk). Use Disk Management to Initialize and make it a Simple volume (which formats the disk).

Next I had to upload it to my storage account. To start with, make sure your storage account has at least 1 container. You can set this up in the Azure console (manage.windowsazure.com). The file must be uploaded as a Page Blob.

Next I used a free tool AzCopy (http://blogs.msdn.com/b/windowsazurestorage/archive/2013/04/01/azcopy-using-cross-account-copy-blob.aspx). You'll need the URL and key for your storage container. You can get to both in the Azure console by going to the Storage menu item then selecting your storage, then clicking Manage Keys.

The tool is a command line tool and my command line looked like this:

c:\Users\jim\Desktop\AzCopy>AzCopy.exe c:\users\jim\desktop\main https://[storage url]/[container name] /destkey:[secret key] /blobtype:page /V /S

In that example my .vhd file was the only file in the desktop\main folder.

I'm not sure if that is all you needed, but I'll give the remainder of the steps I followed to make it visible in my virtual machine.

Next I went back into the Azure management console. I clicked on the Virtual Machines menu item, then chose Disks along the top menu. I then clicked Create and was able to add a disk by browsing to it in the container in my Storage. Then you should be able to go to the Dashboard of your Virtual Machine to attach it.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top