Unmounting all the CD-ROMs of all VMs in a cluster
This is an easy recipe to start with, but one you can really make it work for your existing infrastructure. The workflow will unmount all CD-ROMs from a running VM. A mounted CD-ROM may block a VM from being vMotioned.
Getting ready
We need a VM that can mount a CD-ROM either as an ISO from a host or from the client.
Before you start the workflow, make sure that the VM is powered on and has an ISO connected to it.
How to do it...
Create a new workflow with the following variables:
Name
Type
Section
Use
cluster
VC:ClusterComputerResource
IN
Used to input the cluster
clusterVMs
Array of VC:VirtualMachine
Attribute
Use to capture all VMs in a cluster
Add the
getAllVMsOfCluster
action to the schema and assign thecluster
in-parameter and theclusterVMs
attribute to it as actionResult.Now, add a
Foreach
element to the schema and assign the workflow Disconnect all detachable devices from a running virtual machine.Assign the
Foreach
element...