Skip to content

Instantly share code, notes, and snippets.

View trisharia's full-sized avatar

Trisha Navarro trisharia

View GitHub Profile
@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 / 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 / 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
//
@trisharia
trisharia / getReservationOfVcacVm.js
Last active June 2, 2017 04:17
Get the Reservation of a vRA VM
// VMware vRealize Orchestrator action sample
//
// Get the Reservation of a vRA VM
//
// For vRO/VRA 7.0+
//
// Action Inputs:
// host - vCAC:VCACHost - vRA IaaS Host
// virtualMachine - vCAC:VirtualMachine - vRA IaaS VM
//
@trisharia
trisharia / getVmFolderOfVm.js
Last active August 25, 2017 18:08
Get folder of a vCenter VM
// VMware vRealize Orchestrator action sample
//
// Returns the VM folder of a given vCenter VM
//
// For vRO 7.0+/vCenter 6.0+
//
// Action Inputs:
// vm - VC:VirtualMachine - vCenter VM
//
// Return type: VC:VmFolder - the folder to which the VM belongs
@trisharia
trisharia / getClusterComputeResourceOfVm.js
Last active August 25, 2017 18:09
Get the Cluster of a vCenter VM
// VMware vRealize Orchestrator action sample
//
// Returns the cluster of a given vCenter VM
//
// For vRO 7.0+/vCenter 6.0+
//
// Action Inputs:
// vm - VC:VirtualMachine - vCenter VM
//
// Return type: VC:ClusterComputeResoure - the cluster to which the VM belongs
// VMware vRealize Orchestrator action sample
//
// Returns the vCenter ClusterComputeResource with the given name
// Assumes there is only 1
// Does a case-insensitive search
//
// For vRO 7.0+/vCenter 6.0+
//
// Action Inputs:
// clustername - string - Name of the cluster to find
@trisharia
trisharia / getAllCompatibleDatastoresForHostAndVm.js
Created August 25, 2017 18:32
Get all compatible Datastores for a vCenter Host and VM
// VMware vRealize Orchestrator action sample
//
// Get all compatible datastores for a given host, resource pool, and virtual machine.
// The datstore must have enough free storage space necessary for the VM, and must be
// accessible and not in an overall status of "Red".
//
// For vRO 7.0+/vCenter 6.0+
//
// Action Inputs:
// host - VC:HostSystem - vCenter host
@trisharia
trisharia / getParentCatalogResource.js
Created August 25, 2017 19:10
Get parent Catalog Resource in vRA
// VMware vRealize Orchestrator action sample
//
// Returns the parent of a given vCACCAFE:CatalogResource
// For example, find the Deployment resource of a Machine
//
// For vRA 7.0+/vRO 7.0+
//
// Action Inputs:
// childCatalogResource - vCACCAFE:CatalogResource - catalog resource for which to get the parent
// cafeHost - vCACCAFE:VCACHost - vRA CAFE host
@trisharia
trisharia / isVmATemplate.js
Created August 25, 2017 20:08
Is the vCenter VM a template?
// VMware vRealize Orchestrator action sample
//
// Determine whether the given vCenter VM is a template
//
// For vRO 7.0+/vCenter 6.0+
//
// Action Inputs:
// vm - VC:VirtualMachine - vCenter VM
//
// Return type: boolean - true if the VM is a template