We help IT Professionals succeed at work.

How to reattach datastore to esx 4.1.0 host

zazagor
zazagor asked
on
Medium Priority
1,991 Views
Last Modified: 2012-05-11
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
Comment
Watch Question

Top Expert 2010
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Andrew Hancock (VMware vExpert PRO / EE Fellow)VMware and Virtualization Consultant
CERTIFIED EXPERT
Fellow
Expert of the Year 2017
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Top Expert 2010

Commented:
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

Author

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

//zazagor
Andrew Hancock (VMware vExpert PRO / EE Fellow)VMware and Virtualization Consultant
CERTIFIED EXPERT
Fellow
Expert of the Year 2017

Commented:
No, that is not true, if you havre removed the datastore, you have deleted it.
Top Expert 2010

Commented:
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
Top Expert 2010

Commented:
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

Author

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
Andrew Hancock (VMware vExpert PRO / EE Fellow)VMware and Virtualization Consultant
CERTIFIED EXPERT
Fellow
Expert of the Year 2017

Commented:
You don't remove the datastore, you just leave it alone!
Top Expert 2010

Commented:
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
Top Expert 2010

Commented:
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
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.