Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Remove-AzureDataDisk

Remove-AzureDataDisk

microsoft.windowsazure.commands.servicemanagement.dll

Synopsis

Removes a data disk from a virtual machine object.

Syntax

Remove-AzureDataDisk [-LUN] [-DeleteVHD] [-VM] [<CommonParameters>]

Detailed Description

The Remove-AzureDataDisk cmdlet detaches a data disk from a virtual machine. The data disk blob is not removed from the storage account.

Parameters

-LUN <Int32>

Specifies the slot where the data disk to be detached is currently mounted.

Aliases

None

Required?

true

Position

0

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-DeleteVHD <SwitchParameter>

Specify to remove the data disk and the underlying disk blob.

Aliases

None

Required?

false

Position

1

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-VM <IPersistentVM>

Specifies the slot where the data disk to be detached is currently mounted.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

true (ByValue, ByPropertyName)

Accept wildcard characters?

false

Input Type


Return Type


Notes

Examples

-------------------------- EXAMPLE 1 --------------------------

Description

PS C:\> Get-AzureVM -ServiceName MyDemoService01 -Name MyDemoVM01 | Remove-AzureDataDisk -LUN 0

-------------------------- EXAMPLE 2 --------------------------

Description

PS C:\> Get-AzureVM -ServiceName MyDemoService01 -Name MyDemoVM01 | Remove-AzureDataDisk -LUN 0 -DeleteVHD | Update-AzureVM

This command gets the virtual machine object with the name "MyDemoVM01" running on the "MyDemoService01" cloud service, then detaches the data disk at LUN 0 from virtual machine object. It also updates the VM in the cloud and then delete the underlying VHD(s).

Add-AzureDataDisk
Set-AzureDataDisk