I've tried following the documentation and examples to fail out the request at the VMPSMasterWorkflow32.Requested lifecycle state. All the examples I see are during the buildingMachine state and I want to fail out well before that. Documentation says that you can but its not working for me. Can anyone share their configuration where this is working. I have a subscription setup correctly for the "PRE" event and its blocking. I am setting an output for virtualMachineEvent from the workflow. I tried "BuildFailure" and tried some other strings like "ProvisionFailure", "RequestFailure" just so see if those would work. In the documentation the only events that I see or the OnBuildFailure and OnBuildSuccess.
We struggled with this for a while as well and turned to SDK support for a resolution. We are using the event "VMPSMasterWorkflow32.MachineProvisioned" at a "PRE" state. Passing the value below will cause the build to fail and delete the VM. Keep in mind, the vRO workflow must succeed in order to properly pass the OUT variable. We have achieved this by using error handling to set the value and send an email.
workflowNextState = "DeactivateMachine"
Thanks I'll do some testing with this. Hopefully I'll get the results I'm hoping for!