New-​WA​Pack​VM

Creates a virtual machine.

Syntax

New-WAPackVM
   [-AdministratorSSHKey <String>]
   [-Linux]
   -Name <String>
   [-Profile <AzureSMProfile>]
   -Template <VMTemplate>
   -VMCredential <PSCredential>
   [-VNet <VMNetwork>]
   [<CommonParameters>]
New-WAPackVM
   -Name <String>
   -OSDisk <VirtualHardDisk>
   [-Profile <AzureSMProfile>]
   -VMSizeProfile <HardwareProfile>
   [-VNet <VMNetwork>]
   [<CommonParameters>]
New-WAPackVM
   -Name <String>
   [-ProductKey <String>]
   [-Profile <AzureSMProfile>]
   -Template <VMTemplate>
   -VMCredential <PSCredential>
   [-VNet <VMNetwork>]
   [-Windows]
   [<CommonParameters>]

Description

These topics are deprecated and will be removed in the future. For the updated topics, see Azure WAPack Cmdlets (http://msdn.microsoft.com/library/dn776450.aspx). 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 -Name Azure).Version.

The New-WAPackVM cmdlet creates a virtual machine.

Examples

Example 1: Create a virtual machine for the Windows operating system by using a template

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

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.

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

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

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.

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

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

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.

Required Parameters

-Linux

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

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Name

Specifies a name for the virtual machine.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-OSDisk

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

Type:VirtualHardDisk
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Template

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.

Type:VMTemplate
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-VMCredential

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.

Type:PSCredential
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-VMSizeProfile

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

Type:HardwareProfile
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.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-AdministratorSSHKey

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

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ProductKey

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.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Profile

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

Type:AzureSMProfile
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VNet

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.

Type:VMNetwork
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False