Arnold_Mishaev
Contributor
Contributor

moving VMDKs to new VM

Hello everybody,

 

I have Windows server 2008 vm that I need to decommission and move the disks to a Windows Server 2016, i have 7 disks on old vm, and the size is very big around 8TB, would it be possible to just move it to new vm without cause any data lose?

and how could i do it?

0 Kudos
2 Replies
a_p_
Leadership
Leadership

I've done this several times. The only thing you need to be careful with, is when you delete the old VM, so that this will not delete the virtual disks along with the VM!

The way I did this was:

  1. create the new VM on the same datastore as the existing VM
  2. make sure that the VMs have no active snapshots!!!!
  3. shut down the VMs
  4. from the command line use the mv command to move the virtual disk files (e.g. "<diskname>_#.vmdk", "<diskname>_#-flat.vmdk") to the new VM's folder
  5. rename the moved virtual disks using e.g. vmkfstools -E "<old-name>_#.vmdk" "<new-name>_#.vmdk"
    --> Caution: Make sure that the target/new name does not already exist!
  6. attach the renamed virtual disks to the new VM's configuration (from the GUI)

Note: You may need to set the newly attached virtual disks online within the guest OS, and you will also need to recreate shares (it's also possible to export them from the old server's registry and import them).
The above assumes that you did not use local users, or groups for share, or NTFS permissions! In case you did, you will have to reconfigure permissions.

Once everything works as expected, you may then delete the old VM either from the GUI, or by removing the VM from the GUI, and then deleting its remaining files/folder on the datastore.

If the VM's virtual disks are stored on different datastores, then create a folder with the new VM's name on that same datastore to move the .vmdk files. One important part is that the virtual disk files are only moved within their current datastore!

Most likely needless to say that you should have an up-to-date backup prior to doing this.

If you have questions, feel free to ask.

André

 

0 Kudos
Arnold_Mishaev
Contributor
Contributor

Thanks for answering,

I understood how to do that, the thing with permissions very important cause I have a lot permissions and many files and folders 

0 Kudos