Using ALUA on a single host to provide optimized and non-optimized paths to the same back-end device.

315 views
Skip to first unread message

lobe...@redhat.com

unread,
Jul 7, 2017, 4:06:47 PM7/7/17
to esos-users
Hello

I have ESOS up and running but I have a question which may be a simple one for folks on the list here.

Can I use the ALUA support in scst to set optimized and non-optimized paths on a single scst host for the same back-end device under ESOS.

How would I do that because you cannot add the same device to more than one ALUA group.

What I want is that the device is accessible say on group1 with relative id=2 and on group2 with relative id=4 so that
its optimized to HBA port1 and non-optimized to HBA port2.

The idea of course is to fully emulate ALUA for testing device-mapper-multipath initiators.

Thanks
Laurence



 

Marc Smith

unread,
Jul 7, 2017, 4:19:59 PM7/7/17
to esos-...@googlegroups.com
On Fri, Jul 7, 2017 at 4:06 PM, <lobe...@redhat.com> wrote:
> Hello

Hi Laurence,


>
> I have ESOS up and running but I have a question which may be a simple one
> for folks on the list here.
>
> Can I use the ALUA support in scst to set optimized and non-optimized paths
> on a single scst host for the same back-end device under ESOS.

Yes... so a single-head array setup (not dual-head/HA) -- right?


>
> How would I do that because you cannot add the same device to more than one
> ALUA group.

You would make one (1) SCST device group, and add your devices to it,
and then add multiple target groups to the device group.


>
> What I want is that the device is accessible say on group1 with relative
> id=2 and on group2 with relative id=4 so that
> its optimized to HBA port1 and non-optimized to HBA port2.
>
> The idea of course is to fully emulate ALUA for testing
> device-mapper-multipath initiators.

The config might look something like this:

--snip--
DEVICE_GROUP esos {
DEVICE device_1
DEVICE device_2
DEVICE device_3
DEVICE device_4
DEVICE device_5

TARGET_GROUP active_group {
group_id 151
state active

# Non-key attributes
preferred 0

TARGET 21:00:00:0e:1e:25:b5:10
TARGET 21:00:00:0e:1e:25:b5:11
}

TARGET_GROUP nonopti_group {
group_id 152
state nonoptimized

# Non-key attributes
preferred 0

TARGET 21:00:00:0e:1e:25:93:60 {
rel_tgt_id 3
}
TARGET 21:00:00:0e:1e:25:93:61 {
rel_tgt_id 4
}
}
}
--snip--

Or some variation of the above... let me know if that isn't what you
were looking for.

--Marc


>
> Thanks
> Laurence
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "esos-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to esos-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

lobe...@redhat.com

unread,
Jul 7, 2017, 4:24:57 PM7/7/17
to esos-users
Hi Marc,
Awesome, thanks for the quick reply I will try this, makes sense now that you have laid it out for me.
Answers inline


On Friday, July 7, 2017 at 4:19:59 PM UTC-4, Marc Smith wrote:
On Fri, Jul 7, 2017 at 4:06 PM,  <lobe...@redhat.com> wrote:
> Hello

Hi Laurence,


>
> I have ESOS up and running but I have a question which may be a simple one
> for folks on the list here.
>
> Can I use the ALUA support in scst to set optimized and non-optimized paths
> on a single scst host for the same back-end device under ESOS.

Yes... so a single-head array setup (not dual-head/HA) -- right?

Yes, exactly
 
>
> How would I do that because you cannot add the same device to more than one
> ALUA group.

You would make one (1) SCST device group, and add your devices to it,
and then add multiple target groups to the device group.

OK, got it

>
> What I want is that the device is accessible say on group1 with relative
> id=2 and on group2 with relative id=4 so that
> its optimized to HBA port1 and non-optimized to HBA port2.
>
> The idea of course is to fully emulate ALUA for testing
> device-mapper-multipath initiators.

The config might look something like this:

Thanks trying it
 

lobe...@redhat.com

unread,
Jul 7, 2017, 5:40:45 PM7/7/17
to esos-users
OK,
Thanks very much its working as expected.
Following up here in case others need the information.

[root@fcoe-test-rhel6 ~]# sg_rtpg /dev/sdd
Report target port groups:
  target port group id : 0x1 , Pref=1
    target port group asymmetric access state : 0x00
    T_SUP : 1, O_SUP : 1, U_SUP : 1, S_SUP : 1, AN_SUP : 1, AO_SUP : 1
    status code : 0x02
    vendor unique status : 0x00
    target port count : 01
    Relative target port ids:
      0x01
  target port group id : 0x2 , Pref=0
    target port group asymmetric access state : 0x01
    T_SUP : 1, O_SUP : 1, U_SUP : 1, S_SUP : 1, AN_SUP : 1, AO_SUP : 1
    status code : 0x02
    vendor unique status : 0x00
    target port count : 01
    Relative target port ids:
      0x02

[root@fcoe-test-rhel6 ~]# multipath -ll
mpathd (2326635303033362d) dm-5 SCST_FIO,block2
size=20G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 4:0:0:1 sdi 8:128 active ready running
| `- 3:0:1:1 sdh 8:112 active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
  |- 3:0:0:1 sdg 8:96  active ready running
  `- 4:0:1:1 sdj 8:144 active ready running
mpathc (23336313261386166) dm-3 SCST_FIO,block1
size=20G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 3:0:1:0 sdd 8:48  active ready running
| `- 4:0:0:0 sde 8:64  active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
  |- 3:0:0:0 sdc 8:32  active ready running
  `- 4:0:1:0 sdf 8:80  active ready running

[root@localhost ~]# cat /etc/scst.conf
# Automatically generated by SCST Configurator v3.2.0-pre1.

# Non-key attributes
max_tasklet_cmd 10
poll_us 0
setup_id 0x0
suspend 0
threads 12

HANDLER vdisk_fileio {
    DEVICE block1 {
        filename /dev/mapper/data-block1
        thin_provisioned 0

        # Non-key attributes
        block "0 0"
        blocksize 512
        cluster_mode 0
        expl_alua 0
        nv_cache 0
        o_direct 0
        pr_file_name /var/lib/scst/pr/block1
        prod_id block1
        prod_rev_lvl " 321"
        read_only 0
        removable 0
        rotational 1
        t10_dev_id 3612a8af-block1
        t10_vend_id SCST_FIO
        threads_num 8
        threads_pool_type per_initiator
        tst 1
        usn 3612a8af
        vend_specific_id 3612a8af-block1
        write_through 0
        zero_copy 0
    }

    DEVICE block2 {
        filename /dev/mapper/data-block2

        # Non-key attributes
        block "0 0"
        blocksize 512
        cluster_mode 0
        expl_alua 0
        nv_cache 0
        o_direct 0
        pr_file_name /var/lib/scst/pr/block2
        prod_id block2
        prod_rev_lvl " 321"
        read_only 0
        removable 0
        rotational 1
        t10_dev_id 2f50036-block2
        t10_vend_id SCST_FIO
        thin_provisioned 0
        threads_num 8
        threads_pool_type per_initiator
        tst 1
        usn 2f50036
        vend_specific_id 2f50036-block2
        write_through 0
        zero_copy 0
    }

    DEVICE block3 {
        filename /dev/mapper/data-block3

        # Non-key attributes
        block "0 0"
        blocksize 512
        cluster_mode 0
        expl_alua 0
        nv_cache 0
        o_direct 0
        pr_file_name /var/lib/scst/pr/block3
        prod_id block3
        prod_rev_lvl " 321"
        read_only 0
        removable 0
        rotational 1
        t10_dev_id 11579841-block3
        t10_vend_id SCST_FIO
        thin_provisioned 0
        threads_num 8
        threads_pool_type per_initiator
        tst 1
        usn 11579841
        vend_specific_id 11579841-block3
        write_through 0
        zero_copy 0
    }

    DEVICE block4 {
        filename /dev/mapper/data-block4

        # Non-key attributes
        block "0 0"
        blocksize 512
        cluster_mode 0
        expl_alua 0
        nv_cache 0
        o_direct 0
        pr_file_name /var/lib/scst/pr/block4
        prod_id block4
        prod_rev_lvl " 321"
        read_only 0
        removable 0
        rotational 1
        t10_dev_id 6b3a5104-block4
        t10_vend_id SCST_FIO
        thin_provisioned 0
        threads_num 8
        threads_pool_type per_initiator
        tst 1
        usn 6b3a5104
        vend_specific_id 6b3a5104-block4
        write_through 0
        zero_copy 0
    }
}

TARGET_DRIVER copy_manager {
    # Non-key attributes
    allow_not_connected_copy 0

    TARGET copy_manager_tgt {
        # Non-key attributes
        addr_method PERIPHERAL
        black_hole 0
        cpu_mask ffffffff
        forwarding 0
        io_grouping_type auto
        rel_tgt_id 0

        LUN 0 block1 {
            # Non-key attributes
            read_only 0
        }

        LUN 1 block2 {
            # Non-key attributes
            read_only 0
        }

        LUN 2 block3 {
            # Non-key attributes
            read_only 0
        }

        LUN 3 block4 {
            # Non-key attributes
            read_only 0
        }

        LUN 4 block1 {
            # Non-key attributes
            read_only 0
        }
    }
}

TARGET_DRIVER iscsi {
    enabled 0
}

TARGET_DRIVER qla2x00t {
    TARGET 21:00:00:0e:1e:05:48:5b {
        HW_TARGET

        enabled 0

        # Non-key attributes
        addr_method PERIPHERAL
        black_hole 0
        cpu_mask ffffffff
        explicit_confirmation 0
        forwarding 0
        io_grouping_type auto
        node_name 20:00:00:0e:1e:05:48:5b
        port_name 21:00:00:0e:1e:05:48:5b
        rel_tgt_id 0
    }

    TARGET 21:00:00:0e:1e:05:48:5f {
        HW_TARGET

        enabled 0
        rel_tgt_id 1

        # Non-key attributes
        addr_method PERIPHERAL
        black_hole 0
        cpu_mask ffffffff
        explicit_confirmation 0
        forwarding 0
        io_grouping_type auto
        node_name 20:00:00:0e:1e:05:48:5f
        port_name 21:00:00:0e:1e:05:48:5f
    }

    TARGET 50:01:43:80:05:66:3d:68 {
        HW_TARGET

        enabled 1
        rel_tgt_id 2

        # Non-key attributes
        addr_method PERIPHERAL
        black_hole 0
        cpu_mask ffffffff
        explicit_confirmation 0
        forwarding 0
        io_grouping_type auto
        node_name 50:01:43:80:05:66:3d:69
        port_name 50:01:43:80:05:66:3d:68

        GROUP home {
            LUN 0 block1 {
                # Non-key attributes
                read_only 0
            }

            INITIATOR 10:00:00:90:fa:c7:c0:4e

            INITIATOR 10:00:00:90:fa:c7:c0:4f

            # Non-key attributes
            addr_method PERIPHERAL
            black_hole 0
            cpu_mask ffffffff
            io_grouping_type auto
        }
    }

    TARGET 50:01:43:80:05:66:3d:6a {
        HW_TARGET

        enabled 1
        rel_tgt_id 1

        # Non-key attributes
        addr_method PERIPHERAL
        black_hole 0
        cpu_mask ffffffff
        explicit_confirmation 0
        forwarding 0
        io_grouping_type auto
        node_name 50:01:43:80:05:66:3d:6b
        port_name 50:01:43:80:05:66:3d:6a

        GROUP home {
            LUN 0 block1 {
                # Non-key attributes
                read_only 0
            }

            INITIATOR 10:00:00:90:fa:c7:c0:4e

            INITIATOR 10:00:00:90:fa:c7:c0:4f

            # Non-key attributes
            addr_method PERIPHERAL
            black_hole 0
            cpu_mask ffffffff
            io_grouping_type auto
        }
    }
}

DEVICE_GROUP group1 {
    DEVICE block4
    DEVICE block2
    DEVICE block3
    DEVICE block1

    TARGET_GROUP t1 {
        group_id 1
        preferred 1
        state active

        TARGET 50:01:43:80:05:66:3d:6a
    }

    TARGET_GROUP t2 {
        group_id 2

        state nonoptimized

        # Non-key attributes
        preferred 0

        TARGET 50:01:43:80:05:66:3d:68
    }
}



Marc Smith

unread,
Jul 7, 2017, 5:44:10 PM7/7/17
to esos-...@googlegroups.com
Good deal, thanks for the update and information.

Marc


Reply all
Reply to author
Forward
0 new messages