azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Add-AzureRmVmDataDisk : It requires disk size argument to attach existing disk.

Open m-moris opened this issue 10 years ago • 4 comments

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 avatar Dec 04 '15 01:12 m-moris

@m-moris You could pass a $null value to this parameter to indicate no change on the data disk.

+@hyonholee FYI.

huangpf avatar Dec 11 '15 19:12 huangpf

@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.

m-moris avatar Dec 15 '15 14:12 m-moris

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?

singhkays avatar Dec 29 '15 20:12 singhkays

Please update command or documentation for this issue with an example.

abhishekanand avatar Aug 26 '16 18:08 abhishekanand