Acer.Server.OOB.PRO12.Recovery

Acer.Server.OOB.PRO12.Recovery (WriteActionModuleType)

Element properties:

TypeWriteActionModuleType
IsolationAny
AccessibilityInternal
RunAsDefault
InputTypeSystem.BaseData
OutputTypeMicrosoft.Windows.SerializedObjectData

Member Modules:

ID Module Type TypeId RunAs 
Recovery WriteAction Microsoft.SystemCenter.VirtualMachineManager.PRO.V2.Recovery.RecoveryScriptModule Default

Overrideable Parameters:

IDParameterTypeSelectorDisplay NameDescription
EventDescriptionstring$Config/EventDescription$EventDescription

Source Code:

<WriteActionModuleType ID="Acer.Server.OOB.PRO12.Recovery" Accessibility="Internal" Batching="false">
<Configuration>
<xsd:element minOccurs="1" name="EventDescription" type="xsd:string"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="EventDescription" Selector="$Config/EventDescription$" ParameterType="string"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<WriteAction ID="Recovery" TypeID="PROV2Library!Microsoft.SystemCenter.VirtualMachineManager.PRO.V2.Recovery.RecoveryScriptModule">
<EventDescription>$Config/EventDescription$</EventDescription>
<ScriptBody><Script>
#############################################################################
# Description: This is where you insert the VMM PowerShell script that executes
# in order to enable a recovery. The logic of this script is dependent on the scenario,
# its causes and its appropriate resolution. This script merely invokes a successful
# PRO Tip Implementation. Full details on scripts are provided in the documentation provided.
#############################################################################

#############################################################################
# DISCLAIMER:
# Copyright (c) Microsoft Corporation. All rights reserved. This
# script is made available to you without any express, implied or
# statutory warranty, not even the implied warranty of
# merchantability or fitness for a particular purpose, or the
# warranty of title or non-infringement. The entire risk of the
# use or the results from the use of this script remains with you.
#############################################################################
Param($eventContent);

##
# explained by acer:
# $eventContent is empty by default. if you want to pass additional parameters, you can use it.
#
# by default, $VMMServer can be directly used for scvmm ms
# $HostName can be directly used for hyperv host
# $protipid can be directly used for tip id
##

[string]$data = "[VMMSvr: " + $VMMServer.Name + "][HypervHost: " + $HostName + "][ProTipID: " + $protipid + "]"

eventcreate /T Information /ID 100 /L APPLICATION /SO AcerPRO /D 'Start to execuite RecoveryScript.ps1';
eventcreate /T Information /ID 100 /L APPLICATION /SO AcerPRO /D "$data";

eventcreate /T Information /ID 100 /L APPLICATION /SO AcerPRO /D 'Start to execute Disable-VMHost cmdlet';

#$VMMServer = get-vmmserver -computerName $VMMServer;
$VMHost = Get-VMHost -ComputerName $HostName;

Disable-VMHost $VMHost -PROTipID $PROTipID;

eventcreate /T Information /ID 100 /L APPLICATION /SO AcerPRO /D 'set pro tip status as resolved';
Set-PROTip -PROTipId $ProtipId -TipStatus Resolved;

</Script></ScriptBody>
<TimeoutSeconds>120</TimeoutSeconds>
</WriteAction>
</MemberModules>
<Composition>
<Node ID="Recovery"/>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>Windows!Microsoft.Windows.SerializedObjectData</OutputType>
<InputType>System!System.BaseData</InputType>
</WriteActionModuleType>