New-SCVMConfiguration

Creates a virtual machine configuration from a virtual machine template.

Syntax

New-SCVMConfiguration
   -VMTemplate <Template>
   [-Name <String>]
   [-Description <String>]
   [-CostCenter <String>]
   [-AvailabilitySetNames <System.Collections.Generic.List`1[System.String]>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-OnBehalfOfUser <String>]
   [-OnBehalfOfUserRole <UserRole>]
   [<CommonParameters>]
New-SCVMConfiguration
   -VMTemplate <Template>
   -Name <String>
   [-Description <String>]
   -Cloud <Cloud>
   [-CostCenter <String>]
   [-CapabilityProfile <CapabilityProfile>]
   [-AvailabilitySetNames <System.Collections.Generic.List`1[System.String]>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-OnBehalfOfUser <String>]
   [-OnBehalfOfUserRole <UserRole>]
   [<CommonParameters>]
New-SCVMConfiguration
   -VMTemplate <Template>
   -Name <String>
   [-Description <String>]
   -VMHostGroup <HostGroup>
   [-CostCenter <String>]
   [-AvailabilitySetNames <System.Collections.Generic.List`1[System.String]>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-OnBehalfOfUser <String>]
   [-OnBehalfOfUserRole <UserRole>]
   [<CommonParameters>]
New-SCVMConfiguration
   -ComputerTier <ComputerTier>
   [-Name <String>]
   [-Description <String>]
   [-CostCenter <String>]
   [-ComputerName <String>]
   [-AvailabilitySetNames <System.Collections.Generic.List`1[System.String]>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-OnBehalfOfUser <String>]
   [-OnBehalfOfUserRole <UserRole>]
   [<CommonParameters>]

Description

The New-SCVMConfiguration cmdlet creates a virtual machine configuration from a virtual machine template. The virtual machine configuration is used to specify instance-specific values to use when deploying the virtual machine configuration.

Examples

Example 1: Create a virtual machine configuration for placement of a virtual machine on a host group

PS C:\> $HostGroup = Get-SCVMHostGroup -Name "Production"
PS C:\> $VMTemplate = Get-SCVMTemplate | where {$_.Name -eq "VMTemplate01"}
PS C:\> $VMConfig = New-SCVMConfiguration -VMTemplate $VMTemplate -VMHostGroup $HostGroup -CostCenter 1234 -Name "VMConfig01"

The first command gets the host group object named Production and stores the object in the $HostGroup variable.

The second command gets all virtual machine template objects, selects the template named VMTemplate01 and then stores the object in the $VMTemplate variable.

The last command creates a virtual machine configuration named VMConfig01 for the virtual machine template stored in $VMTemplate for deployment on the host group stored in $HostGroup, specifying a cost center value of 1234.

Parameters

-AvailabilitySetNames

Specifies a list of availability set names.

Type:System.Collections.Generic.List`1[System.String]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CapabilityProfile

Specifies a capability profile object.

Type:CapabilityProfile
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Cloud

Specifies a private cloud object.

Type:Cloud
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ComputerName

Specifies the name of a computer that VMM can uniquely identify on your network. Valid formats are:

  • FQDN
  • IPv4 address
  • IPv6 address
  • NetBIOS name
Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ComputerTier

Specifies a computer tier object.

Type:ComputerTier
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-CostCenter

Specifies the cost center for a virtual machine so that you can collect data about the allocation of virtual machines (or resources allocated to virtual machines) to make use of in your billing system.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Description

Specifies a description for the virtual machine configuration.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-JobVariable

Specifies that job progress is tracked and stored in the variable named by this parameter.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name of a Virtual Machine Manager (VMM) object.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-OnBehalfOfUser

Specifies the name of a user. This cmdlet sets the on behalf of user as the user that this parameter specifies.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-OnBehalfOfUserRole

Specifies a user role. This cmdlet sets the on behalf of user role as the user role that this parameter specifies. To obtain a user role object, use the Get-SCUserRole cmdlet.

Type:UserRole
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VMHostGroup

Specifies a virtual machine host group object or an array of host group objects.

Type:HostGroup
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-VMTemplate

Specifies a VMM template object used to create virtual machines.

Type:Template
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Outputs

VMConfiguration

This cmdlet returns a VMConfiguration object.

Notes

  • Requires a VMM virtual machine template object, which you can obtain by using the Get-SCVMTemplate cmdlet.