In powershell it’s really easy to disconnect and reconnect cdrom drives:
To see all connected drives:
Get-VM | where {($_ | Get-CDDrive).ISOPath -ne $null} |FT Name, @{Label="ISO file"; Expression = { ($_ | Get-CDDrive).ISOPath }}
To auto disconnect all:
Get-VM | Get-CDDrive | Where {$_.ConnectionState.Connected} | Set-CDDrive -Connected $false -Confirm:$false
Great post!
Here is other PowerCLI onliner to disconnect all mounted VM ISOs:
Get-VM | Get-CDDrive | Where {$_.ISOPath -ne $null} | Set-CDDrive -NoMedia -Confirm:$false
Extracted from:
http://www.sysadmit.com/2017/12/vmware-desconectar-cd-dvd-iso-PowerCLI.html
Thanks for reading and sharing