Add-AzureRmVmDataDisk : It requires disk size argument to attach existing disk.
I'm trying to attach the existing disk to the virtual machine by Add-AzureRmVmDataDisk command. It's always require data size arguments (DataSizeInGB). Does it require to attach existing disk? It takes a lot of effort to retrieve storage size and calculate.
Thanks.
@m-moris
You could pass a $null value to this parameter to indicate no change on the data disk.
+@hyonholee FYI.
@huangpf
Thank you for your reply. I tried passing the null argument, and it was successfully attached.
This way is easy to attach disk. however, JSON response of ARM API will not include "diskSizeGB" in dataDisks key.
I'd like to get data disk size easily from VM. I think this way is unuseful to me.
Thanks.
I think we need 3 parameter sets here. One for each of empty, attach and fromImage and make the diskSizeInGB property required or optional accordingly. @hyonholee Can you investigate?
Please update command or documentation for this issue with an example.