New-SCServiceConfiguration

Creates a service configuration from a service template.

Syntax

New-SCServiceConfiguration
   [-Name] <String>
   [-Description <String>]
   [-VMMServer <ServerConnection>]
   -ServiceTemplate <ServiceTemplate>
   [-ServicePriority <String>]
   -VMHostGroup <HostGroup>
   [-Tag <String>]
   [-CostCenter <String>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-OnBehalfOfUser <String>]
   [-OnBehalfOfUserRole <UserRole>]
   [<CommonParameters>]
New-SCServiceConfiguration
   [-Name] <String>
   [-Description <String>]
   [-VMMServer <ServerConnection>]
   -ServiceTemplate <ServiceTemplate>
   [-ServicePriority <String>]
   -Cloud <Cloud>
   [-Tag <String>]
   [-CostCenter <String>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-OnBehalfOfUser <String>]
   [-OnBehalfOfUserRole <UserRole>]
   [<CommonParameters>]

Description

The New-SCServiceConfiguration cmdlet creates a service configuration from a service template. The service configuration contains instance-specific values that are used when the service is deployed.

Examples

Example 1: Create a service configuration for a host group

PS C:\> $HostGroup = Get-SCVMHostGroup | where { $_.Path -eq "All Hosts\HostGroup02\Production" }
PS C:\> $ServiceTemplate = Get-SCServiceTemplate -Name "ServiceTemplate01"
PS C:\> $ServiceConfig = New-SCServiceConfiguration -ServiceTemplate $ServiceTemplate -Name "Service01" -VMHostGroup $HostGroup  -Description "Contoso Service 01" -ServicePriority High -CostCenter 1033 
PS C:\> $ServiceConfig

The first command gets the host group object with the path All Hosts\HostGroup02\Production and stores the object in the $HostGroup variable.

The second command gets the service template object named ServiceTemplate01 and stores it in the $ServiceTemplate variable.

The third command creates a service configuration object in the library for the host group stored in $HostGroup using the service template object stored in $ServiceTemplate. The command then stores the new service configuration object in the $ServiceConfig variable.

The last command displays the properties of the new service configuration object to the user.

Example 2: Create a service configuration for a private cloud

PS C:\> $Cloud = Get-SCCloud -Name "Production"
PS C:\> $ServiceTemplate = Get-SCServiceTemplate -Name "ServiceTemplate01"
PS C:\> $ServiceConfig = New-SCServiceConfiguration -ServiceTemplate $ServiceTemplate -Name "Service02" -Cloud $Cloud  -Description "Contoso Cloud Service" -ServicePriority High -CostCenter 1033 
PS C:\> $ServiceConfig

The first command gets the private cloud object named Production and stores the object in the $Cloud variable.

The second command gets the service template object named ServiceTemplate01 and stores it in the $ServiceTemplate variable.

The third command creates a service configuration object in the library for the private cloud stored in $Cloud using the service template object stored in $ServiceTemplate. The command then stores the new service configuration object in the $ServiceConfig variable.

The last command displays the properties of the new service configuration object to the user.

Parameters

-Cloud

Specifies a private cloud object.

Type:Cloud
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 service 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:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-OnBehalfOfUser

Specifies a user name. This cmdlet operates on behalf of 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. To obtain a user role, use the Get-SCUserRole cmdlet. This cmdlet operates on behalf of the user role that this parameter specifies.

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

-ServicePriority

Specifies the priority for a service. Valid values are: Normal, Low, High. Default value: Normal.

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

-ServiceTemplate

Specifies a service template object.

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

-Tag

Specifies a word or phrase to associate with an object so that you can search for all objects with the specified set of tags. You can search for a subset of tags, or you can search for the full set of tags.

Type:String
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

-VMMServer

Specifies a VMM server object.

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

Outputs

ServiceConfiguration

This cmdlet returns a ServiceConfiguration object.