Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

vRA 6.2.4 create a IaaS user? Trying to deploy with a service account but can't reassign the asset.

$
0
0

I am using vRA 6.2.4 and we are trying to use a service account to execute the deployment so that the items in question do not appear in the catalog when the user logs in.  We are using another front end to manage the requests.  This works fine for users which have previously been the owner of an IaaS asset.  It seems like an IaaS user must not be created until that point.  I need a way of creating this so that I can reassign the system once it has been deployed.  Is there a way of creating the user via the api?  I'm using the reconfigure action on the catalog resource to accomplish this but it requires a userID which like I said does not exist.  I've got a bit of chicken and the egg going on right now.  If there is a better way to accomplish what I am trying to do I am open to modifying the procedure.  If I have to I can switch to deploying it on behalf of the user which I know works but I can't hide the items in the catalog (at least I don't think I can).

 

 

Here are some releveant snippets.  item is the catalogResource

 

var operations = item.getOperations();

 

for each (var op in operations) {

  System.log(op.name + "::" + op.id);

  if (op.name.toUpperCase() === "RECONFIGURE") {

  var reconfigOp = op;

  break;

  }

}

 

var inputs = new Properties();

 

inputs.put("provider-operationId", "Infrastructure.Machine.Action.Reconfigure");

inputs.put("provider-Cafe.Shim.VirtualMachine.Owner", newOwnerId);

 

actionResult = System.getModule("com.vmware.library.vcaccafe.request").requestResourceAction(reconfigOp,inputs)



In the above code newOwnerId is set by the code in this action:


var modelName = 'ManagementModelEntities.svc';

var entitySetName = 'Users';

var headers = null;

var userID = "";

 

//Create properties for prefix entity

var properties = {UserName:userName};

//Read a list of entities

var entities = vCACEntityManager.readModelEntitiesByCustomFilter(host.id, modelName, entitySetName, properties, headers);

if (entities.length > 0)

  userID = entities[0].getProperties().get("UserID")

else

  System.debug("Could not find user with username : " + userName);

 

System.debug("userID : " + userID);

return userID;


Viewing all articles
Browse latest Browse all 6251

Trending Articles



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