I am tying to create a page blob using the storage API and add it as a disk to the Virtual Machine. Is there a way this can be done ? Currently when I create a blob and add it as the disk , the VM fails with provisioning state failed.
-
Which type of your VM? Linux or Windows? – Peter Pan Feb 06 '17 at 09:34
-
Im trying to create a linux VM. – nwarriorch Feb 06 '17 at 21:25
1 Answers
It sounds like you want to create a data disk using Azure Storage SDK for Java to attach page blob as data disk for Linux VM. However, some concepts you understanded are note accurate.
Firstly, you need to create a VHD file on local environment. As references, you can try to follow the below documents to do it.
- On Windows, please refer to the document Create and Use a Virtual Hard Disk on Windows 7 to create a VHD file.
- On Linux or MacOS, you can install & configure QEMU/VirtualBox/KVM to create a disk image and convert it. For example, to convert a qemu image via command
qemu-image convert
.
For more information, please see About disks and VHDs for Azure virtual machines
Secondly, you upload the VHD file created to Azure Blob Storage as a page blob via AzCopy or follow the related section of the tutorial Creating and Uploading a Virtual Hard Disk that Contains the Linux Operating System.
Then, you can refer to the document Add a disk to a Linux VM to attach the data disk on Azure Storage.
Meanwhile, based on my understanding, I think you just want to extend the filesystem of your Linux VM. So the other solution may be suitable for your needs, which mount Azure File Storage on Linux VMs using SMB protocol. More details, please refer to How to use Azure File Storage with Linux.
Hope it helps. Any concern, please feel free to let me know.
-
Hey Thanks for the response , samba protocol doesnt really work for us. We need to attach it as a VM disk. – nwarriorch Feb 27 '17 at 17:27