Some background. I use the custom naming module to set the VM name. This module works fine. I also use ExtendingClouds to gather custom properties.
In order of priority
1. Set custom hostname - runs fine (blocking)
2. Set DNS - runs fine and pulls in the name from the Set custom hostname with no issue. (blocking)
I use nHost = machine.get("name") to get the name of the VM and pass it to a PS script to add to DNS.
Pre-create AD object - Runs but pulls in the generic name assigned by the business group (non-blocking)
Once again, I use machine.get("name") to set the name of the VM so it can create the AD object. Like so, computerName = machine.get("newNameString");
Somehow when the Set DNS workflow runs, I get the proper name of the VM but when calling the same variable when pre-creating the object I get the generic name assigned by the business group (iteng001 for example).
Any thoughts on why this is working on one occasion but not the next?
Thanks
Bill
Your issue sounds like something that I struggled with so lets see if we are close. For me, subscriptions were not getting things updated quick enough that when the next subscription ran the payload did not have the current updated information. So to address that I went about this two fold. If I have a subscription that makes any updates, I use the updateEntity workflow to update that value and I also create a property called virtualMachineAddOrUpdateProperties that has all the changed names and values added to it and is presented as an Output of the subscription on the return.
That is exactly whats going on. Somehow I get the custom name but the "precreate AD object" WF does not have this information.
Ok try the methods I mentioned above with the workflow to add/update entities and have the virtualMachineAddOrUpdateProperties Property as an output with the changed name and values added and see that helps get you what you need. In some cases it might be worth looking at combining workflows into a single subscription if things still do not update correctly for you.