VMware Cloud Community
CalmCloud
Enthusiast
Enthusiast
Jump to solution

How to differentiate between "destroy vm" and errors during provisioning

Hi All,

WFStubMachineDisposing workflow gets executed when machine is destroyed  by executing "Destroy VM" action  or when an error happens during provisioning. Is it possible to know in WFStubMachineDisposing workflow how it got called i.e. "Destroy VM" action or error during provisioning?


Thanks,

1 Solution

Accepted Solutions
GrantOrchardVMw
Commander
Commander
Jump to solution

The MachineDisposing stub will run even if a provisioning task fails, while the UnprovisionMachine stub will not. I guess you could write out a simple log entry at UnprovisionMachine to indicate that it has run, and that would be the implication that a machine was purposefully destroyed.

Grant http://grantorchard.com

View solution in original post

3 Replies
npadmani
Virtuoso
Virtuoso
Jump to solution

as documentation states

WFStubMachineDisposing

Customizable state change workflow that executes before a machine enters the Disposing state

Ref: vRealize Automation 6.2 Documentation Center

So if you are calling 'Destroy VM' Action, it will definitely call above workflow.

but at the same time let's say during machine provisioning, your machine is successfully created in the end point and going through additional bits of guest OS customisation etc.. this is still (post)provisioning stage where your request state in vRA console will show as 'In Progress', So if during this time something goes wrong, vRA might trigger destroy of VM.

Narendra Padmani VCIX6-DCV | VCIX7-CMA | VCI | TOGAF 9 Certified
Reply
0 Kudos
GrantOrchardVMw
Commander
Commander
Jump to solution

The MachineDisposing stub will run even if a provisioning task fails, while the UnprovisionMachine stub will not. I guess you could write out a simple log entry at UnprovisionMachine to indicate that it has run, and that would be the implication that a machine was purposefully destroyed.

Grant http://grantorchard.com
CalmCloud
Enthusiast
Enthusiast
Jump to solution

hmmm...Both Unprovisoning & MachineDisposing got executed when an exception is thrown in MachineProvisoning workflow. As per vmware documentation only MachineDisposing should be executed.  I am on  VRO 6.3.


Any help appreciated


Reply
0 Kudos