Share via


New-AzureVMConfig

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

New-AzureVMConfig

Creates a new Azure virtual machine configuration object.

Syntax

Parameter Set: ImageName
New-AzureVMConfig [-Name] <String> [-InstanceSize] <String> [[-HostCaching] <String> ] [[-AvailabilitySetName] <String> ] [[-Label] <String> ] [-ImageName] <String> [[-MediaLocation] <String> ] [[-DiskLabel] <String> ] [ <CommonParameters>]

Parameter Set: DiskName
New-AzureVMConfig [-Name] <String> [-InstanceSize] <String> [[-HostCaching] <String> ] [[-AvailabilitySetName] <String> ] [[-Label] <String> ] [-DiskName] <String> [ <CommonParameters>]

Detailed Description

This topic describes the cmdlet in the 0.8.10 version of the Microsoft Azure PowerShell module. To get the version of the module you're using, in the Azure PowerShell console, type (Get-Module -Name Azure).Version.

The New-AzureVMConfig cmdlet creates a new virtual machine configuration object. This object can then be used to perform a new deployment, as well as to add a new virtual machine to an existing deployment.

Parameters

-AvailabilitySetName<String>

Specifies the name of the availability set.

Aliases

none

Required?

false

Position?

4

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DiskLabel<String>

Specifies a label for the operating system disk.

Aliases

none

Required?

false

Position?

8

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DiskName<String>

Specifies a name for the operating system disk.

Aliases

none

Required?

true

Position?

6

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-HostCaching<String>

Specifies the host caching mode for the operating system disk. Supported values are: "ReadOnly" and "ReadWrite".

Aliases

none

Required?

false

Position?

3

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ImageName<String>

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

Aliases

none

Required?

true

Position?

6

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-InstanceSize<String>

Specifies the size of the virtual machine. For a list of virtual machine sizes, see Virtual Machine Sizes for Azure.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Label<String>

Specifies a label to assign to the virtual machine.

Aliases

none

Required?

false

Position?

5

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-MediaLocation<String>

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

Aliases

none

Required?

false

Position?

7

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Name<String>

Specifies the name of the virtual machine.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see  about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1

This example creates a new Windows virtual machine configuration with operating system disk, data disk and provisioning configuration. This configuration is then used to create a new virtual machine.

C:\PS> $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"

Example 2

This example 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.

C:\PS> $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" 

Get-AzureVMImage

Add-AzureDataDisk

Add-AzureProvisioningConfig

Get-AzureVM

Remove-AzureVM

Update-AzureVM