VMware Cloud Community
BillStreet00
Enthusiast
Enthusiast

Extensibility Script missing information

I did an inplace upgrade of vRO to 7.3.  Prior to that I was able to pull information from extensibility and use it on my customization scripts. However since the upgrade many values are now returning NULL.

Working Script pre-vRO 7.3:

var executionContext = System.getContext();

System.log("BlueprintName: " + payload.get("blueprintName")) ;

System.log("ComponentId: " + payload.get("componentId")) ;

System.log("ComponentTypeId: " + payload.get("componentTypeId")) ;

System.log("EndpointId: " + payload.get("endpointId")) ;

System.log("RequestId: " + payload.get("requestId")) ;

System.log("VirtualMachineEvent: " + payload.get("virtualMachineEvent")) ;

System.log("WorkflowNextState: " + payload.get("workflowNextState")) ;

var lifecycleState = payload.get("lifecycleState") ;

System.log("State: " + lifecycleState.get("state")) ;

System.log("Phase: " + lifecycleState.get("phase")) ;

System.log("Event: " + lifecycleState.get("event")) ;

var machine = payload.get("machine") ;

System.log("ID: " + machine.get("id")) ;

System.log("Name: " + machine.get("name")) ;

System.log("ExternalReference: " + machine.get("externalReference")) ;

System.log("Owner: " + machine.get("owner")) ;

System.log("Type: " + machine.get("type")) ;

System.log("Properties: " + machine.get("properties")) ;

var vCACVmProperties = machine.get("properties") ;

if (vCACVmProperties != null) {

  var log = "";

  log += "vCAC VM properties :\n";

  var array = new Array();

Now, that script returns the following:

2017-08-18 12:32:16.402] [I] BlueprintName: Windows 2012 R2 Server

[2017-08-18 12:32:16.403] [I] ComponentId: w2k12prod

[2017-08-18 12:32:16.404] [I] ComponentTypeId: Infrastructure.CatalogItem.Machine.Virtual.vSphere

[2017-08-18 12:32:16.405] [I] EndpointId: af7a34a4-cdfa-43f3-893d-3490bab38d67

[2017-08-18 12:32:16.406] [I] RequestId: ab543770-0c8c-41b7-87b9-2bdc988d5d47

[2017-08-18 12:32:16.407] [I] VirtualMachineEvent: null

[2017-08-18 12:32:16.408] [I] WorkflowNextState: null

[2017-08-18 12:32:16.409] [I] State: VMPSMasterWorkflow32.MachineProvisioned

[2017-08-18 12:32:16.410] [I] Phase: POST

[2017-08-18 12:32:16.411] [I] Event: null

[2017-08-18 12:32:16.412] [I] ID: f8cefb94-b08d-473c-b6b4-552ce19f4490

[2017-08-18 12:32:16.413] [I] Name: xxxxxxxxx

[2017-08-18 12:32:16.414] [I] ExternalReference: vm-39152

[2017-08-18 12:32:16.415] [I] Owner: xxxxxxxxx

[2017-08-18 12:32:16.416] [I] Type: 0

[2017-08-18 12:32:16.417] [I] Properties: null

[2017-08-18 12:32:16.418] [E] Error in (Workflow:Adding the server DNS / Scriptable task (item1)#41) TypeError: Cannot call method "get" of null

[2017-08-18 12:32:16.430] [E] Workflow execution stack:

***

item: 'Adding the server DNS/item1', state: 'failed', business state: 'null', exception: 'TypeError: Cannot call method "get" of null (Workflow:Adding the server DNS / Scriptable task (item1)#41)'

workflow: 'Adding the server DNS' (d30146ed-b02f-4818-8340-b55409a57485)

Some of the information comes back normally while others return a null value, including the IP address.  When I look in vCenter the VM shows the IP correctly.  Has anyone seen this?  Any workarounds?

Thanks

0 Kudos
3 Replies
daphnissov
Immortal
Immortal

Can you check the blueprint that provisions this item and ensure you're using the custom property for whatever lifecycle name to pass all the properties to vRO? Are you passing "*" or "__*,*"?

0 Kudos
BillStreet00
Enthusiast
Enthusiast

Just the asterisk.

pastedImage_0.png

0 Kudos
BillStreet00
Enthusiast
Enthusiast

somewhat of an update.  I run a custom email notification script several times throughout the provisioning process and I noticed that the very first time it runs on a new build it fails but subsequent calls are successful.  There looks to be about a 12 - 14 second difference in the times run but the script is the same.  The first run fails because it cannot pull an IP address but afterwards it sees it fine.  I'm trying to find a way to add a 15 second timeout before the script runs to see if that resolves the issue but have not had any luck.

pastedImage_0.png

0 Kudos