VMware Cloud Community
rkrichevskiy
Enthusiast
Enthusiast

Updating guest customization with vCD API

I am trying to feed a workflow vApp input from vCloud Director, then iterate through VMs in my input vApp to update their guest customization settings. From what I have come across on this forum, it should be fairly simple but some reason I am having trouble when loop passes through first VM and attempts to customize next VM.

2015-04-10 09_37_58-VMware vCenter Orchestrator.png

Here is what I have in the failed action:

vm.updateInternalState();

var guestCustomizationSection = vm.getGuestCustomizationSection()

guestCustomizationSection.enabled = true;

guestCustomizationSection.adminPasswordAuto = true;

guestCustomizationSection.adminPasswordEnabled = true;

System.log("Started Guest Customization for " + vm.name);

return vm.updateSection(guestCustomizationSection);

And the error is The entity [network name redacted] is busy completing an operation.; majorErrorCode=400; minorErrorCode=BUSY_ENTITY; vendorSpecificErrorCode=null; (Dynamic Script Module name : updateGuestsCustomization#6).

Any clue as to why this is happening? My expectation is that Wait for a Task should be taking care of previous VM task completion, but I feel like that's not entirely true.

Thanks!

0 Kudos
2 Replies
qc4vmware
Virtuoso
Virtuoso

It is a little difficult to tell only looking at your action.  The second line is missing a semi colon which could be causing an issue somewhere in how the script is being processed.  In our system logs do you see your log message appear?  What are the contents of the other steps in your loop?  Can you upload a package with the full workflow and actions?  Are you positive that the task is in fact being fed into the wait step?  If its null it'll just fly by.  Whatever you are doing the same vm should not be getting processed twice anyway so you probably don't need the wait unless you absolutely have to process each vm in a serial fashion.

0 Kudos
rkrichevskiy
Enthusiast
Enthusiast

Yes, it is definitely going through the loop once. First VM is in fact customized, syslog out is successful too. I am not positive on task being fed in to the wait step, I suppose I need to make the wait for a task a bit more verbose to answer that, however from the PSO examples I found, this schema design should work.

I am not quite clear on the last point, can we perform VM customization in parallel? I am feeding vApp as an input and my understanding is that customization will need to be performed one VM at a time.

0 Kudos