JavaScript is required to for searching.
ナビゲーションリンクをスキップ
印刷ビューの終了
Oracle® ZFS Storage Appliance 管理ガイド
Oracle Technology Network
ライブラリ
PDF
印刷ビュー
フィードバック
search filter icon
search icon

Document Information

このドキュメントの使用法

 1 Oracle ZFS Storage Appliance の概要

 2 ステータス

 3 初期構成

 4 ネットワーク構成

 5 ストレージ構成

 6 Storage Area Network の構成

 7 ユーザー構成

 8 ZFSSA の設定

 9 警告の構成

 10 クラスタ構成

 11 ZFSSA サービス

 12 シェア、プロジェクト、およびスキーマ

 13 レプリケーション

 14 シャドウ移行

 15 CLI のスクリプト化

 16 保守のワークフロー

ワークフローの使用

ワークフローの実行コンテキスト

ワークフローのパラメータ

制約付きのパラメータ

オプションのパラメータ

ワークフローのエラー処理

ワークフローの入力の検証

ワークフローの実行の監査

ワークフローの実行の報告

バージョン管理

アプライアンスのバージョン管理

ワークフローのバージョン管理

警告アクションとしてのワークフロー

警告アクションの実行コンテキスト

警告アクションの監査

スケジュールされたワークフローの使用

CLI の使用

スケジュールのコーディング

例: デバイスタイプの選択

BUI

CLI

ワークフローのダウンロード

ワークフローの表示

ワークフローの実行

 17 統合

索引

例: デバイスタイプの選択

指定されたドライブタイプに基づいてワークシートを作成するワークフローの例を次に示します。

var steps = [ {
	step: 'Checking for existing worksheet',
	execute: function (params) {
		/*
		 * In this step, we're going to see if the worksheet that
		 * we're going to create already exists.  If the worksheet
		 * already exists, we blow it away if the user has indicated
		 * that they desire this behavior.  Note that we store our
		 * derived worksheet name with the parameters, even though
		 * it is not a parameter per se; this is explicitly allowed,
		 * and it allows us to build state in one step that is
		 * processed in another without requiring additional global
		 * variables.
		 */
		params.worksheet = 'Drilling down on ' + params.type + ' disks';

		try {
			run('analytics worksheets select name="' +
			    params.worksheet + '"');

			if (params.overwrite) {
				run('confirm destroy');
				return;
			}
				
			throw ('Worksheet called "' + params.worksheet +
			    '" already exists!');
		} catch (err) {
			if (err.code != EAKSH_ENTITY_BADSELECT)
				throw (err);
		}
	}
 }, {
	step: 'Finding disks of specified type',
	execute: function (params) {
		/*
		 * In this step, we will iterate over all chassis, and for
		 * each chassis iterates over all disks in the chassis,
		 * looking for disks that match the specified type.
		 */
		var chassis, name, disks;
		var i, j;

		run('cd /');
		run('maintenance hardware');

		chassis = list();
		params.disks = [];

		for (i = 0; i < chassis.length; i++) {
			run('select ' + chassis[i]);

			name = get('name');
			run('select disk');
			disks = list();

			for (j = 0; j < disks.length; j++) {
				run('select ' + disks[j]);

				if (get('use') == params.type) {
					params.disks.push(name + '/' +
					    get('label'));
				}

				run('cd ..');
			}

			run('cd ../..');
		}

		if (params.disks.length === 0)
			throw ('No ' + params.type + ' disks found');
		run('cd /');
	}
 }, {
	step: 'Creating worksheet',
	execute: function (params) {
		/*
		 * In this step, we're ready to actually create the worksheet
		 * itself:  we have the disks of the specified type and
		 * we know that we can create the worksheet.  Note that we
		 * create several datasets:  first, I/O bytes broken down
		 * by disk, with each disk of the specified type highlighted
		 * as a drilldown.  Then, we create a separate dataset for
		 * each disk of the specified type.  Finally, note that we
		 * aren't saving the datasets -- we'll let the user do that
		 * from the created worksheet if they so desire.  (It would
		 * be straightforward to add a boolean parameter to this
		 * workflow that allows that last behavior to be optionally
		 * changed.)
		 */
		var disks = [], i;

		run('analytics worksheets');
		run('create "' + params.worksheet + '"');
		run('select name="' + params.worksheet + '"');
		run('dataset');
		run('set name=io.bytes[disk]');

		for (i = 0; i < params.disks.length; i++)
			disks.push('"' + params.disks[i] + '"');

		run('set drilldowns=' + disks.join(','));
		run('commit');

		for (i = 0; i < params.disks.length; i++) {
			run('dataset');
			run('set name="io.bytes[disk=' +
			    params.disks[i] + ']"');
			run('commit');
		}
	}
} ];

var workflow = {
	name: 'Disk drilldown',
	description: 'Creates a worksheet that drills down on system, ' +
	    'cache, or log devices',
	parameters: {
		type: {
			label: 'Create a new worksheet drilling down on',
			type: 'ChooseOne',
			options: [ 'cache', 'log', 'system' ],
			optionlabels: [ 'Cache', 'Log', 'System' ]
		},
		overwrite: {
			label: 'Overwrite the worksheet if it exists',
			type: 'Boolean'
		}
	},
	execute: function (params) { return (steps); }
};