Uso de flujos de trabajo programados
var workflow = {
};
Uso de flujos de trabajo programados
Los flujos de trabajo se pueden iniciar mediante un evento de temporizador, para lo que se debe
configurar un programa. Se debe agregar la propiedad "scheduled" al objeto "workflow" y se
debe configurar en "true". Los programas se pueden crear desde la CLI una vez que el flujo de
trabajo se haya cargado en el dispositivo Oracle ZFS Storage Appliance, o se puede agregar una
propiedad de tipo de matriz llamada "schedule" al objeto "workflow".
310
Manual de servicio del cliente de Oracle ZFS Storage Appliance • Junio de 2014
name: 'Failover',
description: 'Fail the node over to its clustered peer',
alert: true,
setid: true,
execute: function (params) {
/*
* To failover, we first confirm that clustering is configured
* and that we are in the clustered state. We then reboot,
* which will force our peer to takeover. Note that we're
* being very conservative by only rebooting if in the
* AKCS_CLUSTERED state: there are other states in which it
* may well be valid to failback (e.g., we are in AKCS_OWNER,
* and our peer is AKCS_STRIPPED), but those states may also
* indicate aberrent operation, and we therefore refuse to
* failback. (Even in an active/passive clustered config, a
* FAILBACK should always be performed to transition the
* cluster peers from OWNER/STRIPPED to CLUSTERED/CLUSTERED.)
*/
var uuid = params.uuid;
var clustered = 'AKCS_CLUSTERED';
audit('attempting failover in response to alert ' + uuid);
try {
run('configuration cluster');
} catch (err) {
audit('could not get clustered state; aborting');
return;
}
if ((state = get('state')) != clustered) {
audit('state is ' + state + '; aborting');
return;
}
if ((state = get('peer_state')) != clustered) {
audit('peer state is ' + state + '; aborting');
return;
}
run('cd /');
run('confirm maintenance system reboot');
}