< Back

New-AzureVMConfig

Wed Jan 30, 2019 5:49 pm

NAME New-AzureVMConfig



SYNOPSIS

Creates an Azure virtual machine configuration object.





SYNTAX

New-AzureVMConfig [-Name] <String> [-InstanceSize] <String> [[-HostCaching] <String>] [[-AvailabilitySetName] <String>] [[-Label] <String>] [-ImageName]

<String> [[-MediaLocation] <String>] [[-DiskLabel] <String>] [-DisableBootDiagnostics] [-LicenseType <String>] [-Profile <AzureSMProfile>]

[-InformationAction <ActionPreference>] [-InformationVariable <String>] [<CommonParameters>]



New-AzureVMConfig [-Name] <String> [-InstanceSize] <String> [[-HostCaching] <String>] [[-AvailabilitySetName] <String>] [[-Label] <String>] [-DiskName]

<String> [-DisableBootDiagnostics] [-LicenseType <String>] [-Profile <AzureSMProfile>] [-InformationAction <ActionPreference>] [-InformationVariable

<String>] [<CommonParameters>]





DESCRIPTION

The New-AzureVMConfig cmdlet creates an Azure virtual machine configuration object. You can use this object to perform a new deployment and add a new

virtual machine to an existing deployment.





PARAMETERS

-Name <String>

Specifies the name of the virtual machine.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-InstanceSize <String>

Specifies the size of the instance.



The acceptable values for this parameter are:



-- ExtraSmall



-- Small



-- Medium



-- Large



-- ExtraLarge



-- A5



-- A6



-- A7



-- A8



-- A9



-- Basic_A0



-- Basic_A1



-- Basic_A2



-- Basic_A3



-- Basic_A4



-- Standard_D1



-- Standard_D2



-- Standard_D3



-- Standard_D4



-- Standard_D11



-- Standard_D12



-- Standard_D13



-- Standard_D14



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-HostCaching <String>

Specifies the host caching mode for the operating system disk.



Valid values are:



-- ReadOnly



-- ReadWrite



Required? false

Position? 2

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-AvailabilitySetName <String>

Specifies the name of the availability set.



Required? false

Position? 3

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Label <String>

Specifies a label to assign to the virtual machine.



Required? false

Position? 4

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ImageName <String>

Specifies the name of the virtual machine image to use for the operating system disk.



Required? true

Position? 5

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-MediaLocation <String>

Specifies the Azure storage location for the new virtual machine disk.



Required? false

Position? 6

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DiskLabel <String>

Specifies a label for the operating system disk.



Required? false

Position? 7

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DisableBootDiagnostics [<SwitchParameter>]

Boot diagnostics is enabled by default on the Virtual Machine. This allows the user to disable that behavior.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-LicenseType <String>

Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server

operating system.



Possible values are: - Windows_Client



- Windows_Server





If this element is included in a request for an update, the value must match the intitial value. This value cannot be updated.





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Profile <AzureSMProfile>

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationAction <ActionPreference>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationVariable <String>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DiskName <String>

Specifies a name for the operating system disk.



Required? true

Position? 5

Default value None

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 (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES









-------------------------- Example 1: Create a Windows virtual machine configuration --------------------------



PS C:\\>$Image = (Get-AzureVMImage)[4].ImageName

C:\\PS> New-AzureVMConfig -Name "MyVM1" -InstanceSize ExtraSmall -ImageName $Image | Add-AzureProvisioningConfig -Windows -Password $AdminPassword |

Add-AzureDataDisk -CreateNew -DiskSizeInGB 50 -DiskLabel "Datadisk1" -LUN 0 | New-AzureVM -ServiceName "MySvc1"



This command creates a Windows virtual machine configuration with operating system disk, data disk and provisioning configuration. This configuration is

then used to create a new virtual machine.

-------------------------- Example 2: Create a Linux virtual machine configuration --------------------------



PS C:\\>$Image = (Get-AzureVMImage)[7].ImageName

C:\\PS> New-AzureVMConfig -Name "MyVM1" -InstanceSize ExtraSmall -ImageName $Image | Add-AzureProvisioningConfig -Linux -LinuxUser $LinuxUser -Password

$AdminPassword | Add-AzureDataDisk -CreateNew -DiskSizeInGB 50 -DiskLabel "Datadisk1" -LUN 0 | New-AzureVM -ServiceName "MySvc1"



This command creates a new Linux virtual machine configuration with operating system disk, data disk and provisioning configuration. This configuration

is then used to create a new virtual machine.



RELATED LINKS

Azure Service Cmdlets