Skip to content

Instantly share code, notes, and snippets.

@beeyev
Created February 21, 2019 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beeyev/ce0f77a7b7c7f499a0e94e89cb0977c0 to your computer and use it in GitHub Desktop.
Save beeyev/ce0f77a7b7c7f499a0e94e89cb0977c0 to your computer and use it in GitHub Desktop.
ESXI install upgrade maintenance
How to move
mkdir /vmfs/volumes/destination_datastore/SomeVM
vmkfstools -i /vmfs/volumes/source_datastore/SomeVM/SomeVM.vmdk /vmfs/volumes/destination_datastore/SomeVM/SomeVM.vmdk -d thin
Copy any remaining files (avoiding overwriting the .vmdk files)
find /vmfs/volumes/source_datastore/SomeVM -maxdepth 1 -type f -print0 | grep -v ".vmdk" | while read file; do cp "$file" /vmfs/volumes/destination_datastore/SomeVM; done
If the VM boots up fine, you can remove the VM from the old datastore.
rm -rf "/vmfs/volumes/source_datastore/Some VM"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment