Skip to content

Instantly share code, notes, and snippets.

View trisharia's full-sized avatar

Trisha Navarro trisharia

View GitHub Profile
@trisharia
trisharia / getCatalogResourcesOfVraCatalogItemRequest.js
Last active March 25, 2017 01:25
Get all Catalog Resources associated with a vRA Catalog Item Request
// VMware vRealize Orchestrator action sample
//
// Gets all Catalog Resources (deployments, machines, etc.) for the given catalog item request
//
// For vRO/VRA 7.0+
//
// Action Inputs:
// host - vCACCAFE:VCACHost - vRA CAFE Host
// request - vCACCAFE:CatalogItemRequest - vRA Catalog Item Request
//
@trisharia
trisharia / getChildrenOfVraCatalogResource.js
Last active November 9, 2017 21:39
Get the children of a vRA Catalog Resource
// VMware vRealize Orchestrator action sample
//
// Get the children of a vRA Catalog Resource.
// For example, find the Machine resource(s) of a Deployment.
//
// For vRO/VRA 7.0+
//
// Action Inputs:
// cafeHost - vCACCAFE:VCACHost - vRA CAFE Host
// parentCatalogResource - vCACCAFE:CatalogResource - parent Catalog Resource for which to get children
@trisharia
trisharia / getCatalogRequestIdOfVcacVm.js
Last active March 25, 2017 01:24
Get the ID of the Catalog Request of a vRA VM
// VMware vRealize Orchestrator action sample
//
// Get the ID of the Catalog Request for a vRA IaaS VM
//
// For vRO/VRA 7.0+
//
// Action Inputs:
// host - vCAC:VCACHost - vRA IaaS Host
// virtualMachine - vCAC:VirtualMachine - vRA IaaS VM
//
@trisharia
trisharia / findVraVmsWithPropertyValue.js
Last active March 30, 2017 00:50
Find all VMs with a particular property value in vRA
// VMware vRealize Orchestrator action sample
//
// Find all VMs with a specific property value in vRA
//
// For vRO/VRA 7.0+
//
// Action Inputs:
// vcacHost - vCAC:VCACHost - vRA IaaS Host
// propertyName - string - the custom property name to find
// propertyValue - Any - the custom property value to find
@trisharia
trisharia / resetMacAddressOfVcenterVm.js
Last active March 30, 2017 00:49
Reconfigure a VM so that it generates a new MAC address at the next reboot
// VMware vRealize Orchestrator action sample
//
// Reconfigures a VM so that it generates a new MAC address at the next reboot
// Returns null if no matching MAC address was found on the VM
//
// For vRO 7.0+/vCenter 6.0+
//
// Action Inputs:
// vm - VC:VirtualMachine - vCenter VM
// oldMacAddress - string - Current MAC address that needs regeneration
@trisharia
trisharia / createTemporaryFileInVro.js
Last active September 15, 2022 23:47
Create a temporary text-based file on the vRO server, which can then be copied elsewhere like a guest vCenter VM
// VMware vRealize Orchestrator action sample
//
// Create a temporary text-based file, in a temporary directory, on the vRO server
// Sample usage would be to later copy the file to a guest vCenter VM
//
// For vRO 6.0+
//
// Action Inputs:
// vroTempFileName - string - Name of the file to create
// fileContents - string - Contents of the file
@trisharia
trisharia / getVcHostSystemServiceKeys.js
Created March 27, 2017 20:01
Start, stop, restart, or uninstall services of an ESXi Host in vCenter
// VMware vRealize Orchestrator action sample
//
// Get all the security profile service keys (IDs) of an ESXi Host, used as parameters for starting/stopping/restarting a service.
//
// For vRO 6.0+/vCenter 6.0+
//
// Action Inputs:
// host - VC:HostSystem - ESXi Host from which to retrieve services
// logging - boolean - If true, write verbosely to the vRO system logs
//
@trisharia
trisharia / getActionsOfVraCatalogResource.js
Last active March 28, 2017 16:11
Get the entitied actions of a vRA Catalog Resource
// VMware vRealize Orchestrator action sample
//
// Gets the entitied actions of a vRA Catalog Resource
//
// For vRO/vRA 7.0+
//
// Action Inputs:
// catalogResource - VCACCAFE:CatalogResource - catalog resource
//
// Return type: Array/VCACCAFE:CatalogResourceActions - actions of the catalog resource
@trisharia
trisharia / assignVcenterTagsWithSingleVapiClient.js
Created March 30, 2017 17:35
Assign vCenter tags via VAPI using a single VAPI client to minimize session creation
// VMware vRealize Orchestrator action sample
//
// Assign vCenter tags via VAPI using a single VAPI client to minimize session creation.
// Always creates nonexistent tags, and optionally creates nonexistent tag categories.
//
// For vRO/VAPI 7.0+
//
// Action Inputs:
// endpoint - VAPIEndpoint - VAPI Endpoint
// vm - VC:VirtualMachine - Virtual machine
@trisharia
trisharia / renameVcacVm.js
Created March 30, 2017 20:42
Rename a vRA IaaS virtual machine
// VMware vRealize Orchestrator action sample
//
// Rename a vRA IaaS VM
//
// For vRO/VRA 6.0+
//
// Action Inputs:
// vm - vCAC:VirtualMachine - vRA IaaS VM
// vmName - New name of VM
//