radicalman
Contributor
Contributor

Migrating ESX server to larger disks

Jump to solution

I want to upgrade my ESX 3.0.2 system to larger disks.

I'm a bit at a loss how to do this. I can install the target disk into my ESX server, but how do I transfer the existing ESX data?

Do I boot to single-user at the console and use something like rsync or cp -rp?

Do I have to reinstall ESX on the new disk, and then transfer my VMs somehow?

Are there tools that can help here?

Thanks for any tips!

0 Kudos
1 Solution

Accepted Solutions
radman
Enthusiast
Enthusiast

That certainly looks right.

View solution in original post

0 Kudos
12 Replies
Dave_Mishchenko
Immortal
Immortal

What I would suggest is backing up your VMs to a network share. You could use esXpress or VMware Converter, both of which will do the job free. You can then pull out the drives that you're currently using and then swap in the larger drives. Then install ESX from scratch and restore the VMs from the network share. If any thing goes wrong with the new install or restore process, you can always swap in the old drives and bring your old install back online.

radicalman
Contributor
Contributor

That's certainly one viable approach, thanks.

If I were going to go that route, I guess I'd install a larger disk (not my target), format it under the COS as an ext3 filesystem, mount it under the COS, and then simply do a disk-to-disk copy of the VMs. I could then install ESX on a (different) target disk, and mount and copy back my VMs when done.

I was hoping to not have to manually recreate my inventory, however - I have about 12 VMs on my server in several folders.

0 Kudos
virtualdud3
Expert
Expert

Another option is to configure an Linux box as either an iSCSI target or as an NFS server. Then, connect this iSCSI/NFS to your ESX server, and copy the VMs.

This really isn't all that different from Dave's suggestion.

I am not trying to speak for Dave, but I believe his whole reason for pulling-out the drives hosting your existing ESX install is to give you a fool-proof "rollback" should something go wrong with your new installation.

This may be the easiest way to go, as installing ESX if fairly quick. Recreating folders, etc. might take a bit of time but it might be worth the additional knowing that if something goes wrong, you only have to install the old drives and you are ready to go - no harm, no foul.

############### Under no circumstances are you to award me any points. Thanks!!!
0 Kudos
radicalman
Contributor
Contributor

I'm definitely looking at pulling out the drives - no question. The only twist to my approach was to do the disk-to-disk copy first - I don't have sufficient network storage around (I'm just a lowly developer with a single ESX server :-). That's faster also. I can install four drives in my server, and ESX is currently only using two. With the larger disks it can fit on a single drive (I plan to RAID/mirror it when done, but first things first). But I really don't want to recreate the Inventory from scratch if possible (including all the notes, that somehow seem to get lost when you remove/add a VM to your inventory).

I never looked at esXpress before, and don't quite get it. It does seem to promise a lot. But I don't get how you could backup to local storage from within a VBA/VM itself? Could I perhaps format a drive natively and simply mount it into the VBA, then backup to it? That could definitely work, if that's the model. Is the "free download" version sufficiently featured? There's always a catch :smileyblush:

Maybe it would help to describe my plan better:

I currently have disks 0+1 in a single LUN (maybe I add an esXpress VBA)

I plan to:

- add disk 2 which is larger than 0+1

- I format/mount it into a VM (the esXpress VBA?)

- I backup/copy my VMs to disk 2

- I remove disks 0+1 and replace with larger disks (RAID mirrored)

- I install ESX on disks 0+1 (and maybe add the esXpress VBA manually)

- I mount disk 2 and restore my VMs, then scrub the disk and use it for extra storage

Does that sound viable? Will esXpress do what I want here, and preserve my Inventory in a backup to mounted disk 2?

Thanks!

0 Kudos
wila
Immortal
Immortal

Sounds like you don't have virtual center either.

There are many ways to skin this cat, all of the above will work. But if you wish to move VMs to another LUN then you could also use this script:

http://communities.vmware.com/thread/89885

In order to use that you would shut down your host.

Add the new disks.

Boot your host again and create a new VMFS storage for your VMs

Shut down the VM that you wish to move to the new local storage location

Use the vm-relocate.sh script to move the VM,

Boot your VM, it is now on the new storage, keep the UUID when the VM asks on boot.

for example if your vmx is named: ProductionServer.vmx, old LUN: Storage1 and new LUN: Live then you would use a command line like:

vm-relocate.sh ProductionServer /vmfs/volumes/Live/ProductionServer

Where i am assuming that you wish to store the vm in the similarly named vmfs folder "ProductionServer"

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
0 Kudos
radicalman
Contributor
Contributor

Sounds like you don't have virtual center either.

But I do - what did I say to make you conclude that I don't? Am I overlooking something?

There are many ways to skin this cat, all of the above will work. But if you wish to move VMs to another LUN then you could also use this script:

http://communities.vmware.com/thread/89885

Thanks!

0 Kudos
radicalman
Contributor
Contributor

I guess the issue boils down to this:

I don't want to retain my old disks at all. So I definitely need to reinstall ESX.

What's the easiest way to preserve my VMs and VC Inventory through this migration?

Preserving VMs looks relatively easy. Preserving the VC Inventory (given that I have a single ESX server) seems hard. I'm not clear on where that Inventory is stored exactly and how to backup/restore it onto a new ESX installation.

0 Kudos
wila
Immortal
Immortal

Sounds like you don't have virtual center either.

But I do - what did I say to make you conclude that I don't? Am I overlooking something?

Well if i'm not mistaken then one of the features in Virtual Center is relocating a VM to another storage.

This of course requires that both storages can be connected to the server at the same time.

Usually the people with a single ESX server don't have Virtual Center Server as it is an expensive component.

From what i understand about the product it really shines when using more as just one ESX host.

Virtual Center stores the data in an MSSQL database.

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
0 Kudos
radicalman
Contributor
Contributor

Sounds like you don't have virtual center either.

But I do - what did I say to make you conclude that I don't? Am I overlooking something?Well if i'm not mistaken then one of the features in Virtual Center is relocating a VM to another storage.

This of course requires that both storages can be connected to the server at the same time.

Yes but the real issue is restoring the old Inventory when I've installed ESX fresh on the

new storage. How to do that easily?

Usually the people with a single ESX server don't have Virtual Center Server as it is an expensive component.

From what i understand about the product it really shines when using more as just one ESX host.

Managing multiple ESX servers is one VC feature, but it goes far beyond that.

Cloning is a big advantage IMO. It has very nice resource-monitoring capabilities.

It allows some organization into folders, etc.

It has a Migration feature that looks like it's designed to work between ESX servers,

but only one VM at a time. I have a lot of VMs organized into folders and I want the

entire organization/inventory preserved and then restored onto the new ESX installation.

0 Kudos
Dave_Mishchenko
Immortal
Immortal

One of the install options for ESX is to perserve VMFS partitions so once you do your new install the VMFS that you create on the new disks will still be there and will be recognized by ESX. You'll then just have to browse the data store, find the VMX files for the VM and right click on each and select add to inventory. VirtualCenter would help you migrate the VMs, but won't be of help once you have installed ESX again. It's nice to have the clone/migrate options, but it'll be easier to script or manually copy the files over in this case.

With the new disk I would suggest manually creating the VMFS partition with fdisk and vmkfstools. That way you can leave some free space (approx 8 - 20 GB) at the start of the disk for the new install of ESX.

radicalman
Contributor
Contributor

OK, so let me see if I understand your proposal:

Currently ESX is on disk0+1 LUN0

  • Add disk 2+3 LUN1

  • fdisk to create a 20GB partition on LUN1, put the rest into what will be a VMFS partition

  • vmkfstools -C vmfs1 <device_or_VMFS_volume name>

(I'll figure out the name somehow :smileyshocked: , but it'll be the VMFS partition on LUN1)

(does vmkfstools "mount" the VMFS volume also? I don't really understand how this works - it doesn't show up in /etc/fstab on the COS. I'll assume it does)

  • cp -rp /vmfs /vmfs1

  • remove disks 0+1 (LUN0)

  • Install ESX on LUN1 (disks 2+3), preserving the VMFS partitions

  • Manually recreate my folders

  • Manually add the VMs into inventory on Virtual Center (I've done this before so know the drill)

Does this all sound like what you were envisioning?

0 Kudos
radman
Enthusiast
Enthusiast

That certainly looks right.

0 Kudos