Clone FreeNAS System to New Server Hardware

Status
Not open for further replies.

cbd79

Cadet
Joined
May 5, 2017
Messages
1
Hi all, I'm looking for suggestions on the best way to migrate a FreeNAS system to new hardware. I currently have a FreeNAS system setup on desktop hardware (FreeNAS installed on 16GB USB stick, SSD for SLOG, 4 HDD's in RAIDZ2), it's functioning as shared NFS storage for a vSphere lab I have and it works really well. I want to migrate it to an IBM System x3630 M4 server with way better hardware (FreeNAS installed on another 16GB USB stick or I may put it on two mirrored drives, SSD for SLOG, maybe two mirrored SSD's, 10 NIC's that I'll be using to setup LAGG's to two switches, and 6 HDD's which are bigger in size than the 4 drives in my original system) which will also function as the new shared NFS storage for my vSphere lab.

So the storage on the original system has VM's stored on it for my VMware lab and I've thought about just copying all of them off to external hard drives, building out a new FreeNAS system on the new server hardware that's basically configured with identical volumes and shares, and then copy the VM's onto the new system. The ESXi hosts should be none the wiser that the shared storage is on different hardware, at worst I'll just need to re-add the VM's in the inventory once the hosts are connected to the new FreeNAS system. Is this a good approach? Are there other ways to approach this that are better or easier?

I know FreeNAS can do replication but I've never used it, would this be the better way to do this? Does replication only replicate the storage data or does it also replicate the FreeNAS OS and configuration to the other system also? Interested to see what you all recommend, thanks!
 

diedrichg

Wizard
Joined
Dec 4, 2012
Messages
1,319
1. Backup your data to an external source.
2. Create a backup of your FreeNAS config

Q: Are the VMs on the pool?

3. Decide which medium you want to install the new FreeNAS
4. Put together the new hardware, leave the data drives out for now - just to make sure you don't install FreeNAS on them
5. Install FreeNAS on the new medium
6. Attach the data drives
7. Boot to the new FreeNAS installation
8. Follow the wizard and import your volume
9. Import your FreeNAS config
10. * Read the docs about replacing a drive.
11. You will replace each drive, one at a time, with the larger drive. After each replacement, FreeNAS will resilver the data to the new drive.
12. Once each drive has been replaced then your total storage will increase.

* You can do steps 10 - 12 first before switching to the new hardware. This would reduce the possible causal sources if there are any failures.
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I know FreeNAS can do replication but I've never used it, would this be the better way to do this?
I'd think so.
Does replication only replicate the storage data or does it also replicate the FreeNAS OS and configuration to the other system also?
Just the data, but it keeps all the ZFS-ness (zvols if you're using them, snapshots, quotas, etc.), which other methods of moving the data wouldn't.

Broadly speaking, I'd look at this as a plan:
  • Build the new server (consider using a small SSD for your boot device), set up the pool on it, but don't configure anything--don't set up shares, users, etc.
  • Replicate all data from the old server to the new server
  • Download config from the old server, and upload it to the new server
  • When the new server reboots, make whatever changes are needed to your configuration (probably limited to networking).
Consider also, if you're going to be using the box for VM storage, setting up the pool as striped mirrors rather than RAIDZ2--this won't be as space-efficient, but will give better performance.

Edit: A possible downside to the plan noted above is that you're sending all the data over the network, which of course is a bottleneck. If the new hardware has room for the old data disks as well as the new, here's an alternate plan:
  • Build the new server, installing the disks for both the old pool and the new pool
  • Import the old pool (I'm assuming it's called oldpool, using Volume Import in the GUI) and create the new pool (assume it's called newpool) on the new disks (as noted above, consider setting this up with striped mirrors)
  • Optionally upload the config file to the server at this time--the new server can be live while you do (most of) the rest of this.
  • From the command line, do zfs snapshot -r oldpool@migrate
  • From the command line, do zfs send -R oldpool@migrate | zfs receive -F newpool
  • Wait. It will take a while to transfer all the data, but again, you can be using the server during this time.
  • After the last command finishes (doesn't have to be immediately after, but fairly soon after), shut down your VMs and turn off the NFS service
  • From the command line, zfs snapshot -r oldpool@cleanup
  • From the command line, zfs send -Rv -i migrate oldpool@cleanup | zfs receive -Fdu newpool
  • That replication should go quickly, as it's only sending the data changed since the first snapshot. Now you'll have all your data on two pools. You want to remove oldpool, and rename newpool to oldpool.
  • From the GUI, detach both pools. DO NOT check the box for "mark disks as new", and do not check the box to delete shares attached to oldpool.
  • Remove the disks comprising oldpool from your machine.
  • From the command line, zpool import newpool oldpool. This will rename newpool to oldpool.
  • From the GUI, import volume, and bring in oldpool.
  • Turn the NFS service back on.
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
You will replace each drive, one at a time, with the larger drive. After each replacement, FreeNAS will resilver the data to the new drive.
...and that will leave him with a four-disk pool of the larger disks. He's going from four disks to six.
 

diedrichg

Wizard
Joined
Dec 4, 2012
Messages
1,319
Oh, I missed that part
 
Status
Not open for further replies.
Top