Recommdations/Best Practices on moving hard disks between different RHEL VMs?
I don't know if I'm asking this question correctly, so please bear with me. I don't see a best practice from VMWare online.
From searching online, I see that Windows Admins are able to move Virtual Disks from one VM to another and I was wondering if there were any recommendations/best practices when it came to moving hard disks from one RHEL VM to another RHEL VM.
https://communities.vmware.com/thread/465345?start=0&tstart=0
1) Power off the VM from where the HDD need to be moved
2) Remove Virtual Hard Disk from VM
3) go to the other VM and right click and edit settings
4) go to hard disk option and add the existing VMDK.from the datastore.
5) power on the VM.
I'm thinking it won't be as straight forward with RHEL VMs. I was thinking of some of the variables when moving from one RHEL VM to another RHEL VM, such as:
- Underlying storage of SAN (format of LUNs)
- Different versions of RHEL (5, 6 and 7)
- Different file system types (say moving an EXT3 hard disk to an OS that only has EXT4, and taking into account xfs)
- Different hardware architecture (such as x32 and x86_64)
- What the purpose of that hard disk or what was stored on it (say hard disks that were dedicated to Oracle and then moved to another RHEL VM that has Oracle running on it, say as a host backup, possibly)
Maybe I'm overthinking this, however I don't think it will be to easy to just power off the RHEL VM and then move it to another RHEL VM.
I'm just wondering what others have done or if there is a good way to do this going from one RHEL VM to another RHEL VM.
thanks
Responses
Christopher,
If it's a filesystem on a raw partition on the disk (eg. /dev/sdb1 ext3,ext4,xfs) and the destination OS supports the filesystem, it should be a trivial process to move the disk, it should just be a matter of moving the VMDK between VMs and remounting on the destination.
One thing you haven't mentioned/accounted for is if the disk is part of an LVM volume group.. depending on the LVM configuration, the process of moving a disk configured with LVM will be more involved.
Problem with moving LVMs - particularly LVMs used to encapsulate the OS partitions - is collisions. This problem is exacerbated when using things like VMware templates, Amazon Machine Images, etc.
Simple naming-collisions (e.g., you want to take VolGroup00 from VM-A and attach it as a secondary volume-group on VM-B and VM-B already has a volume-group named VolGroup00) are relatively easy to resolve or prevent. You can typically rename the volume prior to detaching it from the VM. Alternatively, if you couldn't rename before detaching, you can rename the receiving VM's volume group to avoid collisions.
Problem is, if VM-A and VM-B were built from the same template, even if you've pre-resolved collisions in LVM names you'll still have issues with the LVM UUIDs. Resolving LVM UUIDs is a skosh trickier to resolve after the fact - particularly if the collision is with an OS-volume.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
