VMware Cloud Community
Nicolas400
Contributor
Contributor

how to Connect and Disconnect CD Drive from CLI command line?

Hi, I have a VMWare vSphere server running 2 VM.

I'm wondering if there is a Command to connect and diconnect  the CD Drive to the VM guest OS.

When I deploy the VMs I put the CD/DVD drive assigned to an iso image.

I don't have the vSphere Client installed in the site. So I'm trying to use command lines.

Best Regards

Nicolas

0 Kudos
1 Reply
djciaro
Expert
Expert

You can do the following:

vim-cmd vmsvc/getallvms

When you see the list of VMs, take note of the vmid of the machine in question

then use:

vim-cmd vmsvc/device.connection xx 3002 false     xx being the VMID of your VM

this will disconnect the cdrom from your VM, it will still show up as the device but it will no longer be connected.

to connect you can use vim-cmd vmsvc/device.connection xx 3002 true

good luck

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!