pacemaker  2.1.7-0f7f88312f
Scalable High-Availability cluster resource manager
Functions
pcmk_simulate.c File Reference
#include <crm_internal.h>
#include <crm/cib/internal.h>
#include <crm/common/output.h>
#include <crm/common/results.h>
#include <crm/common/scheduler.h>
#include <pacemaker-internal.h>
#include <pacemaker.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "libpacemaker_private.h"
Include dependency graph for pcmk_simulate.c:

Go to the source code of this file.

Functions

void pcmk__profile_dir (const char *dir, long long repeat, pcmk_scheduler_t *scheduler, const char *use_date)
 
enum pcmk__graph_status pcmk__simulate_transition (pcmk_scheduler_t *scheduler, cib_t *cib, const GList *op_fail_list)
 
int pcmk__simulate (pcmk_scheduler_t *scheduler, pcmk__output_t *out, const pcmk_injections_t *injections, unsigned int flags, uint32_t section_opts, const char *use_date, const char *input_file, const char *graph_file, const char *dot_file)
 
int pcmk_simulate (xmlNodePtr *xml, pcmk_scheduler_t *scheduler, const pcmk_injections_t *injections, unsigned int flags, unsigned int section_opts, const char *use_date, const char *input_file, const char *graph_file, const char *dot_file)
 Simulate a cluster's response to events. More...
 

Function Documentation

◆ pcmk__profile_dir()

void pcmk__profile_dir ( const char *  dir,
long long  repeat,
pcmk_scheduler_t scheduler,
const char *  use_date 
)

Definition at line 378 of file pcmk_simulate.c.

◆ pcmk__simulate()

int pcmk__simulate ( pcmk_scheduler_t scheduler,
pcmk__output_t out,
const pcmk_injections_t injections,
unsigned int  flags,
uint32_t  section_opts,
const char *  use_date,
const char *  input_file,
const char *  graph_file,
const char *  dot_file 
)

Definition at line 788 of file pcmk_simulate.c.

◆ pcmk__simulate_transition()

enum pcmk__graph_status pcmk__simulate_transition ( pcmk_scheduler_t scheduler,
cib_t cib,
const GList *  op_fail_list 
)

Definition at line 733 of file pcmk_simulate.c.

◆ pcmk_simulate()

int pcmk_simulate ( xmlNodePtr *  xml,
pcmk_scheduler_t scheduler,
const pcmk_injections_t injections,
unsigned int  flags,
unsigned int  section_opts,
const char *  use_date,
const char *  input_file,
const char *  graph_file,
const char *  dot_file 
)

Simulate a cluster's response to events.

This high-level function essentially implements crm_simulate(8). It operates on an input CIB file and various lists of events that can be simulated. It optionally writes out a variety of artifacts to show the results of the simulation. Output can be modified with various flags.

Parameters
[in,out]xmlThe destination for the result, as an XML tree
[in,out]schedulerScheduler data
[in]injectionsA structure containing cluster events (node up/down, tickets, injected operations)
[in]flagsA bitfield of :pcmk_sim_flags to modify operation of the simulation
[in]section_optsWhich portions of the cluster status output should be displayed?
[in]use_dateDate to set the cluster's time to (may be NULL)
[in]input_fileThe source CIB file, which may be overwritten by this function (may be NULL)
[in]graph_fileWhere to write the XML-formatted transition graph (may be NULL, in which case no file will be written)
[in]dot_fileWhere to write the dot(1) formatted transition graph (may be NULL, in which case no file will be written)
Returns
Standard Pacemaker return code

Definition at line 985 of file pcmk_simulate.c.