VMware Cloud Community
indyvmuser
Contributor
Contributor

Relocating RDM vmdk

I have the need to remove an RDM vmdk from one of my servers and attach it to a new server. This is not the OS disk. The new server resides in a different datastore. Is it more than just shutting down the server, remove the hard drive, move the vmdk to new data store, add to new server?

Thanks

Reply
0 Kudos
13 Replies
claxton
Enthusiast
Enthusiast

You only have to shut down the server with the vmdk attached now. Remove it from there (pay attention to ESX LUN number it has) and add the RDM to the new server. You don't have to move the RDM files to a new datastore if the new server can see the RDMs datastore.

Reply
0 Kudos
indyvmuser
Contributor
Contributor

Thanks. However I do need to move the RDM, it's more for organizational aspects. So if I move the RDM after I detach from the original server, is there anything else that needs to be moved, configured, etc ... before I add it to the new server from the new datastore?

Reply
0 Kudos
claxton
Enthusiast
Enthusiast

As long as you have the ability on your storage system to move the LUN with no problem, then all you should have to do on the new server is rescan the ESX host to make sure you can see the LUN after it's moved, then attach it to the new server.

Reply
0 Kudos
indyvmuser
Contributor
Contributor

Maybe I am not clear. I have a VM that has a second HD which is an RDM. I need to remove the RDM from this server and attach it to a new VM server that resides in a different datastore. My thought was to shutdown hosting server, move RDM to new datastore, rename RDM (vmfsktools -E) to match new server name, then add the RDM to the new server.

Reply
0 Kudos
claxton
Enthusiast
Enthusiast

Just shut down the original server. Remove the RDM. On your new server, attach the RDM. It will ask you if you want to relocate the files (should allow you to move them to the new server). You're on the right track, just have to do it Smiley Happy

Reply
0 Kudos
anujmodi1
Hot Shot
Hot Shot

Add the same LUN to new host server and rescan the storage, you will the RDM LUN there. Just this RDM LUN to your new VM, don't add this to datastore.

Anuj Modi,

If you found my answer to be useful, feel free to mark it as Helpful or Correct.

The latest blogs and articles on Virtulization:

http://communities.vmware.com/blogs/amodi

Anuj Modi, If you found my answer to be useful, feel free to mark it as Helpful or Correct. The latest blogs and articles on Virtulization: anujmodi.wordpress.com
Reply
0 Kudos
indyvmuser
Contributor
Contributor

That was my thought. However, it doesn't ask to relocate files. I have seen this prompt before where it asked to relocate, but in this case I am not getting this prompt. The RDM does add properly, and the server sees the added drive, but only in Disk Manager. My computer does not show the drive.

Reply
0 Kudos
claxton
Enthusiast
Enthusiast

Hm, in the managing the server you should see it in the disk management, if not you can rescan for drives. That should allow you to see it at that point in my computer. I have not had an issue with it not being seen after rescanning for new drives in the OS.

Reply
0 Kudos
indyvmuser
Contributor
Contributor

I noticed there was no drive letter. I added a drive letter and now the server see the drive correctly.

But I don't know why it's not asking to relocate the vmdk when I add an existing drive.

Reply
0 Kudos
claxton
Enthusiast
Enthusiast

Ah cool you got it, good. Browse the datastore for your new server, i bet you will the the vmdk's in there for the RDM Smiley Happy

Reply
0 Kudos
indyvmuser
Contributor
Contributor

Ok, got it now. Here is what was going on. When I add the HD to my new server, I needed to select the Raw Device Mappings, not Use an existing virtual disk. Then it will ask if I want to keep it with the VM or selected datastore. Selecting the Datastore option moves the vmdk to the new location. So I think i'm good. Thanks to all.

Reply
0 Kudos
claxton
Enthusiast
Enthusiast

Congrats indyvmuser Smiley Happy I was under the assumption you was using RDM all along. Helps to pick that as the option! LOL

Reply
0 Kudos
indyvmuser
Contributor
Contributor

I am using RDM.

Here is something I noticed during my testing. Moving from original server, call it server1, the HD that is getting moved is listed as server1-VM_8.vmdk in the datastore. When I move the RDM to the new Datastore via the add HD wizard, the server1-vm_8.vmdk is still listed in the orginal datastore. The new server now has a file listed as server2-VM_1.vmdk. What's interesting is if I move the RDM back to the original server, the file will be listed and server1-VM_9.vmdk. So every time I bounce this RDM back and forth between servers, a new file is created by incrementing the name. I would expect these files would have been deleted when the RDM is detached from the server, but that doesn't appear to be happening. Can't I just delete these files that were associated to the RDM that is no long associated to the server? Or is there another option to have these files deleted when the RDM is moved?

Reply
0 Kudos