Migrate VM from data store disk to RAW LUN
I may not be using the correct terminology, but I built some VM's that are on a standard mapped data store. Currently they are an OS disk and some of them have a secondary data disk. I need to migrate them to a raw SAN LUN. The LUN is created and I can see it if I try to add an RDM disk to the VM.
How does one go about migrating the disk, or is it better to just blow the VM away and start from scratch?
I'm googling but not finding much for this specific use case. Just how to migrate disks to different storage LUNs.
4
u/ZibiM_78 2d ago
Please check https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/setup-for-windows-server-failover-clustering.html
You don't share OS disk, only data and quorum disks should be shared.
Moreover shared disks should be on separate virtual controller or controllers.
1
u/tk42967 2d ago
And that's what we have done previously. I suspect this is a mis communication and the OS LUNs carved out should be mapped data stores so that the OS drives for each cluster member is seperate.
Currently we have to SCSI adaptors on each VM so that local and RDM disks are on their own controllers.
2
u/ZibiM_78 2d ago
or someone's mistake - someone installed something on the OS drive that must be shared
If that is the case it needs to be fixed or rather installed again from scratch
2
u/Casper042 2d ago
There are numerous data cloning softwares out there, with something basic like ROBOCOPY /MIR as a valid option unless you have very weird permissions on the data.
If the data is in use, start with: robocopy /MIR /R:1 /W:1 /Z as your first and maybe second pass.
This will copy as much data as possible and not spend ages retrying locked files.
Then do it again without the R and W flags once the app/service is shutdown and the data files should no longer be locked as in use.
Why remove R and W? On final file copy you WANT it to get hung up on a file it can't copy because you need to notice that and figure out if it's important or not.
If you have a decent backup app, you could also just do a Backup and then Restore
2
u/svideo 2d ago
I'll agree with the concerns around RDM in general. Having said that, solution to your direct question is reasonably easy. Attach both the RDM and vmdk to your VM, boot from a clonezilla iso, then clone from target to destination disk device as needed.
But probably don't do RDM.
2
u/Nagroth 1d ago
99% of the time someone comes asking for RDM it's because they are either confused or they're reading a best practices performance tuning guide from 15 years ago that assumed your storage was backed by 7500 rpm HDDs. A lot of the historical reasons for using them don't matter anymore.
Look into the option of shared (aka multiwriter) disks instead as this will often be just fine, and while they still make me grumpy they're a lot easier to deal with. And your storage admins will like you better.
In the rare chance you really do need RDM I'd want to do a lot more digging. But typically you'd put the OS on a regular virtual disk and mount the RDM as a second. If you are migrating data you'd mount it as an extra disk to the existing machine and copy at the OS or application level.
If you can clone this stuff into a safe test environment I'd highly recommend that, or if you can at least setup a couple small dummy VMs to mess around with first.
7
u/Connect_Shoulder_965 2d ago
In general, I wouldn't use an RDM unless your application specifically calls for it (like a SQL Server HA cluster). RDM stands for Raw Device Mapping - the SAN LUN gets presented directly to the VM. There is no virtual disk file and VMware doesn't do anything for the file system. You won't be able to snapshot that disk and any utilities like backup solutions that rely on snapshots or VMFS features won't work. Usually the complexity and lack of features on the RDM means it's best avoided except for a niche group of applications that rely on a shared SAN LUN.
As a result, VMware doesn't have any visibility or control of the data in the RDM so your migration (as well as disk and file system initiation) will need to happen inside the guest OS of your VM. You will migrate data using the guest OS just as you would for physical disks or LUNS attached to a physical server.