Error "Bad request: Expression '' is not a comparison expression" when attempting to eject ISO from a shared catalog in VMware Cloud Director.
search cancel

Error "Bad request: Expression '' is not a comparison expression" when attempting to eject ISO from a shared catalog in VMware Cloud Director.

book

Article ID: 427024

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

When a System Administrator attempts to eject media (ISO) from a shared catalog within the specific Organization (Org) where the catalog was originally created, the operation fails. Instead of displaying the list of Virtual Machines (VMs) to which the ISO is attached, the Cloud Director UI returns the following error:

Bad request: Expression '' is not a comparison expression.

This issue occurs specifically when navigating to the Libraries > Media & Other section of the "Provider" or "Owner" Organization and attempting to view the attachment list for an ISO that is shared globally.

Environment

Cloud Director 10.x

Cause

This is identified as a  known issue in the way Cloud Director parses the relationship between shared catalog objects and cross-organizational VM attachments.

While a tenant user in a "consumer" Organization can successfully see their own VMs when clicking eject, the System Administrator—accessing the media from the "source" Organization—triggers an empty comparison expression in the underlying API query. Even though the System Administrator has global permissions, the UI fails to correctly build the list of VMs across different Org VDCs when the request originates from the shared catalog's home Org.

Resolution

This issue is scheduled to be addressed in the upcoming release of VMware Cloud Director 10.6.1.3 where the details of the ORG and VM details will be provided in UI itself. 

Workaround

Until the fix is available, users can manage media attachments using one of the following methods:

  1. Eject from the Consumer Org: Navigate to the specific Organization and VDC where the VM is located. Eject the media directly from the VM details or Virtual Machines list rather than from the Catalog level.

  2. API Method: Use the query service to find VMs with the specific ISO attached: GET /api/query?type=vm&filter=media==[ISO_NAME_OR_HREF]

  3. To determine which VMs are using this ISO, execute the command below against the VCD DB

     

    select org.name AS org_name, 
    org_vdc_name,
    vm.vapp_name,
    vm.name AS vm_name,
    vmld.mountedmedia_id AS media_id,
    vm.id AS vm_id,
    vm.moref AS vm_moref 
    FROM vapp_vm_logical_disk vmld
    JOIN ui_vm_lease_list_view vm
    ON vmld.vms_id = vm.id
    JOIN catalog_item ci
    ON ci.entity_id = vmld.mountedmedia_id
    JOIN organization org
    ON org.org_id = vm.org_id
    WHERE ci.catalog_id = '<catalog_id>'
    AND ci.name = '<media_name>'