Product SiteDocumentation Site

B.2. Azioni

Tutti i Resource Agent OCF devono implementare le seguenti azioni

Tabella B.1. Azioni richieste per gli agenti OCF

Azione Descrizione Istruzioni
start
Avvia la risorsa
Return 0 on success and an appropriate error code otherwise. Must not report success until the resource is fully active.
stop
Ferma la risorsa
Return 0 on success and an appropriate error code otherwise. Must not report success until the resource is fully stopped.
monitor
Check the resource’s state
Exit 0 if the resource is running, 7 if it is stopped, and anything else if it is failed.
NOTA: Lo script di monitor dovrebbe controllare lo stato della risorsa solo sulla macchina locale.
meta-data
Descrive la risorsa
Provide information about this resource as an XML snippet. Exit with 0.
NOTE: This is not performed as root.
validate-all
Verify the supplied parameters
Exit with 0 if parameters are valid, 2 if not valid, 6 if resource is not configured.

Requisiti aggiuntivi (che non fanno parte delle specifiche OCF) sono associati ad agenti che vengono utilizzati nell'ambito delle risorse clone e multi-state.

Tabella B.2. Azioni facoltative per gli agent OCF

Azione Descrizione Istruzioni
promote
Promote the local instance of a multi-state resource to the master/primary state.
Return 0 on success
demote
Demote the local instance of a multi-state resource to the slave/secondary state.
Return 0 on success
notify
Used by the cluster to send the agent pre and post notification events telling the resource what has happened and will happen.
Must not fail. Must exit with 0

One action specified in the OCF specs is not currently used by the cluster:
Remember to use ocf-tester to verify that your new agent complies with the OCF standard properly.