Remove-​Azure​Rm​Vmss​Data​Disk

Removes a data disk from the VMSS.

Syntax

Remove-AzureRmVmssDataDisk
      [-VirtualMachineScaleSet] <VirtualMachineScaleSet>
      [-Lun] <Int32>
      [-Confirm]
      [-WhatIf]
      [<CommonParameters>]
Remove-AzureRmVmssDataDisk
      [-VirtualMachineScaleSet] <VirtualMachineScaleSet>
      [-Name] <String>
      [-Confirm]
      [-WhatIf]
      [<CommonParameters>]

Description

The Remove-AzureRmVmssDataDisk cmdlet removes a data disk from the Virtual Machine Scale Set (VMSS) instance.

Examples

Example 1

PS C:\> Remove-AzureRmVmssDataDisk -VirtualMachineScaleSet $vmss -Name 'DataDisk1'

This command removes the data disk named 'DataDisk1' from the VMSS object.

Example 2

PS C:\> Remove-AzureRmVmssDataDisk -VirtualMachineScaleSet $vmss -Lun 0

This command removes the data disk of LUN 0 from the VMSS object.

Required Parameters

-Lun

Specifies the logical unit number of the disk.

Type:Int32
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Name

Specifies the name of the disk.

Type:String
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-VirtualMachineScaleSet

Specify the VMSS object.

Type:VirtualMachineScaleSet
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSet

Outputs

Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSet