Another day - another dirty - quicky.
So you’ve got a bunch of hosts and some VMs there. Some of those have iso files attached. Some of them shouldn’t. Especially if that ISO is not accessible for all nodes in the cluster.
You can get an error like this:
Now, getting vm after vm can be a little overwhelming, right?
We could do a clean sweep and remove all DVDs from ALL Vms, but that’s a little to… Trigger happy.
So here’s a oneliner that will query your ClusterNodes and display necessary information in Out-GridView.
This will allow us to select only specific VMs and click OK to dismount ISO from their DVD drive.
Set-VMDvDDrive does not accept pipeline input, we’re doing a foreach-object loop. If you select Cancel - it won’t dismount a thing: