VMware Cloud Community
TimLawrence
Enthusiast
Enthusiast

Using Blocking Tasks To Determine External Org Network Changes

Hi,

I have an issue using Orchestrator with vCloud Director and AMQP at the moment. I would appreciate any ideas anyone has..

I am using the network objects along with blocking tasks to try and identify when External IPs are removed from an  org network (and hence check them in to my IPAM database).

the workflow can be summarised thusly:

  1. User removes IP (in vCloud) and clicks save
  2. The task is blocked and a message is sent out on the AMQP bus
  3. Orchestrator workflow retrieves the message and gets the blocking task object.
  4. Whilst the task is still blocked I get the task object and retrieve the network object.
  5. I use .toXml() on the network object to get the list of currently configured external IPs and add them to an array
  6. I allow the blocking task to resume. Once complete I call .Xml() again to get the new list of external IPs in a nother array
  7. I diff my 2 IP address arrays to hopefully see what has been added/removed.

This all works (code-wise) except for the fact that the XML that is returned from the network object is always the same.

It looks as though the XML is updated as soon as the task is completed and perhaps is just commited once the task is unblocked.

The only other way I can think of to do this is to save the task definition, force the task to fail, grab the network XML and then fire a new task with the same definition.

Feels like a pretty rubbish way of doing it though.

any ideas?

I might post this in the main forum too.

Thanks

Tim

0 Kudos
3 Replies
cdecanini_
VMware Employee
VMware Employee

The plug-in may cache the object. Try to call the updateInternalState() method on the object and check if it changes.

Christophe,

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
0 Kudos
TimLawrence
Enthusiast
Enthusiast

no luck unfortunately. I called it both times that I call toXml and no difference

0 Kudos
cdecanini_
VMware Employee
VMware Employee

Unfortunately it seems the blocking tasks sometimes lock access to  some of the information in the object. We noticed this was the case when  deleting a vApp and trying to access the vApp VMs information such as  computer name so we could remove it from AD for example.

It would be wise to open a support Request to make sure this can be fixed in a next version of vCD. In the meantime you may want to fail the task and recreate it as you mentioned (if you have all information needed to do so). Not elegant but it may be the only work around.

Another one my be to use the query service to get the information you are looking for. The query service sometimes allows to bypass the blocking tasks limitations. You may want to look into it.

Regards,

Christophe.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
0 Kudos