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 Windows Azure virtual machine.

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

Parameter Set: CreateService
New-AzureVM -ServiceName <String> -VMs <PersistentVM[]> [-AffinityGroup <String> ] [-DeploymentLabel <String> ] [-DeploymentName <String> ] [-DnsSettings <DnsServer[]> ] [-Location <String> ] [-ServiceDescription <String> ] [-ServiceLabel <String> ] [-VNetName <String> ] [-WaitForBoot] [ <CommonParameters>]

This topic describes the cmdlet in the .6.19 version of the Windows Azure PowerShell module. To find out the version of the module you're using, from the Windows Azure PowerShell console, type (get-module azure).version.

The New-AzureVM cmdlet adds a new virtual machine to an existing Windows 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.

-AffinityGroup<String>

Specifies the Windows 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

Service Name

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

-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

-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 (ByValue, 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

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.

Example 1

This example creates a new Windows Azure virtual machine, “MyNewVM”, and a new Windows 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

Create or Delete Virtual Machines Using Windows Azure Cmdlets

Manage Virtual Machines Using Windows Azure Cmdlets

Manage Images and Disks Using Windows Azure Cmdlets

Set Up and Manage Virtual Networks Using Windows Azure Cmdlets

Set Up Communication for Virtual Machines Using Windows Azure Cmdlets