Showing posts from 2020

GET BG name dynamically

var bg = new Array();   //Get the tenant and Business Group var tenant = System.getContext().getParameter( "__asd_tenantRef" ); var subtenantRef = System.getContext().getParameter( "__asd_subtenantRef" ); …

vRO - Update VM Property

vcac = Server.findAllForType("vCAC:VCACHost")[0]; var machine = payload.get("machine"); nodeName = machine.get("name") var vCACVms = Server.findAllForType("vCAC:VirtualMachine", "Virt…

get Attribute Value form configuration element vRO

var configurationElementPath = "<Folder>/"+tenant; var configurationElementName = "element"; var attributeName = "RepoRestHost"; var category = Server.getConfigurationElementCategoryWithPath(c…

Remove CD Drive from VM using vRO workflow

Input:- payload (type properties) var machine = payload.get("machine"); var vmProperties = machine.get("properties"); vmname = machine.get("name"); lifecycleState = payload.get("lifecycleSta…

vRO action to get all reservation's network profile

var username = Server.getCurrentLdapUser().userPrincipalName; System.log(username); var resList = vCACCAFEEntitiesFinder.findReservations(vCACHost, "" ); System.debug( "Reservations found: " + resList.leng…

vRA Cloud Client Commands

Cloud Client commands: 1 - vra login userpass --user rishabh@abc.com --tenant vrotenant--server https://n.c.v --password We 2 - vra content list --pageSize 100 --type property-definition 3 - vra package create --name ovaovfpacka…

get vcac VM from VC VM

var vcacVm = Server.findAllForType( "vCAC:VirtualMachine" ).filter( function ( v ) { return v.vmUniqueID == vm.config.instanceUuid })[ 0 ]; if (!vcacVm) { throw new Error ( "VM not managed by vRA" …

Generate Complex Password

//complex input boolean if (complex == true ) { var charSets = [ { minAmount : 1 , chars : "abcdefghjkmnpqrstuvwxyz" }, { minAmount : 1 , chars : "1234567890" }, { minAmount : …

get All vRA Reservation based on BG

Input: BG: string type // Business group name   var tenant = host.tenant; var BG = bg.toUpperCase(); var hostReservation =[]; var resArr =Server.findAllForType( "vCAC:Reservation" ); for ( var k = 0 ;k < re…

Using vRO test the connectivity

var port = 22; // any port number var target = "localhost"; // string Hostname or IP //checking the connectivity applying try catch and finally  try { // testing for port connectivity on target host …

Run a script in VM using vRO Resource Element

Inputs:- folder String type (name of the ResourceElementCategory ) templateFile   String type (name of the resource element) vmName   String type (name of the VM) (or the content needs to be replaced with) //Get all res…

Load More
That is All