VMware Cloud Community
andvm
Hot Shot
Hot Shot

Copy VM from local datastore to NFS Share

Hi,

I want to transfer a VM storage off from an old 5.x Standalone ESXi local datastore

If I add an NFS Share (add new vmkernel on same network/VLAN as NFS Share) I think I should be able to copy the files over.

The plan is that I will run the VM from another host which would also be connected to the same NFS.

Is this the process to follow?

  1. Shutdown VM
  2. Unregister VM
  3. Copy files from local datastore to NFS Datastore (Does vSphere client allow you to do this or shall I SSH and run cp command from source to destination datastore?)
  4. Is there a way to check copy progress here as it is a large VM and will transfer via 1Gbps link so want to see status?
  5. Once complete, from the new ESXi, browse to the copied VM folder on the NFS Share and register the VM.

So as long as the VM is unregistered/powered down I can just copy its files to any datastore accessible by the new host to be able to register it.

Let me know if you have any suggestions or other considerations?

Thanks

 

 

Reply
0 Kudos
4 Replies
scott28tt
VMware Employee
VMware Employee

@andvm 

Moderator: Moved to vSphere Discussions


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
Reply
0 Kudos
ashilkrishnan
VMware Employee
VMware Employee

Hi @andvm ,

If this is a standalone ESXi host which is not part of a vCenter, yes you can move files from datastore using vsphere client.

I could find this document for 6.0 --> Move Datastore Folders or Files 

vSphere client should display the progress on screen.

Hope that helps

 

Reply
0 Kudos
continuum
Immortal
Immortal

I would suggest to use the cp command for the small files only.

For the vmdks I highly recommend to use vmkfstools -i old-path/name.vmdk new-path/name.vmdk

This has the advantage that you can specify the output-format ( which would be thin anyway if you copy to NFS)
and it will do some checks along the way. So when a vmkfstools command finishes you can quite reliably assume that the output vmdk is healthy.
It also shows progress - but that is not really conclusive as it often jumps to finished way before you would expect it looking at the numbers.
The real important advantage is that vmkfstools will fail very early when anything with the source is wrong.
If you use cp you dont get this quick early source check.


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

Reply
0 Kudos
andvm
Hot Shot
Hot Shot

Thank you, vmkfstools looks to be a powerful tool but never attempted to use it...

So will create a new folder on NFS with the VM name

With the VM powered off and removed from inventory I will browse to VM folder on local datastore and cp all files (except vmdk/s) to above new folder on NFS

For the vmdk/s I will use the following to take advantage of inbuilt vmdk health checks and make it thin by default on NFS: vmkfstools -i old-path/name.vmdk new-path/name.vmdk 

Worst case if for some reason the copy fails or VM fails to start on the new Host from NFS I should be able to re-register it on the old Host as the original copy will still be there on local Datastore

 

Reply
0 Kudos