Connection control operation failed for disk ‘ide0:0’

Once you want to remove CD/DVD you may receive an error: Connection control operation failed for disk ‘ide0:0’. Also once you want to run PowerCli script to address VMSA-2022-0001 vulnerability, you may get similar error:

The reason for this behavior is that operating system has the CD-ROM locked. Of course you can manually eject every single CD/DVD, but much easier would be to run this script to force the override of removing the CD/DVD-ROM.

We need to focus on those two settings:

cdrom.showIsoLockWarning = "FALSE"
msg.autoanswer = "TRUE"

Let’s have a look how to put this all in to the script:

$vms =  Get-VM
 
foreach ($vm in $vms) {
 
New-AdvancedSetting -Entity $vm -Name cdrom.showIsoLockWarning -Value False -Confirm:$false -Force:$true
New-AdvancedSetting -Entity $vm -Name msg.autoanswer -Value TRUE -Confirm:$false -Force:$true
 
}

This action will go through every single VM in your vCenter. Of course we could target specific VM, but in this case we wont for all VMs to behavior this way.

Once script finish you can run again remediation script from this article to apply workaround for VMSA-2022-0001

Please like and share to spread the knowledge in the community.

If you want to chat with me please use Twitter: @AngrySysOps

Visit my FB page: https://www.facebook.com/AngrySysOps

Read my blog: https://angrysysops.com

Subscribe to my channel : https://www.youtube.com/channel/UCRTcKGl0neismSRpDMK_M4A

Please leave the comment