open-iscsi/targetcli-fb

Restore partial configuration

Opened this issue · 0 comments

Hello,
Is there a way to backup-restore partial configuration of a target?

I am adapting the Pacemaker resource agent in order to achieve support for ZFS-over-iscsi in an HA scenario, and I'd want to run multiple iSCSI targets on different hosts.
ZFS over iSCSI creates an ssh tunnel then creates zfs filesystems/snapshots with its logic and leverage targetcli for creating and deleting backstores/LUNs.

My resource agent is supposed to work under a zfs vol and has this workflow:

  • when resource is stopped it uses targetcli to save the configuration under '$zvol/.targetcli/$target_iqn_namewith commandtargetcli saveconfig "${OCF_RESKEY_zvol_mount}/.targetcli/${OCF_RESKEY_iqn}.save"`
  • when resource is started on another node it uses targetcli for loading configuration on '$zvol/.targetcli/$target_iqn_name with command targetcli restoreconfig "${OCF_RESKEY_zvol_mount}/.targetcli/${OCF_RESKEY_iqn}.save"

This works well in a scenario where an iSCSI daemon is floating between hosts. But when you want to keep an iSCSI daemon per host, in order to distribute the load, that strategy isn't feasible.

So, I'm looking for a solution like:

targetcli restoreconfig "${OCF_RESKEY_zvol_mount}/.targetcli/${OCF_RESKEY_iqn}.save" -target ${OCF_RESKEY_iqn}

in which targetcli restores target, backstores, LUNs and relevant parameters of the target.

Is that feature available/worth of developing?