ESXi

 View Only
Expand all | Collapse all

Replacing a datastore - migrating VMs

  • 1.  Replacing a datastore - migrating VMs

    Posted Feb 07, 2012 10:09 AM

    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.



  • 2.  RE: Replacing a datastore - migrating VMs

    Posted Feb 07, 2012 10:17 AM

    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  



  • 3.  RE: Replacing a datastore - migrating VMs

    Broadcom Employee
    Posted Feb 07, 2012 10:17 AM

    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. :smileywink:



  • 4.  RE: Replacing a datastore - migrating VMs

    Posted Feb 07, 2012 10:22 AM

    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



  • 5.  RE: Replacing a datastore - migrating VMs
    Best Answer

    Broadcom Employee
    Posted Feb 07, 2012 10:23 AM

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

    Please award points for correct/helpful answers :smileycool:



  • 6.  RE: Replacing a datastore - migrating VMs

    Posted Feb 07, 2012 11:48 AM

    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?



  • 7.  RE: Replacing a datastore - migrating VMs

    Posted Feb 07, 2012 11:52 AM

    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-guide.pdf



  • 8.  RE: Replacing a datastore - migrating VMs

    Broadcom Employee
    Posted Feb 07, 2012 02:03 PM

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



  • 9.  RE: Replacing a datastore - migrating VMs

    Posted Feb 11, 2012 01:39 PM

    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.



  • 10.  RE: Replacing a datastore - migrating VMs

    Posted Feb 13, 2012 01:55 PM

    Did you manage to successfully accompish this ?



  • 11.  RE: Replacing a datastore - migrating VMs

    Posted Apr 16, 2012 11:24 AM

    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.



  • 12.  RE: Replacing a datastore - migrating VMs

    Posted Apr 16, 2012 12:21 PM

    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



  • 13.  RE: Replacing a datastore - migrating VMs

    Posted Apr 16, 2012 01:10 PM

    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.



  • 14.  RE: Replacing a datastore - migrating VMs

    Posted Apr 23, 2012 03:39 PM

    @ 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!