Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1958
  • Last Modified:

How to reattach datastore to esx 4.1.0 host

Hi,

I have 3 VM in a datastore hosted by a esx 4.1.0.
If I remove the 3 VM's from the inventory and delete the datastore,
how can I reattach the datastore and find the VM's again?

There is a similar EE case with an esx 3.5 :
http://www.experts-exchange.com/Software/VMWare/Q_26199478.html?sfQueryTermInfo=1+10+3.5+30+datastor+esx+host+reattach

But this does not work on the 4.1.0, if I delete and add the datastore,
the VM's are gone.

Any Idéas?

//zazagor
0
zazagor
Asked:
zazagor
  • 6
  • 3
  • 2
2 Solutions
 
coolsport00Commented:
If you only remove the VMs from Inventory and do not migrate them to another datastore, your VMs will be deleted since removing the datastore/re-adding it reformats the datastore. You will lose your VMs. You have to migrate them off, then migrate them back when you re-add your datastore.

Regards,
~coolsport00
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
If removed you removed the VMs and deleted the datastore, the metadata has been removed from the datastore, and the VMs and original datastore are gone.

These can be recovered at large expense from a Data Recovery specialist such as http://www.krollontrack.com/ if you do not have a means of restore, or the VMs are very important.

This however is costly.

0
 
coolsport00Commented:
The steps involved in the above link can still happen with 4.x. What was suggested in that link was after detaching storage and reinstalling ESX, you can simply reattach the storage and the VMs will still be on the storage because the storage is already a formatted VMFS3 volume, and ESX will 'see' it as such.

~coolsport00
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
zazagorAuthor Commented:
So, if I delete the datastore and reinstall the ESX it will find the datastore and reattach it without formatting?

//zazagor
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
No, that is not true, if you havre removed the datastore, you have deleted it.
0
 
coolsport00Commented:
No...if you delete the datastore, it will then delete everything on the datastore, then when you re-attach it, it will re-format it. So, what you simply do is detach the datastore (don't remove/delete it from within vSphere Client/vCenter). If you then need to rebuild ESX/ESXi, do so, then simply re-attach your storage. When you re-add your storage, your host should see the datastore as being a VMFS volume and simply 'add' and not reformat. You then would only need to re-add your VMs to inventory.

~coolsport00
0
 
coolsport00Commented:
This is easy to test on your own if you have a separate test environment. You can create a small LUN and present it to your host, then add it. Create a simple VM. Then, detach the storage from your host by disconnecting the SAN cable (for example) from your host, or disconnecting the RAID (if local storage). Reconnect the cable, then re-add your LUN/datastore and your VM should still be there.

~coolsport00
0
 
zazagorAuthor Commented:
Thank you, great answers :)

Is there really no way of removing/detaching the datastore from vSphere Client/vCenter or maybe from the command-line without destroying the data?  I have a test environment but it is not physically near me.

//zazagor
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
You don't remove the datastore, you just leave it alone!
0
 
coolsport00Commented:
As mentioned above, yes...you can detach storage from your host by simply disconnecting cables, either SAN cables or disk SATA, RAID, or IDE cables, and your data will be in tact. Otherwise, no.

~coolsport00
0
 
coolsport00Commented:
Yeah, unless you need to change block size of a datastore, you really don't need to remove it. Personally, I do 'detaches' of my DSs when I upgrade my hosts; otherwise, I don't mess with them...

~coolsport00
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 6
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now