Add-​Azure​Rm​Vmss​Data​Disk

Adds a data disk to the VMSS.

Syntax

Add-AzureRmVmssDataDisk
   [-VirtualMachineScaleSet] <VirtualMachineScaleSet>
   [[-Name] <String>]
   [[-Lun] <Int32>]
   [[-Caching] <CachingTypes>]
   [[-CreateOption] <DiskCreateOptionTypes>]
   [[-DiskSizeGB] <Int32>]
   [[-StorageAccountType] <StorageAccountTypes>]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]

Description

The Add-AzureRmVmssDataDisk cmdlet adds a data disk to the Virtual Machine Scale Set (VMSS) instance.

Examples

Example 1: Add a data disk

PS C:\> $vmss = New-AzureRmVmssConfig -Location $Loc -SkuCapacity 2 -SkuName "Standard_A0" -UpgradePolicyMode "Automatic"
PS C:\> $vmss = Add-AzureRmVmssDataDisk -VirtualMachineScaleSet $vmss -Name 'DataDisk1' -Lun 0 -Caching 'ReadOnly' -CreateOption Empty -DiskSizeGB 10 -StorageAccountType StandardLRS

This command adds an empty data disk to the VMSS object.

Required Parameters

-VirtualMachineScaleSet

Specify the VMSS object. You can use the New-AzureRmVmssConfig cmdlet to create the object.

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

Optional Parameters

-Caching

Specifies the caching type of the disk.

Type:CachingTypes
Parameter Sets:None, ReadOnly, ReadWrite
Position:3
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-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
-CreateOption

Specifies the create option of the disk.

Type:DiskCreateOptionTypes
Parameter Sets:FromImage, Empty, Attach
Position:4
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-DiskSizeGB

Specifies the size of the disk in GB.

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

Specifies the logical unit number of the disk.

Type:Int32
Position:2
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
-StorageAccountType

Specifies the storage account type of the disk.

Type:StorageAccountTypes
Parameter Sets:StandardLRS, PremiumLRS
Position:6
Default value:None
Accept pipeline input:True (ByPropertyName)
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