Created
April 20, 2018 17:39
-
-
Save dlinsley/fe86bd5595b1b3a6db1d316c549ecd38 to your computer and use it in GitHub Desktop.
Move VM to root ResourcePool of Cluster
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// VMware vRealize Orchestrator action sample | |
// Determines the ComputeResource or ClusterComputeResource of the VM. | |
// Assumes the VM is part of a DRS Cluster and a member of a child resoure pool in the cluster. | |
// | |
// Moves / Migrates the VM to the root ResourcePool of the Cluster. | |
// | |
//Action Inputs: | |
// vm - VC:VirtualMachine | |
// | |
//Return type: void | |
var cluster = System.getModule("com.vmware.library.vc.cluster").getComputeResourceOfVm(vm); | |
System.log("Migrating VM: "+vm.name+" to root resource pool of cluster: "+cluster.name); | |
var task = vm.migrateVM_Task(cluster.resourcePool, null, VcVirtualMachineMovePriority.defaultPriority, null); | |
var actionResult = System.getModule("com.vmware.library.vc.basic").vim3WaitTaskEnd(task,true,2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment