Oracle ZFS Storage Appliance Administration Manual page 138

Hide thumbs Also See for ZFS Storage Appliance:
Table of Contents

Advertisement

Scripting Aliases for Initiators and Initiator Groups (CLI)
/*
138
Oracle ZFS Storage Appliance Administration Guide, Release OS8.6.x • September 2016
* This script creates both aliases for initiators and initiator
* groups, as specified by the below data structure. In this
* particular example, there are five initiator groups, each of
* which is associated with a single host (thicktail, longjaw, etc.),
* and each initiator group consists of two initiators, each of which
* is associated with one of the two ports on the FC HBA. (Note that
* there is nothing in the code that uses this data structure that
* assumes the number of initiators per group.)
*/
groups = {
thicktail: {
'thicktail-1': 'wwn.2100001b3281ac39',
'thicktail-2': 'wwn.2101001b32a1ac39'
},
longjaw: {
'longjaw-1': 'wwn.2100001b3281a339',
'longjaw-2': 'wwn.2101001b32a1a339'
},
tecopa: {
'tecopa-1': 'wwn.2100001b3281e339',
'tecopa-2': 'wwn.2101001b32a1e339'
},
spinedace: {
'spinedace-1': 'wwn.2100001b3281df39',
'spinedace-2': 'wwn.2101001b32a1df39'
},
fera: {
'fera-1': 'wwn.2100001b32817939',
'fera-2': 'wwn.2101001b32a17939'
}
};
for (group in groups) {
initiators = [];
for (initiator in groups[group]) {
printf('Adding %s for %s ... ',
groups[group][initiator], initiator);
try {
} catch (err) {
run('select alias=' + initiator);
printf('(already exists)\n');
run('cd ..');
if (err.code != EAKSH_ENTITY_BADSELECT)
throw err;
run('create');
set('alias', initiator);
set('initiator', groups[group][initiator]);
run('commit');

Advertisement

Table of Contents
loading

Table of Contents