New-AzureVM

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

New-AzureVM

Creates a new Azure virtual machine.

Syntax

Parameter Set: ExistingService
New-AzureVM -ServiceName <String> -VMs <PersistentVM[]> [-DeploymentLabel <String> ] [-DeploymentName <String> ] [-DnsSettings <DnsServer[]> ] [-InternalLoadBalancerConfig <InternalLoadBalancerConfig> ] [-ReservedIPName <String> ] [-VNetName <String> ] [-WaitForBoot] [ <CommonParameters>]

Parameter Set: CreateService
New-AzureVM -ServiceName <String> -VMs <PersistentVM[]> [-AffinityGroup <String> ] [-DeploymentLabel <String> ] [-DeploymentName <String> ] [-DnsSettings <DnsServer[]> ] [-InternalLoadBalancerConfig <InternalLoadBalancerConfig> ] [-Location <String> ] [-ReservedIPName <String> ] [-ReverseDnsFqdn <String> ] [-ServiceDescription <String> ] [-ServiceLabel <String> ] [-VNetName <String> ] [-WaitForBoot] [ <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-AzureVM cmdlet adds a new virtual machine to an existing Azure cloud service, or creates a new virtual machine and a new cloud service in the current subscription if either the Location or AffinityGroup parameter is specified.

Parameters

-AffinityGroup<String>

Specifies the Azure affinity group the cloud service will reside in. Valid only when creating a new cloud service.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DeploymentLabel<String>

Specifies a label for the deployment

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DeploymentName<String>

Specifies a deployment name. If not specified, the service name will be used as the deployment name.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DnsSettings<DnsServer[]>

Specifies a DNS Server object that defines the DNS settings for the new deployment.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-InternalLoadBalancerConfig<InternalLoadBalancerConfig>

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-Location<String>

Specifies the location where the new service will be hosted.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ReservedIPName<String>

Specifies reserved IP name.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ReverseDnsFqdn<String>

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ServiceDescription<String>

Specifies a description for the new service.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ServiceLabel<String>

Specifies a label for the new service.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ServiceName<String>

Specifies the new or existing service name.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-VMs<PersistentVM[]>

A list of virtual machine objects to create.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-VNetName<String>

Specifies the virtual network name where the new virtual machine will be deployed.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WaitForBoot

Indicates that the cmdlet waits for the virtual machine to reach the ReadyRole state. This cmdlet fails if the virtual machine enters one of the following states while waiting: FailedStartingVM, ProvisioningFailed, or ProvisioningTimeout.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

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 Azure virtual machine, “MyNewVM”, and a new Azure service, “MySvc2”.

C:\PS> New-AzureVMConfig -Name "MyNewVM" -InstanceSize ExtraSmall -ImageName (Get-AzureVMImage)[4].ImageName ` | Add-AzureProvisioningConfig –Windows –Password $adminPassword ` | New-AzureVM –ServiceName "MySvc2" –AffinityGroup "Contoso"

Example 2

This example adds a new Linux virtual machine to an existing cloud service.

C:\PS> New-AzureVMConfig -Name "MySUSEVM2" -InstanceSize ExtraSmall -ImageName (Get-AzureVMImage)[7].ImageName ` | Add-AzureProvisioningConfig –Linux –LinuxUser $lxUser -Password $adminPassword `
 | New-AzureVM

Example 3

This example builds a new virtual machine configuration and then creates the virtual machine with the New-AzureVM cmdlet.

C:\PS> $Images = Get-AzureVMImage
C:\PS> $myImage = $Images[4] 
C:\PS> $myVM = New-AzureVMConfig -Name "MyVM2" -InstanceSize ExtraSmall -ImageName $myImage.ImageName ` | Add-AzureProvisioningConfig -Windows -Password $adminPassword ` | Add-AzureDataDisk -CreateNew -DiskSizeInGB 50 -DiskLabel "DataDisk50" -LUN 0 C:\PS> New-AzureVM –ServiceName "MySvc1" –VMs $myVM 

Get-AzureVM

New-AzureVMConfig

Remove-AzureVM

New-AzureQuickVM