attach_iso_to_vm
Mount a datastore ISO to a VM's virtual CD-ROM drive. Works on powered-on or off VMs, replacing any existing ISO or adding a new one on the IDE controller.
Instructions
[WRITE] Mount a datastore ISO into a VM's virtual CD-ROM drive.
Reconfigures the existing CD-ROM (replacing any currently mounted ISO) or adds a new CD-ROM on the VM's IDE controller if none exists; fails with a clear message if the VM has no IDE controller. Works whether the VM is powered on or off — the device is set connected and start-connected. Find ISO files first with browse_datastore using pattern "*.iso". Audited to ~/.vmware/audit.db.
Args: vm_name: Exact VM name as shown in vCenter inventory. iso_ds_path: Full datastore path in bracket format, e.g. "[datastore1] iso/ubuntu-22.04.iso" (datastore name in brackets, then the path relative to the datastore root). target: vCenter/ESXi target name from config.yaml; omit to use the default target.
Returns: Status string confirming attachment, or a VM-not-found / no-IDE-controller error.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vm_name | Yes | ||
| iso_ds_path | Yes | ||
| target | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |