Centos – Mirroring iSCSI target to slower drive, asynchronous RAID or block-level replication

backupcentosdrbdiscsiraid

I'm planning on setting up a test iSCSI export on my NAS which will be used by a KVM virtualisation host to store all guest volumes and data. My NAS box is a self-build running CentOS.

The device that will be exported by iSCSI from the NAS will be an SSD.
But I'd like to try and find a way of replicating this volume to a slower/cheaper old disk on the NAS. I could use RAID 1 between the SSD and slower backup drive but then my understanding is that the total speed of the array will be reduced by the slower drive.

Is there any way of performing some sort of block-level full/incremental replication of the SSD to the slower HDD?

Some sort of asynchronous RAID 1 or replication would be great, so the changed blocks are queued up and written to the slower drive whenever the slower drive is available. The data on the SSD won't be changing that much in this case and there will always be some points within a 24 hour period where the slower drive can catch up.

I'd like to avoid having to configure backups within each guest. Having it all take place at a block level in the storage box would be an elegant solution and would allow me to just change the iSCSI settings to export the backup volume in case the SSD fails.

I've had a look at LVM snapshots but that feels like something that would need to be configured on the KVM virt host and I would need to somehow store the snapshots on a different device.

Anyone know of anything that can do this, that's within the budget of my small test environment (i.e.: open source)?
I'm guessing most solutions of this type are the preserve of high-cost SAN vendors.

EDIT: Ok just been looking at DRBD. Asynchronous mirroring seems ideal but is it possible between storage devices on the same machine?

EDIT 2: This is a home lab test, not a production roll-out. I basically want to experiment with remote VM storage using iSCSI/NFS. If there's an opportunity to add some sort of device replication technology into the equation here then I may as well give it a go. I'm not going to buy an additional SSD and RAID 1 them as it would be a pointless to my experiment… I have used RAID 1 extensively and my conclusion was that it works. Perfectly. I'm looking to find out if there's another technology that I don't know about that I can fiddle with and learn from.

Best Answer

This is a terrible idea...

It sounds as though you're going to be exporting a single drive over iSCSI to your virt host. That SSD does not sound as though it is part of a RAID group.

The real solutions here are:

  • Mirror your SSD... That will reduce the impact of a drive failure. (You could place it/them inside of your virtualization host - why bother with a NAS?)
  • Choose a more appropriate backup solution. If that means configuring each guest, that my be the way to go.
  • Do you have another server/NAS or additional hardware you could backup up to or replicate to?

For the NAS side, there are some nicer options out there. Something like the Community Edition of NexentaStor at least allows replication of NFS shares to another host/destination... but it definitely provides an automated snapshotting service that could be useful in your case. Snapshots aren't backups, but they're one form of protection that could come in handy.