2

Renaming a datastore fails with “The name ‘datastore_name’ already exists”

In my recent experiments with various NAS\SAN solutions I suddenly came up across an issue where my usual name for my iSCSI datastore all of a sudden failed when trying to add it into my ESXi environment.

Having decided to do some more SAN\NAS testing using several different solutions I had made the decision to power down all of my VM’s so that I was only using the single IOmeter VM, at the same time I had also decided to power down 2 of my ESXi servers so that I was using similar resources across all tested platforms. With the ESXi servers powered down I then had to move all of the VM’s to different storage, using Veeams’ FastSCP I copied the VM’s across from my existing Openfiler environment to my main IX4 rather than my ESXi dedicated one.

Going through various tests with Openfiler and FreeNAS went ok and I was able to reuse my commonly used datastore names after deleting the previous ones (removing the iSCSI target and un-mounting the NFS mounts). Midway through the testing however I realised that my vSphere Stats plugin on this site wasn’t being updated (obviously because the vCenter server was down) so I decided to bring up my DC and vCenter servers to allow for regular stat updates. Using ESXi server #2 and the dedicated IX4 I had my environment back up and running as soon as the files were copied across from my primary IX4 (FastSCP rocks btw) and the vSphere Stats widget was getting regular updates.

It was during my next round of testing that issues started occurring. I had just deleted the old datastores (both NFS and iSCSI) and was trying to create new ones when I started getting errors about the name already existing, but the vSphere client didn’t actually reflect that.

 

 

 

 

 

 

As you can see from the picture above I don’t have a datastore named DS01 so I couldn’t understand why I couldn’t create\rename my datastores as I had previously.

I had to dig a little deeper and discover what had happened and why.

After a little further investigation highlighted my mistake, when I had powered down my ESXi servers, instead of migrating the servers to another datastore properly (using vMotion), I had simply used FastSCP to copy the files across and that was the mistake. When I was using the vSphere client during my testing I had been connecting directly to the ESXi server rather than the vCenter server, if I had been connected to the vCenter server I would have seen that I had a large number of inaccessible VMs.

 

 

 

 

 

 

 

 

 

 

 

 

 

A further look at the storage map on the offline ESXi server would also have shown me this.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

So I had now found out why I couldn’t create\rename my datastore to DS01, it was indeed still being used, although the old datastore didn’t actually exist anymore.

The fix? Simple, I powered on the ESXi server and removed the inaccessible VMs and the result was I was now able to rename my datastore to what I wanted 🙂

Simon

2 Comments

  1. I love you! This was the solution to my problem – my iSCSI-NAS-System failed overnight (for whatever reason) and we managed to mount it again, but it added a prefix “snap-longid” to the datastore and we couldn’t rename it. After we removed every virtual machine in the vsphere-client, that depended on that datastore, we were able to rename it and keep the old name!

  2. Thanks, convinced me to dig further, and found the one VM that was still holding on to an ISO that had been stored on the defunct Datastore.

Leave a Reply to Peter Zubachl Cancel reply

Your email address will not be published. Required fields are marked *