eversys
Enthusiast
Enthusiast

Replacing a datastore - migrating VMs

Jump to solution

We have a VMware ESXi 4.0  installed on a SD-card and our datastore is on a dedicated internal  RAID array. Our datastore is running out of space... what we would like to do is remove the old HDDs and add new ones - hence, removing and recreating the RAID array and datastore.

What  is the best way of migrating our existing datastore / VMs from the old array to a  new one using vSphere or the vSphere CLI? How do we then re-associate the VMs on the SD-Card with the new Datastore? Any tips would be appreciated. Many thanks.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
PduPreez
VMware Employee
VMware Employee

Hi

It sounds like this is a single ESXi host.

You would have to copy/backup all the contents on the existing datastore to another location (external HDD) while all VMs are shut down.

Once that is done and you are sure the copied data is in tact you can:

- remove all VMs from inventory

- delete the datastore

- Shut down host

- replace HDD with new ones

- Start host and reconfigure new raid

- Create new datastore in ESXi

- Copy/restore all data back to the new datastore

- Browse datastore and add all VMs to inventory (create a list to make sure you get them all)

- Start VMs

Might be a good time to do a upgrade to ESXi5 as well Smiley Wink

Please award points for correct/helpful answers :smileycool:

View solution in original post

0 Kudos
13 Replies
tigerdeccan
Enthusiast
Enthusiast

If you can afford the downtime , then Ghost the hard dirks and plug new ones in . then add datastore and import all the VMs via vcenter  

0 Kudos
MauroBonder
Leadership
Leadership

Actually there is not much to be done, you'll have to get a temporary disk area to migrate these VMs to change your HD's Storage.

After copy all VM´s to temporary area you´ll dismapp all volumes from storage of VMware,  and do rescan in VMware, after change HD´s Storage, map new Storage LUNs and rescan again to appear your New DataStore, format all new volumes and back all VMs to new space and add to inventory if necessary.

If you have Storage VMotion licensed you can use it to migrate, or converter.

Via cli i dont know what command can help, lets hope other people reply. Smiley Wink

*Please, don't forget the awarding points for "helpful" and/or "correct" answers. *Por favor, não esqueça de atribuir os pontos se a resposta foi útil ou resolveu o problema.* Thank you/Obrigado
Shakaal
Hot Shot
Hot Shot

Hi,

Incase if you destroy RAID you will loose all the Data, so prior to destroying RAID, move all the VM's to a Shared Storage it can be a NAS or SAN. Incase of non availability of NAS & SAN, do a VI client to the ESX host from a Machine on which you have space available equivalent to the Space occupied by all the VM's on the current datastore. once you have VI client session to the host, Browse the Datastore and download the VM's to the Local Drive of your VI Client Machine.

(Note: Remove All the VM's from Inventory before Destroying the old RAID or Datastore)

Once you have replaced all the disks with new disks, create the RAID again, boot the Host, create VMFS datastore.

Now again do a VI client to the host, Browse the newly created datastore, this time upload all the VM's which were downloaded earlier.

Once all the VM's are uploaded Browse the datastore and go the folder of each VM, one by one. you will see a file wityh extension VMX, right click on the file and select "Add To Inventory". A wizard will appear follow the wizard and you are good to go.

Regards

PduPreez
VMware Employee
VMware Employee

Hi

It sounds like this is a single ESXi host.

You would have to copy/backup all the contents on the existing datastore to another location (external HDD) while all VMs are shut down.

Once that is done and you are sure the copied data is in tact you can:

- remove all VMs from inventory

- delete the datastore

- Shut down host

- replace HDD with new ones

- Start host and reconfigure new raid

- Create new datastore in ESXi

- Copy/restore all data back to the new datastore

- Browse datastore and add all VMs to inventory (create a list to make sure you get them all)

- Start VMs

Might be a good time to do a upgrade to ESXi5 as well Smiley Wink

Please award points for correct/helpful answers :smileycool:

View solution in original post

0 Kudos
eversys
Enthusiast
Enthusiast

Many thanks for the quick feedback.

OK, sounds pretty easy. Most of these steps can be done straight from the vSphere client - right?

If I delete the VMs from the inventory and on  re-creation of the inventory from my new datastore, are all the original  settings from each VM kept? Are these saved in the .vmx file?

If I chose to upgrade to ESXi 5, at what stage should I do this - before or after the migration? I have a ESXi, 4.0.0, 208167 - can I upgrade directly? Any risks here?

0 Kudos
tigerdeccan
Enthusiast
Enthusiast

Yes all the settings will be automatically imported.

Is better to migrate the datastores and then do the upgrade

follow this KB http://pubs.vmware.com/vsphere-50/topic/com.vmware.ICbase/PDF/vsphere-esxi-vcenter-server-50-upgrade...

0 Kudos
PduPreez
VMware Employee
VMware Employee

To Add:

Because of the small scale, I would personally install a fresh copy of ESXi5
Just note down all the configurations and redo them on new installation

After the new host is installed and reconfigured settings with new VMFS5 datastore (on new HDD)

you copy the VM folders back to the datastore add to inventory and start up.

Then you'd need to upgrade VMTools and shut down VMs

Next you need to upgrade VMs Virtual hardware (Always do VMTools 1st)

Start VMs up and all is well.

Risks: You have your VMs backed up to another location so you can't loose data

Please don't forget to award points for correct/helpful answers Smiley Wink

0 Kudos
eversys
Enthusiast
Enthusiast

Thanks for all the feedback.

This weekend I am following this whole proceedure. However, I have a big problem - copying the images to a local PC is taking ages! A 300GB VM image takes approximately 9 hours! I have at least 4 VMs which I need to move!!! Our network is running Gigabit.

Any ideas how I can speed this process up - otherwise I could run out of time.

0 Kudos
tigerdeccan
Enthusiast
Enthusiast

Did you manage to successfully accompish this ?

0 Kudos
eversys
Enthusiast
Enthusiast

No - unfortunately, we had to stop the migration because the copy process took too long (a 300GB image took approximately 9 hours!). We are planning replace the datastore this coming weekend... any ideas what the problem might have been and any tips on how we could increase the copy process of the VMs?

Thanks again for your continued help.

0 Kudos
JimKnopf99
Commander
Commander

Hi,

that a approx. 10 MB/s. What about your destination? Is it GB as well?

That looks like a 100 MB/s network.

And how did you copy your files?

Frank

If you find this information useful, please award points for "correct" or "helpful".
0 Kudos
eversys
Enthusiast
Enthusiast

To confirm, it's a Gigabit network - both source (current vmware ESXi) and destination (server to temporarily hold the vm host images) servers have 1000Mbit NICs. I used vSphere Client 4.x on the destination server to copy the files locally.

0 Kudos
eversys
Enthusiast
Enthusiast

@ PduPreez - migration worked just fine following your steps. We now have an ESXi 5, new datastore and everything works just fine - thanks.

Just one thing.... I have seen that our new ESXi 5 has a license limitation of 32GB RAM - is that per VM or VMware host itself? That would give us a real problem... I think our ESXi 4 had a limitation of 256GB RAM!

0 Kudos