Oracle ZFS Storage Appliance Administration Manual page 37

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

Advertisement

The last command is also useful to retrieve values that have been automatically set by the
appliance during the creation of a dynamic node. For example, each replication action is
assigned an ID by the appliance when it is created. Using the last command with the get id
command, you can retrieve the ID without using the name of the replication action:
dory:shares p1/share replication> create
dory:shares p1/share action (uncommitted)> set target=dory
dory:shares p1/share action (uncommitted)> set pool=p0
dory:shares p1/share action (uncommitted)> commit
dory:shares p1/share replication> last get id
dory:shares p1/share replication>
Note that when last is combined with another command (in this case, get id), the command is
run in the context of the last-visited node, but the current node remains unchanged.
Because last allows you to retrieve the last-visited node and its values without specifying the
name of the node, this command is particularly convenient for scripting:
script
project = 'myproj';
target = 'mytarget';
target_pool = 'notmypool';
run('cd /');
run('shares select ' + project);
run('replication');
run('create');
set('target', target);
set('pool', target_pool);
run('commit');
run('last');
id = get('id');
printf("Sending update for replication action id %s ...", id);
run('sendupdate');
while (get('state') != 'idle') {
printf(".");
run('sleep 1');
}
printf("done\n");
.
To return to the previous context, use the done command:
dory:configuration> done
dory:>
target = dory (uncommitted)
pool = p0 (uncommitted)
id = 7034367a-d4d8-e26f-fa93-c3b454e3b595
About the Oracle ZFS Storage Appliance
Command Line Interface (CLI)
37

Advertisement

Table of Contents
loading

Table of Contents