< Back

Add-AzureRmVmssDataDisk

Tue Jan 29, 2019 9:37 pm

NAME Add-AzureRmVmssDataDisk



SYNOPSIS

Adds a data disk to the VMSS.





SYNTAX

Add-AzureRmVmssDataDisk [-VirtualMachineScaleSet] <PSVirtualMachineScaleSet> [[-Name] <String>] [[-Lun] <Int32>] [[-Caching] {None | ReadOnly |

ReadWrite}] [-CreateOption <String>] [-DefaultProfile <IAzureContextContainer>] [-DiskSizeGB <Int32>] [-StorageAccountType <String>]

[-WriteAccelerator] [-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

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





PARAMETERS

-Caching <CachingTypes>

Specifies the caching type of the disk.



Required? false

Position? 3

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-CreateOption <String>

Specifies the create option of the disk.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DiskSizeGB <Int32>

Specifies the size of the disk in GB.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Lun <Int32>

Specifies the logical unit number of the disk.



Required? false

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Name <String>

Specifies the name of the disk.



Required? false

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-StorageAccountType <String>

Specifies the storage account type of the disk.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-VirtualMachineScaleSet <PSVirtualMachineScaleSet>

Specify the VMSS object. You can use the New-AzureRmVmssConfig (./New-AzureRmVmssConfig.md)cmdlet to create the object.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName, ByValue)

Accept wildcard characters? false



-WriteAccelerator [<SwitchParameter>]

Specifies whether WriteAccelerator should be enabled or disabled on the data disk.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSet

System.String System.Int32 System.Nullable`1[[Microsoft.Azure.Management.Compute.Models.CachingTypes, Microsoft.Azure.Management.Compute,

Version=14.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]

System.Nullable`1[[Microsoft.Azure.Management.Compute.Models.DiskCreateOptionTypes, Microsoft.Azure.Management.Compute, Version=14.0.0.0,

Culture=neutral, PublicKeyToken=31bf3856ad364e35]] System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral,

PublicKeyToken=b77a5c561934e089]] System.Nullable`1[[Microsoft.Azure.Management.Compute.Models.StorageAccountTypes,

Microsoft.Azure.Management.Compute, Version=14.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]





OUTPUTS

Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSet







NOTES









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.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... ssdatadisk