VMware Cloud Community
sbeaver
Leadership
Leadership
Jump to solution

OOTB Reprovision Action

Ok I am looking to use the default reprovision action but I want to add a specific property and value when that action is used.  something like VirtualMachine.Reprovision = True.  I want to use that value as part of the DECOM and Rebuild process so that I can bypass things like releasing the IP and retiring the cmdb record as well as bypass the request IP and new CI creation on the rebuild.

Anyone doing anything like that and or have any info on where and how to edit the built-in action? 

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
Reply
0 Kudos
1 Solution

Accepted Solutions
jasongarland
Contributor
Contributor
Jump to solution

In 7.X you can use the Event Broker for this.  There's a lifecycle state event called 'VMPSMasterWorkflow32.Active.EVENT.onReprovision' that you can use to fire off a vRO workflow that can add the property to your deployment or VM.

I haven't tested this, but I do something similar in my environment any time a lease is changed on a deployment.

If you're using a version of vRA prior to 7, I've done exactly what you're doing by adding the property to the VM at the end of its build.  So at the end of my post-provisioning workflow (MachineProvisioned) I add a VirtualMachine.Provisioned = true property, which is really the same result as what you're doing.  Any future reprovision will have the property attached and I can then skip parts of pre and post-provisioning by keying off that property.

View solution in original post

Reply
0 Kudos
4 Replies
nsb24
VMware Employee
VMware Employee
Jump to solution

If you are using APIs then you can simply add new property when submitting the request.

GET https://{{va-fqdn}}/catalog-service/api/consumer/resources/{{resource-guid}}/actions

Get request template for resource and its reprovision action

GET https://{{va-fqdn}}/catalog-service/api/consumer/resources/{{resource-guid}}/actions/{{resource-action-guid}}/requests/template

Submit the request by adding your desired property in the data field of the request template along with other properties.

POST https://{{va-fqdn}}/catalog-service/api/consumer/resources/{{resource-guid}}/actions/{{resource-action-guid}}/requests

sbeaver
Leadership
Leadership
Jump to solution

Thank you for your response and I will play around with this and see how it goes.  I was really hoping that I could edit the built-in action so that when it presents all the properties it will use I could have a name and value added by default.

Thanks again!!

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
Reply
0 Kudos
jasongarland
Contributor
Contributor
Jump to solution

In 7.X you can use the Event Broker for this.  There's a lifecycle state event called 'VMPSMasterWorkflow32.Active.EVENT.onReprovision' that you can use to fire off a vRO workflow that can add the property to your deployment or VM.

I haven't tested this, but I do something similar in my environment any time a lease is changed on a deployment.

If you're using a version of vRA prior to 7, I've done exactly what you're doing by adding the property to the VM at the end of its build.  So at the end of my post-provisioning workflow (MachineProvisioned) I add a VirtualMachine.Provisioned = true property, which is really the same result as what you're doing.  Any future reprovision will have the property attached and I can then skip parts of pre and post-provisioning by keying off that property.

Reply
0 Kudos
sbeaver
Leadership
Leadership
Jump to solution

Hey Jason,

in my build process I have something like that where I add a provision.done=true.  I am so glad that you have responded and pointing in the direction of the event broker.  I started there and did not think there was an event for that and will be trying the event you have listed and see what happens.  I have been pulling my hair out launching the action via the plugin.  The resource data would never go with the request when I submit with the form.

I am going to take a look at the event now and will update after  i have a chance to play.

Thank you for your time and response. 

Steve

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
Reply
0 Kudos