michalpawlak
Enthusiast
Enthusiast

Cancel provisioning process

Hi All,

I'm working on integration with our internal systems, however, I have come to the point where I would like to cancel provisioning due to lack of IP addresses in given subnet. Unfortunately, when I have defined it in lifecycle:

   payload>lifecycleState> phase : PRE

   payload>lifecycleState> state : VMPSMasterWorkflow32.Requested

and exit workflow with an error/exception -> provisioning continues. Is there any way to cancel provisioning process?

I am working on vra7 with vro7. 

Help will be appreciated!

 

   payload>lifecycleState> phase : PRE
   payload>lifecycleState> state : VMPSMasterWorkflow32.Requested
 
 
0 Kudos
5 Replies
tnavarro1
VMware Employee
VMware Employee

In addition to using the PRE lifecycle phase, you also need to add the following custom property:

Extensibility.Lifecycle.Error.Event.VMPSMasterWorkflow32.Requested = Destroy

With the exception of BuildingMachine, MachineProvisioned, and RegisterMachine, the property needs to be added for any lifecycle state:

Extensibility.Lifecycle.Error.Event.VMPSMasterWorkflow32.{state} = Destroy 

See http://pubs.vmware.com/vra-70/index.jsp?topic=%2Fcom.vmware.vra.extensibility.doc%2FGUID-E152208C-E1...

0 Kudos
AaronEVM
VMware Employee
VMware Employee

Format should be like this.

Name: Extensibility.Lifecycle.Error.State.VMPSMasterWorkflow32.Requested.PRE

Value: Disposing

0 Kudos
Joffer
Enthusiast
Enthusiast

I never got this to work. A more description would be appreciated.

I did however solve this in what I think is an easier way.

declared var virtualMachineEvent = "BuildFailure" as an output parameter to my event triggered workflow.

More or less the same problem I made a post about: e: How do I stop/block/fail a VM provisioning from entering BuildingMachine event (while developing/...

0 Kudos
XModem
Enthusiast
Enthusiast

Sorry if this is zombifying the post, but I also am stuck trying to cancel the provisioning on a vRO Workflow failure - with no success so far.

My subscription is on "CloneWorkflow.CustomizeOS.EVENT.OnCustomizeOSComplete".

I've tried

Extensibility.Lifecycle.Error.State.CloneWorkflow.CustomizeOS = UnprovisionMachine

Extensibility.Lifecycle.Error.Event.CloneWorkflow.CustomizeOS = UnprovisionMachine

Extensibility.Lifecycle.Error.Event.CloneWorkflow.CustomizeOS.EVENT.OnCustomizeOSComplete = UnprovisionMachine

Nothing worked.

Then I read about your output param, but I don't understand var virtualMachineEvent = "BuildFailure" - I thought if you define a workflow output value and pass values between workflow element using INPUT/OUTPUT/ATTRIBUTE variables, you don't use "var"? Anyway, I tried what you did, created an OUTPUT variable called "virtualMachineEvent" and assigned the value in a catch-all exception handler of my vRO workflow but it didn't abort the provisioning.

Could you please elaborate on that variable and where/how you set it?

0 Kudos
Oizo
VMware Employee
VMware Employee

When you change the state or raise an event it has to be on the same workflow that you're currently on, in our case CloneWorkflow.

There are 2 ways of changing the course of actions when an error occurs :

- 1 - In vRO workflow, using output parameter virtualMachineEvent and/or workflowNextState

- 2 - Or, in the Custom Properties with a Catch-all Exception

You cannot use both at the same time, because an Exception does NOT return the output parameter(s)!

In this documentation page, you can see the different life cycle states by machine type :

https://docs.vmware.com/en/vRealize-Automation/7.3/com.vmware.vra.extensibility.doc/GUID-648D67DE-03...

The Clone Workflow does not have the BuildFailure event or UnprovisionMachine state.

But, it has the state FailedProvisioning.

So, if using Method 1, set virtualMachineEvent=FailedProvisioning, or if you want to use the Custom Properties, use this :

Extensibility.Lifecycle.Error.State.CloneWorkflow.CustomizeOS with the value FailedProvisioning

0 Kudos