VMware Cloud Community
Marotke
Contributor
Contributor

Cannot delete Datastore - "Not a known device"

We would like to delete a Datastore on our vSphere Server but it doesnt work ... We always get a "Not a known device" Error and were not sure why that is ... We had problems before with this specific Datastore, and thats why we wanted to delete it. Is it possible something is still linked to the Datastore and how do we find out if it is? What else could it be?

19 Replies
dbalcaraz
Expert
Expert

Hi,


Did you check this Datastore from an ESXi host?

I mean, connect via SSH and check the syslog.log located in /var/log

Did you try to unmount the Datastore first from one host instead of doing it in the Storage tab from vCenter?

-------------------------------------------------------- "I greet each challenge with expectation"
0 Kudos
Marotke
Contributor
Contributor

I'll look into connecting with SSH and will report back  ...

But yes, the Datastore was unmounted from a Host and the Host ist deleted already. Is that maybe a Problem? Should i have kept the Host?

0 Kudos
dbalcaraz
Expert
Expert

Well if only was unmounted from a host instead of doing it from the vCenter Inventory yes, this is the problem.

The problem is that the object is still referencing the Datastore that it doesn't more in the vSphere environment.

A nice solution for this, is to reboot the affected ESXi host but since you deleted it...

I would recommend you to go to the affected host, but maybe you can try and see if still the datastore in another host.

You can check it with: esxcli storage core device detached list and check the UID, it's the same as it appears on vCenter?

If it is, execute: esxcli storage core device detached remove –d naa.UID

By the way, which type of datastore is?

-------------------------------------------------------- "I greet each challenge with expectation"
0 Kudos
s_wieland
Enthusiast
Enthusiast

Hi Marotke,

was there a ISO images on this datastore, which is still connected to a VM as CD drive? You can figure it out using RVTools or PowerCLI:

Get-VM | Get-CDDrive | Where-Object {$_.ISOPath -match "<DATASTORE>"}

0 Kudos
Marotke
Contributor
Contributor

Hello!


Thanks for your help so far. I have trouble connecting to the console cause i dont know how to do it. Im new to this. We connect to the ESXi and vSphere Server through an IP and Username/Password Login. How do i get to the console? I will and can check better then.

Thanks in advance

0 Kudos
s_wieland
Enthusiast
Enthusiast

Hello Marotke,

the command is a powershell command using the VMware Powershell extension called PowerCLI.

To install the PowerCLI please start the powershell and enter "Install-Module -Name VMware.PowerCLI"

This will download and install all required packages.

After the installation you can use it directly in your powershell windows.

Use the command "Connect-VIServer <FQDN of vCenter>" to connect to the vCenter and after that the command above to identify the VM with the mounted ISO.

Another way which may be work is to browse to the datastore within the vCenter and open the "VMs" tab on this datastore. This will show all VMs with a relation to this datastore. Check this VMs for mounted ISOs and Snapshots.

0 Kudos
Marotke
Contributor
Contributor

I really have trouble getting into the console/shell ... It seems its not installed on our ESXi Server ... Im so new to this, i dont want to try to install it out of the blue ...

But i was able to check if any VM is still associated to the Datastore through the vSphere Client ... It is an empty list ... So there seems to be no VM or HOST connected to it ... Still i cannot delete it ...

May i should start from somewhere else: We have trouble with the VM and Datastore since some time: First we tried to extend the Datastore which didnt worked (but it worked fine with another similair Datastore) and then we wanted to rescue the VM and correspending Datastore which wasnt possible too (not enough space to start the VM). Now were at a point were we want to completely reinstall the VM and make a new Datastore. But we cant even delete the Datastore and still are not sure why.

I also have to say (like before): Im new to ESXi and vSphere and still learn to use this right. I have much more experience with more simple stuff like the vmware player and computers in general though.

0 Kudos
s_wieland
Enthusiast
Enthusiast

Hello Marotke,

the PowerCLI is nothing you have to install on the ESXi, it's powershell based, so you can install it directly on your Windows admin computer.

But please tell me more about this datastore. Is it a local datastore or is it located on a shared storage or on vSAN? And if it's a shared storage, how was it connected to the removed host? Was it fibre channel or NFS? And is the LUN still available on the shared storage or deleted, too?

Best regards,

Sebastian

0 Kudos
Marotke
Contributor
Contributor

First of all: Thanks for all the help.

Im still not sure how to use PowerCLI or the powershell with ESXi / vSphere ... But im still on it and might found out ... Like i said: Im new to to ESXi and vSphere ...

To answer your question though: The Datastore is located on a Dell Equalogic SAN ...

What we did: We extended the space on the SAN and then tried to increase the Datastore through the vSphere Client which failed ... It couldnt find any LUN which we dont know why ... It should have found one ... The strange is, we were able to increase the space in Windows, but it seems it was just visually cause in vSphere the machine still showed no space left.

This problems seemed to doom the whole VM and Datastore it seems ... We did the exact same thing with another VM and Datastore which worked completely fine ... It found a LUN and we were able to increase it ...

Another staffmember did some stuff on the vSphere Server so i dont know exactly if the LUN is removed. The specific Datastore hat trouble to find the LUN since we wanted to increase it.

I'm not sure how it is connected (fibre channel or NFS). I wasnt part of building this System, im just trying to administrate it ... Is there any way to find out? I really have trouble to see through this all right at the moment.

0 Kudos
s_wieland
Enthusiast
Enthusiast

Hello Marotke,

the EqualLogic is a shared storage connected by iSCSI. But your explanations are confusing me, because several reasons for this behaviour would be possible and without access to your environment it's hard to figure out why these things happen.

Because normally an extension of a datastore has no impact to the virtual machine guest OS, because this is completely independent from each other. The only possible reason would be if you have directly mounted the iSCSI disk inside the virtual machine.

But back to your datastore problem. Due to the reason that it's an iSCSI based target, what iSCSI initiator are you using, the ESXi softwware initiator or the hardware initiator of the NIC?

Please try to add the LUN to another host, connecto to this host using ssh and run a "vmkfstools -V" on the ESXi. Then try to open the properties of the datastore and try the expansion again.

Kind regards,

Sebastian

0 Kudos
flynmooney
Enthusiast
Enthusiast

I went through a somewhat similar but different situation yesterday with a datastore which was inaccessible so I hope this helps.  The problem I had was a ghosted VM still running which wouldn't let the datastore unmount.  I followed this article and some others to remove the inaccesible luns. Step 3 will identify if there are any VM's running or ghosted VMs running from that resource.  Detach a Device and Remove a LUN   I'd think hard before running step 4 as it would take a manual cli to be able to turn the lun back on if it could ever be used in the future.  This all happened from a bad run of SRM and had a PDL event for a few volumes when VMs were still running.

0 Kudos
Marotke
Contributor
Contributor

Because normally an extension of a datastore has no impact to the virtual machine guest OS, because this is completely independent from each other.

But doesnt an Virtual Machine needs a Datastore to work? Isnt the Datastore like the HD of the Virtual Machine? Thats how far i understood this by now ... Sure it shouldnt affect the OS itself, but the Space on it. Thats why we wanted to extend the Datastore: The Space of the Virtual Machine was running low. We had another VM that was running low on space, and it also used a Datastore which we extended just fine.

But your explanations are confusing me, because several reasons for this behaviour would be possible and without access to your environment it's hard to figure out why these things happen.

Yes i understand and think so too, its always hard to figure out these things without "seeing them"

But back to your datastore problem. Due to the reason that it's an iSCSI based target, what iSCSI initiator are you using, the ESXi softwware initiator or the hardware initiator of the NIC?

Please try to add the LUN to another host, connecto to this host using ssh and run a "vmkfstools -V" on the ESXi. Then try to open the properties of the datastore and try the expansion again.

I really have a hard time following you all with what you say cause im so new to ESXi and vSphere ... Also the problem is: I didnt installed and configured the ESXi / vSphere System, i just administrate it and try to understand it ... I think i basically understand, but i really need to learn a lot i think ...

I sadly cant tell you which initiator we are using... How can i figure this out? We cannot try the expansion anymore cause we deleted the VM and the Datastore is marked as Inactive ... Our plan was to delete everything regarding the VM including the Datastore .... Then adding the Datastore again, creating a new VM and reinstalling the OS on that again ...

Also im still not sure how to connect to the host with SSH ... We just use this GUI Interfaces ... Is there any way to connect to it through the Gui?

@flynmooney and everyone else: I appreciate all the help but please understand that im really really new to this and i have a hard time following what you are saying. I sadly dont even know what SRM and PDL is.

0 Kudos
Marotke
Contributor
Contributor

Hello

Here Screenshots of the Problem ... May it will help to find out more ...

Can anyone of you tell me how to connect to the Powershell of a ESXi Server? ESXi seems to be installed on a DELL iDRAC Server if that also helps any further

ESX01.png

ESX02.PNG

0 Kudos
Marotke
Contributor
Contributor

Also i confused HOST with a VIRTUAL MACHINE before ... I thought a VIRTUAL MACHINE is descirbed as HOST ... So all HOSTS are still there, but we deleted the Virtual Machine ... I would love to start this thread from new cause its all full of confusion ... Also our ESXi is in German and i always need to find out the English Translation of some things which makes it even harder ...

0 Kudos
CaribouSolution
Contributor
Contributor

For each host, Rescan Storage.
The Datastore will disappear from the host, and once gone from all hosts, it'll disappear from vCenter.

pastedImage_0.png

huykevin1
Contributor
Contributor

In my case, I have to reboot esxi to resolve the issue.

0 Kudos
tahmeed
Enthusiast
Enthusiast

Physical LUN might not be available 

0 Kudos
maksym007
Expert
Expert

Rescan adapters. 

I had the same issue - in my case it was a datastore from the backup to restore one VM. 

Was failed to unmap.

0 Kudos
yemhoang
Contributor
Contributor

a few things can make your datastore undeletable like: ISO map to another vm, template vm created, snapshot another vm,...
You can check it to make sure haven't another linked to datastore

0 Kudos