Update-SCService

Update-SCService

Updates a VMM service instance.

Syntax

Parameter Set: Service
Update-SCService [-Service] <Service> [-JobVariable <String> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-ShowActions] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: WhatIf
Update-SCService [-Service] <Service> [-JobVariable <String> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Detailed Description

The Update-SCService cmdlet updates an instance of a Virtual Machine Manager (VMM) service. There are two servicing types you can use: conventional servicing and image-based servicing.

Conventional servicing applies updates to deployed virtual machines in place, without redeploying the service. While fast, it does not allow changing a virtual hard disk (VHD), removing network adapters, or changing operating system settings, except for Windows Server roles and features.

Image-based servicing deploys new virtual machines to the service with the updates. This type of servicing is used most often after updating the VHD for a tier, such as applying software updates to the program disk.

Parameters

-JobVariable<String>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-OnBehalfOfUser<System.String>

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-OnBehalfOfUserRole<Microsoft.SystemCenter.VirtualMachineManager.UserRole>

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PROTipID<Guid]>

Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RunAsynchronously

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Service<Service>

Specifies a VMM service object.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-ShowActions

Displays all servicing and orchestration actions that will be performed. This parameter is useful for debugging.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMMServer<ServerConnection>

Specifies a VMM server object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

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.

  • Service
  • ServicingActionItem[]

Notes

  • Requires a VMM service object, which can be retrieved using the Get-SCService cmdlet.

Examples

Example 1: Update a service by using conventional servicing

The first command gets the service object named Service01, which is a deployed service, and then stores the object in the $Service variable.

The second command gets the service template object named ServiceTemplate01, and then stores the object in the $SvcTemplate variable.

The third command creates an RTM release of the service template stored in $SvcTemplate.

The fourth command sets the pending template on the service instance to the updated service template stored in $PendingTemplate.

The last command updates Service01.

PS C:\> $Service = Get-SCService -Name "Service01"
PS C:\> $SvcTemplate = Get-SCServiceTemplate -Name "ServiceTemplate01"
PS C:\> $PendingTemplate = New-SCServiceTemplate -ServiceTemplate $SvcTemplate -Name "ServiceTemplate01" -Release "RTM"
PS C:\> Set-SCService -Service $Service -PendingServiceTemplate $PendingTemplate
PS C:\> Update-SCService -Service $Service

Example 2: Update a service by using image-based servicing

The first command gets the service object named Service02, and then stores the object in the $Service variable.

The second command gets the service template object named ServiceTemplate02, and stores the object in the $SvcTemplate variable.

The third command creates a new release of the service template stored in $SvcTemplate, names it ServiceTemplate02, gives it a release of RTM, and then stores the template in $PendingTemplate.

The fourth command gets the computer tier object named Web Tier for the service template stored in $PendingTemplate and stores the object in the $WebTier variable.

The fifth command adds memory to the virtual machine template for the computer tier stored in $WebTier.

The sixth command gets the virtual hard disk object named Win2k8R2BaseDisk_Patched.vhd, and then stores the object in the $BaseDisk2 variable. This virtual hard disk contains an updated version of the operating system.

The seventh command gets the virtual disk drive object on the virtual machine template stored in $WebTemplate, and then stores the object in the $VHD variable.

The eighth command removes the virtual disk drive object stored in $VHD.

The ninth command adds the virtual hard disk object stored in $BaseDisk2 to the virtual machine template object stored in $WebTemplate.

The tenth command sets the pending template on the service instance to the updated service template stored in $PendingTemplate.

The last command updates Service02.

PS C:\> $Service = Get-SCService -Name "Service02"
PS C:\> $SvcTemplate = Get-SCServiceTemplate -Name "ServiceTemplate02"
PS C:\> $PendingTemplate = New-SCServiceTemplate -ServiceTemplate $SvcTemplate -Name "ServiceTemplate02" -Release "RTM"
PS C:\> $WebTier = Get-SCComputerTierTemplate -ServiceTemplate $PendingTemplate -Name "Web Tier"
PS C:\> $WebTemplate = Get-SCVMTemplate -ComputerTierTemplate $WebTier | Set-SCVMTemplate -MemoryMB 2048
PS C:\> $BaseDisk2 = Get-SCVirtualHardDisk -Name "Win2k8R2BaseDisk_Patched.vhd"
PS C:\> $VHD = Get-SCVirtualDiskDrive -VMTemplate $WebTemplate
PS C:\> Remove-SCVirtualDiskDrive -VirtualDiskDrive $VHD
PS C:\> New-SCVirtualDiskDrive -VirtualHardDisk $BaseDisk2 -VMTemplate $WebTemplate -BootVolume -SystemVolume -Bus 0 -LUN 0 -ide -VolumeType BootAndSystem
PS C:\> Set-SCService -Service $Service -PendingServiceTemplate $PendingTemplate
PS C:\> Update-SCService -Service $Service

Get-SCService

New-SCService

Read-SCService

Remove-SCService

Resume-SCService

Set-SCService

Start-SCService

Stop-SCService

Suspend-SCService

Get-SCComputerTierTemplate

Get-SCServiceTemplate

Get-SCVirtualDiskDrive

Get-SCVirtualHardDisk

New-SCServiceTemplate

New-SCVirtualDiskDrive

Remove-SCVirtualDiskDrive