Export (0) Print
Expand All
Expand Minimize

New-WAPackVM

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

New-WAPackVM

Creates a virtual machine.

Syntax

Parameter Set: CreateVMFromTemplate
New-WAPackVM -Name <String> -Template <VMTemplate> -VMCredential <PSCredential> -Windows [-ProductKey <String> ] [-VNet <VMNetwork> ] [ <CommonParameters>]

Parameter Set: CreateLinuxVMFromTemplate
New-WAPackVM -Linux -Name <String> -Template <VMTemplate> -VMCredential <PSCredential> [-AdministratorSSHKey <String> ] [-VNet <VMNetwork> ] [ <CommonParameters>]

Parameter Set: CreateVMFromOSDisk
New-WAPackVM -Name <String> -OSDisk <VirtualHardDisk> -VMSizeProfile <HardwareProfile> [-VNet <VMNetwork> ] [ <CommonParameters>]




Detailed Description

These topics are deprecated and will be removed in the future. For the updated topics, see Azure WAPack Cmdlets. This topic describes the cmdlet in the 0.8.1 version of the Microsoft Azure PowerShell module. To find out the version of the module you're using, from the Azure PowerShell console, type (get-module azure).version.

The New-WAPackVM cmdlet creates a virtual machine.

Parameters

-AdministratorSSHKey<String>

Specifies the Secure Shell (SSH) key for the Administrator account.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Linux

Indicates that the cmdlet creates a virtual machine to run the Linux operating system.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Name<String>

Specifies a name for the virtual machine.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-OSDisk<VirtualHardDisk>

Specifies an operating system disk as a VirtualHardDisk object. To obtain an operating system disk, use the Get-WAPackVMOSDisk cmdlet.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ProductKey<String>

Specifies a product key. The product key is a 25 digit number that identifies the product license. Use a product key for an operating system that you plan to install on a virtual machine or host.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Template<VMTemplate>

Specifies a template. The cmdlet creates a virtual machine based on the template that you specify. To obtain a template object, use the Get-WAPackVMTemplate cmdlet.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-VMCredential<PSCredential>

Specifies the credential for the local Administrator account. To obtain a PSCredential object, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-VMSizeProfile<HardwareProfile>

Specifies a size profile for a virtual machine as a HardwareProfile object. To obtain a size profile, use the Get-WAPackVMSizeProfile cmdlet.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-VNet<VMNetwork>

Specifies a virtual network. The cmdlet connects the virtual machine to the virtual network that you specify. To obtain a virtual network, use the Get-WAPackVNet cmdlet.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Windows

Indicates that the cmdlet creates a virtual machine to run the Windows operating system.


Aliases

none

Required?

true

Position?

named

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 (http://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: Create a virtual machine for the Windows operating system by using a template

The first command creates a PSCredential object, and then stores it in the $Credentials variable. The cmdlet prompts you for an account and password. For more information, type Get-Help Get-Credential.

The second command gets the virtual machine template named ContosoTemplate04 by using the Get-WAPackVMTemplate cmdlet, and then stores it in the $Template variable.

The final command creates a virtual machine named ContosoV023, based on the template stored in the $Template variable. The command specifies the Windows parameter, and, therefore, the virtual machine must run a version of the Windows operating system.


PS C:\> $Credentials = Get-Credential PS C:\> $Template = Get-WAPackVMTemplate -Name "ContosoTemplate04"PS C:\> New-WAPackVM -Name "ContosoV023" -Template $Template -VMCredential $Credentials -Windows

Example 2: Create a virtual machine for the Linux operating system by using a template

The first command creates a PSCredential object, and then stores it in the $Credentials variable.

The second command gets the virtual machine template named ContosoTemplate19 by using the Get-WAPackVMTemplate cmdlet, and then stores it in the $Template variable.

The final command creates a virtual machine named ContosoV028, based on the template stored in the $Template variable. The command specifies the Linux parameter, and, therefore, the virtual machine must run a version of the Linux operating system.


PS C:\> $Credentials = Get-Credential PS C:\> $Template = Get-WAPackVMTemplate -Name "ContosoTemplate19"PS C:\> New-WAPackVM -Linux -Name "ContosoV028" -Template $Template -VMCredential $Credentials

Example 3: Create a virtual machine from an operating system disk and size profile

The first command gets an operating system disk named ContosoDiskOS by using the Get-WAPackVMOSDisk cmdlet, and then stores it in the $OSDisk variable.

The second command gets the size profile named MediumSizeVM by using the Get-WAPackVMSizeProfile cmdlet, and then stores it in the $SizeProfile variable.

The final command creates a virtual machine named ContosoV073 from the operating system disk stored in $OSDisk and the size profile stored in $SizeProfile.


PS C:\> $OSDisk = Get-WAPackVMOSDisk -Name "ContosoDiskOS"PS C:\> $SizeProfile = Get-WAPackVMSizeProfile -Name "MediumSizeVM"PS C:\> New-WAPackVM -Name "ContosoV073" -OSDisk $OSDisk -VMSizeProfile $SizeProfile

Related topics

Show:
© 2014 Microsoft