Quantcast
Channel: VMware Communities : All Content - vRealize Automation Tools
Viewing all articles
Browse latest Browse all 9859

Add new NIC by calling requestResourceAction from vRO

$
0
0

Hi there.

 

I've got a requirement where I need to add a NIC to a VM at point of provisioning. I can't add an additional NIC into the blueprint as this NIC is only needed when a specific application is installed  and I am trying to keep the number of blueprints down to a minimum.

 

Currently I achieve this through PowerShell and this sort of works OK however we want to use network profiles in vRA to control the allocation of IP addresses and so am looking at trying to programmatically call the reconfigure action through vRO.

 

For testing purposes I am hard coding the VCAC VM, Resource Action and Catalog Item and am successfully submitting the reconfigure request from vRO however I am getting errors in the catalina.out which implies that the syntax of my properties file is incorrect. I've tried to locate documentation on this but so far have been unsuccessful.

 

What I currently have is something like the following - CatalogItem and VCACvm are passed in to the script.

 

// Get the reconfigure operation action id

var inputs = new Properties ();

var resourceActions = CatalogItem.operations;
var count = 0;
while(resourceActions.length > count) {
    if(resourceActions[count].name == "Reconfigure") {
         vmOperation = vCACCAFEEntitiesFinder.getCatalogResourceAction(CatalogItem,resourceActions[count].Id);
    }
    count++;
}


var providerVM=VCACvm.displayName;
var providerID=VCACvm.virtualMachineID;
var providerOPID = vmOperation.getBindingId();


// Generate Input Properties
inputs.put("provider-operationId",providerOPID);
inputs.put("provider-machineId",providerID);
inputs.put("provider-TARGET_MACHINE_NAME",providerVM)
inputs.put("provider-cafe.Shim.VirtualMachine.Reconfigure",'[{"NetworkName":"network2","MacAddress":null,"CustomProperties":[]]}');

 

 

Once the input is built I am passing the values of vmOperation and inputs to the standard action 'requestResourceAction'. Workflow logs aren't coming back with any errors

 

 

2016-08-18 08:45:20,085 vcac: [component="cafe:notification" priority="ERROR" thread="queue-pool-executer-2" tenant="" context="4sG3NLY5" token="9VPFKUVx"] velocity.logVelocityMessage:151 - ResourceManager : unable to find resource 'core/subject.vm-csp.catalog.notifications.request.successful' in any resource loader.

2016-08-18 08:45:20,092 vcac: [component="cafe:notification" priority="ERROR" thread="queue-pool-executer-2" tenant="" context="4sG3NLY5" token="9VPFKUVx"] velocity.logVelocityMessage:151 - Exception rendering Renderable extension at forms/forms-extension.vm[line 2, column 1]

2016-08-18 08:45:20,092 vcac: [component="cafe:notification" priority="ERROR" thread="queue-pool-executer-2" tenant="" context="4sG3NLY5" token="9VPFKUVx"] velocity.logVelocityMessage:151 - Exception rendering Renderable items at forms/forms-row.vm[line 2, column 1]

2016-08-18 08:45:20,093 vcac: [component="cafe:notification" priority="ERROR" thread="queue-pool-executer-2" tenant="" context="4sG3NLY5" token="9VPFKUVx"] velocity.logVelocityMessage:151 - Exception rendering Renderable rows at forms/forms-section.vm[line 10, column 1]

2016-08-18 08:45:20,093 vcac: [component="cafe:notification" priority="ERROR" thread="queue-pool-executer-2" tenant="" context="4sG3NLY5" token="9VPFKUVx"] velocity.logVelocityMessage:151 - Exception rendering Renderable sections at forms/forms-page.vm[line 5, column 1]

2016-08-18 08:45:20,093 vcac: [component="cafe:notification" priority="ERROR" thread="queue-pool-executer-2" tenant="" context="4sG3NLY5" token="9VPFKUVx"] velocity.logVelocityMessage:151 - Exception rendering Renderable pages at forms/forms-layout.vm[line 1, column 1]

2016-08-18 08:45:20,094 vcac: [component="cafe:notification" priority="ERROR" thread="queue-pool-executer-2" tenant="" context="4sG3NLY5" token="9VPFKUVx"] velocity.logVelocityMessage:151 - Exception rendering Renderable body at core/main.vm-csp.catalog.notifications.request.successful[line 22, column 1]

 

 

I have tried variations on the VirtualMachine.Reconfigure property (including basing it on the log output from running a reconfiguration operation natively in vRA but still with the same result.

 

Has anyone managed to achieve this before or know of where I can find any more detailed information on the properties format?

 

Thanks,

 

 


Viewing all articles
Browse latest Browse all 9859

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>