Deleting media in a VMware vCloud Director catalog fails with the error: The requested operation could not be executed because media "" is mounted by VMs
search cancel

Deleting media in a VMware vCloud Director catalog fails with the error: The requested operation could not be executed because media "" is mounted by VMs

book

Article ID: 328653

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

Symptoms:
  • Cannot remove media in a vCloud Director catalog.
  • Removing media in a vCloud Director catalog fails.
  • You see the error:

    The requested operation could not be executed because media "<ISONAME>" is mounted by VMs. Please eject media from the VMs before deleting media


Cause

This issue occurs when ISO media is mounted to a virtual machine, but is not ejected before another ISO media is mounted.

For example:
  1. An ISO (iso1) is mounted on a virtual machine.
  2. An entry will be added to the vapp_vm_logical_disk table in the database with the (iso1) media id.
  3. An ISO (iso2) is mounted on the same virtual machine.
  4. An entry will be added to the vapp_vm_logical_disk table with (iso2) media id.
Even though the new media is mounted and presents to the virtual machine, the (iso1) media id still exists and is not removed from the database.

Resolution

This issue is resolved in VMware vCloud Director 5.5.3 available at VMware Downloads.

If you are unable to upgrade at this time, you can work around this issue by running the eject command multiple times.

To eject the media from the virtual machine:
  1. From vCloud Director, select the virtual machine that is mentioned in the error.
  2. Run the eject command multiple times in an attempt to clear the stale entries in the vCloud Director database.

    Note: You can log in to the vCloud Director database and check the table to determine how many ISOs have been added and run the eject procedure as many times as required.