Mounted medias inventory


When you connect a media (ISO file) on VCD, there is no place to tell on VCD portal that there is an ISO file mounted on a specific VM. So many ISO stay mounted on VMs without being removed.

So what I want to do is to do an inventory of VMs with mounted ISO files and the name of the mounted ISO file as its shown on VCD catalog.

With PowerCLI, I did not find how to get that information on VCD.

Then I tried by querying the vCenter instead but I got only a path on a datastore which does not tell me what is the name of the corresponding ISO Name as shown in VCD I only have the path with multiple strange characters like [Datastore_Name] Cloud/media/725129e2-45df-4024-87a7-f7a4a2a96085/c0d971bc-9560-4d60-b0c9-4c48bc4bc177/media-a201b08a-59db-4fe2-b417-f3f5c94627e8.iso

This is the used script

            $Log = @()


                        foreach ($CIVM in (Get-CIVM -Org Org_Name)) {

                                               $VM = $CIVM | Get-VM

                                               $CDDrive= $VM | Get-CDDrive

                                               $Report = ""| Select vAppName, VMName, ConnectionState, HostDevice, IsoPath, RemoteDevice

                                               $Report.vAppName = $CIVM.VApp

                                               $Report.VMName = $CIVM.Name

                                               $Report.ConnectionState = $CDDrive.ConnectionState

                                               $Report.HostDevice = $CDDrive.HostDevice

                                               $Report.IsoPath = $CDDrive.IsoPath

                                               $Report.RemoteDevice = $CDDrive.RemoteDevice

                                               $Log += $Report



            $exitLogFile = "Org_Name-List.csv"


            $Log | Export-Csv "$exitLogFile" -delimiter ";" -NoTypeInformation;

But from there I don’t know where to go to get the names as shown on VCD.

Any help would be appreciated.


0 Kudos
1 Reply

Hi Eco!

I thought it is possible to retrieve names of catalog items using the follows:

$cat = Get-Catalog

I can view catalog item names as using this method. Hope this helps!

0 Kudos