VMware Cloud Community
Eudmin
Enthusiast
Enthusiast
Jump to solution

Any way to list CD/DVD configurations to find which VM is preventing me from deleting a datastore?

I have emptied a datastore to move the files to new storage.  It's a datastore that I used for ISO images to do installs. 

I unmounted it from the hosts.  But I can't delete it from inventory.  It's not mounted anywhere, but I'm betting that a VM somewhere has a CD/DVD configured to point at it despite it not being connected on any of them.  Is there a way to query the inventory to see which one it might be so I can reset that one to "Client Device" to free it up?  I'm not finding any identifier in a log anywhere associated with the error message that pops up when vCenter tells me I can't delete it.

Reply
0 Kudos
1 Solution

Accepted Solutions
memaad
Virtuoso
Virtuoso
Jump to solution

check if esxi host is configured to use this datastore to dump logs.

Check if any VM which were migrated off of this datastore had snapshot and referring to it.

I know there is sql query outthere, which can help us to identify what object is using the datastore, I am not able to find it... 

 

Mohammed | Mark it as helpful or correct if my suggestion is useful.

View solution in original post

6 Replies
memaad
Virtuoso
Virtuoso
Jump to solution

1. If you have CD / ISO mounted, you will see VM listed against datastore.

2. If VM have CD rom pointed to iso , but  connected is not checked , you will see unable to unmount datastore. You will not see VM against datastore.

 

Power cli

Get-VM | FT Name, @{Label="ISO file"; Expression = { ($_ | Get-CDDrive).ISOPath }} 

 

https://tomaskalabis.com/wordpress/vmware-powercli-how-to-list-vms-with-mounted-iso-and-dismount-the... 

 

https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Get-List-of-VMs-which-has-particular-I...

Mohammed | Mark it as helpful or correct if my suggestion is useful.
Eudmin
Enthusiast
Enthusiast
Jump to solution

Thanks!  Apparently it isn't the CD/DVD keeping it from working like I assumed.  None of them show up with the PowerCli commands.  

No VMs are on the datastore, no templates are using it.    

Despite that, when I try to remove the datastore the task on the host that is performing the remove says "The resource 'xxxx' is in use." with no other details.  

Reply
0 Kudos
memaad
Virtuoso
Virtuoso
Jump to solution

check if esxi host is configured to use this datastore to dump logs.

Check if any VM which were migrated off of this datastore had snapshot and referring to it.

I know there is sql query outthere, which can help us to identify what object is using the datastore, I am not able to find it... 

 

Mohammed | Mark it as helpful or correct if my suggestion is useful.
Eudmin
Enthusiast
Enthusiast
Jump to solution

I believe dump logs is the answer.  There is a folder in the datastore called "vmkdump" with one dumpfile in it from 2017. 

I'm looking up where to re-configure that now.  

Reply
0 Kudos
LisandrodeCuba
Enthusiast
Enthusiast
Jump to solution

To find vm’s with datastore iso attached there are many ways I always use rvtools but reading the replies you have a different problem. Have you checked this already?

https://kb.vmware.com/s/article/1015791

regards

lisandro

Reply
0 Kudos
RajeevVCP4
Expert
Expert
Jump to solution

Did you try direct from host UI/root

 

Rajeev Chauhan
VCIX-DCV6.5/VSAN/VXRAIL
Please mark help full or correct if my answer is use full for you
Reply
0 Kudos