User Tools

Site Tools


vrealize:eventbroker:properties

Transfer Custom Properties between vRA and vRO

To Read properties set in vRA inside vRO:

Your workflow must have the following defined as an Input Paramater.

[Properties]payload     = Custom Properties from vRA.

To access these

var machine = payload.get("machine") ;
 
// From the Machine Object, you get fetch the real Custom Properties:
 
var vCACVmProperties = machine.get("properties") ;
if (vCACVmProperties != null) 
{
	var array = new Array();
	for each (var key in vCACVmProperties.keys) 
        {
		array.push(key + " : " + vCACVmProperties.get(key));	
	}
	array.sort();
 
	for each (var line in array) 
        {
		System.log (line + "\n");
	}	
}

To Write/Update/Delete Properties in vRO and update to vRA

Your workflow must have the following defined as an Output Paramater, in addiontal the event must be run as blocking.

[Properties] virtualMachineDeleteProperties      = Contains list of properties to delete, value does not matter.
[Properties] virtualMachineAddOrUpdateProperties = Contains list of properties to create or update. **Value CANNOT be null! (vRA will Crash!)**
[string] virtualMachineEvent = "BuildFailure" or "BuildSuccess"

Note: Setting the virtualMachineEvent to "BuildFailure" will NOT result in the rest of the events not to be  triggered, this all depends witch event you are in. However "Cleanup" events will be triggered after "Success" events are triggered.
Note2: Setting the virtualMachineEvent to "BuildSucess" will say that the machine is "finished" (runs the same events later on as BuildFailure
Note3: These can only be used in Events that Support vCacProperties (See Tables)

BuildFailure/BuildSucess under different events

If you set “BuildFailure” or “BuildSucess” in or after VMPSMasterWorkflow32.BuildingMachine Post event (After Template is cloned and VM is customized) MachineProvisioned and MachineActived events will stil trigger.

StatePhaseEventvCACProperties
VMPSMasterWorkflow32.RequestedPRE-Yes
VMPSMasterWorkflow32.RequestedEVENTVMPSMasterWorkflow32.Requested.EVENT.OnProvisionMachineYes
VMPSMasterWorkflow32.RequestedPOST-Yes
VMPSMasterWorkflow32.WaitingToBuildPRE-No
VMPSMasterWorkflow32.WaitingToBuildPOST-No
VMPSMasterWorkflow32.BuildingMachinePRE-Yes
CloneWorkflow.CloneMachinePRE-No
CloneWorkflow.CloneMachineEVENTCloneWorkflow.CloneMachine.EVENT.OnCloneMachineCompleteNo
CloneWorkflow.CustomizeMachinePRE-No
CloneWorkflow.CustomizeMachineEVENTCloneWorkflow.CustomizeMachine.EVENT.OnCustomizeMachineCompleteNo
CloneWorkflow.InitialPowerOnPRE-No
CloneWorkflow.InitialPowerOnEVENTCloneWorkflow.InitialPowerOn.EVENT.OnInitialPowerOnCompleteNo
CloneWorkflow.CustomizeOSEVENTCloneWorkflow.CustomizeOS.EVENT.OnCustomizeOSNo
CloneWorkflow.BuildCompletePRE-No
VMPSMasterWorkflow32.VMPSMasterWorkflow32EVENTVMPSMasterWorkflow32.VMPSMasterWorkflow32.EVENT.OnBuildSuccessNo
VMPSMasterWorkflow32.BuildingMachinePOST-Yes
SET BUILDFAILURE ON ANY OF EVENTS FROM THIS STAGE (will not trigger the next events)
VMPSMasterWorkflow32.MachineProvisionedPRE-Yes
VMPSMasterWorkflow32.MachineProvisionedPOST-Yes
VMPSMasterWorkflow32.VMPSMasterWorkflow32.MachineActivatedPRE-Yes
VMPSMasterWorkflow32.VMPSMasterWorkflow32.MachineActivatedPOST-Yes
Will still trigger these events
VMPSMasterWorkflow32.VMPSMasterWorkflow32EVENTVMPSMasterWorkflow32.VMPSMasterWorkflow32.EVENT.onBuildFailureNo
VMPSMasterWorkflow32.DisposingPRE-Yes
VMPSMasterWorkflow32.DisposingEVENTVMPSMasterWorkflow32.Disposing.EVENT.OnDisposeCompleteYes
VMPSMasterWorkflow32.DisposingPOST-Yes

If you set “BuildFailure” in the VMPSMasterWorkflow32.Requested events. The machine will still be cloned. UNLESS you also set it in the VMPSMasterWorkflow32.BuildingMachine PRE event

StatePhaseEventvCACPropertiesComment
Set BuildFailure on any of below…
VMPSMasterWorkflow32.RequestedPRE-Yes
VMPSMasterWorkflow32.RequestedEVENTVMPSMasterWorkflow32.Requested.EVENT.OnProvisionMachineYes
VMPSMasterWorkflow32.RequestedPOST-Yes
VMPSMasterWorkflow32.WaitingToBuildPRE-No
VMPSMasterWorkflow32.WaitingToBuildPOST-No
Set BuildFailure on any of these above…
VMPSMasterWorkflow32.BuildingMachinePRE-Yes
VMPSMasterWorkflow32.VMPSMasterWorkflow32EVENTVMPSMasterWorkflow32.VMPSMasterWorkflow32.EVENT.onBuildFailureNoNotice event triggered, but still machine will be cloned!
CloneWorkflow.CloneMachinePRE-No
CloneWorkflow.CloneMachineEVENTCloneWorkflow.CloneMachine.EVENT.OnCloneMachineCompleteNo
CloneWorkflow.CustomizeMachinePRE-No
CloneWorkflow.CustomizeMachineEVENTCloneWorkflow.CustomizeMachine.EVENT.OnCustomizeMachineCompleteNo
CloneWorkflow.InitialPowerOnPRE-No
CloneWorkflow.InitialPowerOnEVENTCloneWorkflow.InitialPowerOn.EVENT.OnInitialPowerOnCompleteNo
CloneWorkflow.CustomizeOSEVENTCloneWorkflow.CustomizeOS.EVENT.OnCustomizeOSNo
CloneWorkflow.BuildCompletePRE-No
VMPSMasterWorkflow32.BuildingMachinePOST-Yes
VMPSMasterWorkflow32.DisposingPRE-Yes
VMPSMasterWorkflow32.DisposingEVENTVMPSMasterWorkflow32.Disposing.EVENT.OnDisposeCompleteYes
VMPSMasterWorkflow32.DisposingPOST-Yes

If you set “BuildFailure” in the VMPSMasterWorkflow32.BuildingMachine PRE event, the template will not be cloned.

StatePhaseEventvCACProperties
VMPSMasterWorkflow32.RequestedPRE-Yes
VMPSMasterWorkflow32.RequestedEVENTVMPSMasterWorkflow32.Requested.EVENT.OnProvisionMachineYes
VMPSMasterWorkflow32.RequestedPOST-Yes
VMPSMasterWorkflow32.WaitingToBuildPRE-No
VMPSMasterWorkflow32.WaitingToBuildPOST-No
VMPSMasterWorkflow32.BuildingMachinePRE-YesSetting “BuildFailure” here will skip the cloning
CloneWorkflow.CloneMachinePRE-No
VMPSMasterWorkflow32.VMPSMasterWorkflow32EVENTVMPSMasterWorkflow32.VMPSMasterWorkflow32.EVENT.onBuildFailureNo
VMPSMasterWorkflow32.BuildingMachinePOST-Yes
VMPSMasterWorkflow32.DisposingPRE-Yes
VMPSMasterWorkflow32.DisposingEVENTVMPSMasterWorkflow32.Disposing.EVENT.OnDisposeCompleteYes
VMPSMasterWorkflow32.DisposingPOST-Yes
vrealize/eventbroker/properties.txt · Last modified: 2018/11/29 11:27 by admin