VMware Cloud Community
tivs
Enthusiast
Enthusiast
Jump to solution

snapshot deletion from a selective cluster.

Hi All,

  

       Task:- Delete the snapshot of all VM's from a selective cluster (I have 4 clusters, i want to select a cluster ).

       Issue:- I am able to select the cluster and get all VM's information but at the time of snapshot deletion it says that no snapshot are avalible.  I attached the workflow. could you help me in fixing the workflow (missing the logic). Thank you inadvance for the help.

Reply
0 Kudos
1 Solution

Accepted Solutions
tschoergez
Leadership
Leadership
Jump to solution

Hi,

I recommend to duplicate the getPropertiesForAllSnapshotTask action, and change the first line there from

var vms = VcPlugin.getAllVirtualMachines();

to

var vms = System.getModule("com.vmware.library.vc.cluster").getAllVMsOfCluster(cluster);

Don't forget to add a parameter named "cluster" of type clustercomputeResource to the action.

Then you can have almost the original library workflow, only thing to change there is to call your action rather that the original action, and bind the cluster parameter.

Cheers,

Joerg

View solution in original post

Reply
0 Kudos
1 Reply
tschoergez
Leadership
Leadership
Jump to solution

Hi,

I recommend to duplicate the getPropertiesForAllSnapshotTask action, and change the first line there from

var vms = VcPlugin.getAllVirtualMachines();

to

var vms = System.getModule("com.vmware.library.vc.cluster").getAllVMsOfCluster(cluster);

Don't forget to add a parameter named "cluster" of type clustercomputeResource to the action.

Then you can have almost the original library workflow, only thing to change there is to call your action rather that the original action, and bind the cluster parameter.

Cheers,

Joerg

Reply
0 Kudos