VMware Cloud Community
jstrubberg
Contributor
Contributor

Moving working files of a virtual machine to another LUN

We recently had a physical host crash hard, burning out three of 12 drives in a matter of minutes.  As luck would have it, the host was the last of ours that had not been migrated to our SAN infrastructure for storage.  This kicked off a 30 hour marathon of moves and prayer to rescue several critical servers.  In the madness, I would up with two servers whose disks are in one LUN, but whose working files are in another.  I need to correct that in order to clean up old LUN's on our SAN and free up space.  In my head there are two ways I could do this;

1.  Shut down the virtual machine, copy the .vmx files over to the correct LUN and edit the general options fields to point the virtual machine to the new LUN for working files.  The swap and virtual RAM files should rebuild when the machine is started, yes?

2.  Shut down the virtual machine, remove the virtual machine from inventory and create a new virtual machine in the correct LUN but using the already present .vmdk files.  Start them back up and everything should be good.

Anyone see a problem with either of these approaches?  Do you prefer one over the other?

Looking for input...

0 Kudos
2 Replies
continuum
Immortal
Immortal

Small modification for #1:
power off VM, unregister it, move everything to destination, open location with WinSCP and doubleclick vmx-file.
Check/ edit paths to vmdks
Delete the line with the path to the swap-file
When everything looks good - readd VM to the inventory.oid

I avoid using new vmx-files when ever possible.
A new vmx will generate new Mac-addresses which is something that can be really troublesome if you later find out that you needed to keep the IP.


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
jstrubberg
Contributor
Contributor

Thanks continuum.  I hand't though fo the mac address issue.  It's not a problem for these particular servers, but there's no reason to change it, either.

To be clear, the vmdk files wouldn't have to move.  They are where they need to be already.  THe vmx and vswap files are the only thing out of place.

0 Kudos