48 #define PE__CONTAINER_AGENT_UNKNOWN_S "unknown" 49 #define PE__CONTAINER_AGENT_DOCKER_S "docker" 50 #define PE__CONTAINER_AGENT_PODMAN_S "podman" 52 typedef struct pe__bundle_variant_data_s {
55 int nreplicas_per_host;
62 char *container_network;
65 gchar *container_host_options;
66 char *container_command;
67 char *launcher_options;
68 const char *attribute_target;
79 #define get_bundle_variant_data(data, rsc) do { \ 80 pcmk__assert(pcmk__is_bundle(rsc)); \ 81 data = rsc->priv->variant_opaque; \ 98 return bundle_data->nreplicas;
115 return bundle_data->child;
133 if (!pcmk__is_bundle(top)) {
138 for (
const GList *iter =
data->replicas; iter != NULL; iter = iter->next) {
142 return replica->
child;
164 for (GList *iter = bundle_data->replicas; iter != NULL; iter = iter->next) {
167 if (pcmk__same_node(node, replica->
node)) {
190 if (bundle_data->replicas == NULL) {
193 replica = bundle_data->replicas->data;
214 for (GList *iter = bundle_data->replicas; iter != NULL; iter = iter->next) {
239 for (
const GList *iter = bundle_data->replicas; iter != NULL;
249 next_ip(
const char *last_ip)
251 unsigned int oct1 = 0;
252 unsigned int oct2 = 0;
253 unsigned int oct3 = 0;
254 unsigned int oct4 = 0;
255 int rc = sscanf(last_ip,
"%u.%u.%u.%u", &oct1, &oct2, &oct3, &oct4);
261 }
else if (oct3 > 253) {
264 }
else if (oct4 > 253) {
279 if(
data->ip_range_start == NULL) {
282 }
else if(
data->ip_last) {
286 replica->
ipaddr = strdup(
data->ip_range_start);
290 switch (
data->agent_type) {
293 if (
data->add_host) {
294 g_string_append_printf(buffer,
" --add-host=%s-%d:%s",
298 g_string_append_printf(buffer,
" --hosts-entry=%s=%s-%d",
310 create_resource(
const char *
name,
const char *provider,
const char *kind)
337 if(
data->ip_range_start) {
340 if(
data->control_port) {
341 if(
data->nreplicas_per_host > 1) {
345 data->nreplicas_per_host = 1;
358 if(
data->ip_range_start) {
360 xmlNode *xml_ip = NULL;
361 xmlNode *xml_obj = NULL;
365 xml_ip = create_resource(
id,
"heartbeat",
"IPaddr2");
373 if(
data->host_network) {
377 if(
data->host_netmask) {
379 "cidr_netmask",
data->host_netmask);
396 parent->priv->children = g_list_append(
parent->priv->children,
420 xmlNode *xml_container = NULL;
421 xmlNode *xml_obj = NULL;
424 const char *hostname_opt = NULL;
425 const char *env_opt = NULL;
426 const char *agent_str = NULL;
428 GString *buffer = NULL;
429 GString *dbuffer = NULL;
432 switch (
data->agent_type) {
435 hostname_opt =
"-h ";
441 agent_str = container_agent_str(
data->agent_type);
443 buffer = g_string_sized_new(4096);
448 xml_container = create_resource(
id,
"heartbeat", agent_str);
460 g_string_append(buffer,
" --restart=no");
468 if (
data->ip_range_start != NULL) {
469 g_string_append_printf(buffer,
" %s%s-%d", hostname_opt,
data->prefix,
474 if (
data->container_network != NULL) {
478 if (
data->control_port != NULL) {
480 data->control_port, NULL);
486 for (GList *iter =
data->mounts; iter != NULL; iter = iter->next) {
487 pe__bundle_mount_t *mount = (pe__bundle_mount_t *) iter->data;
496 switch (
data->agent_type) {
500 " -v ", pcmk__s(source, mount->source),
501 ":", mount->target, NULL);
503 if (mount->options != NULL) {
513 for (GList *iter =
data->ports; iter != NULL; iter = iter->next) {
514 pe__bundle_port_t *port = (pe__bundle_port_t *) iter->data;
516 switch (
data->agent_type) {
519 if (replica->
ipaddr != NULL) {
521 " -p ", replica->
ipaddr,
":", port->source,
522 ":", port->target, NULL);
524 }
else if (!pcmk__str_eq(
data->container_network,
528 " -p ", port->source,
":", port->target,
549 if (
data->launcher_options != NULL) {
553 if (
data->container_host_options != NULL) {
558 (
const char *) buffer->str);
559 g_string_free(buffer, TRUE);
562 (dbuffer != NULL)? (
const char *) dbuffer->str :
"");
563 if (dbuffer != NULL) {
564 g_string_free(dbuffer, TRUE);
567 if (replica->
child != NULL) {
568 if (
data->container_command != NULL) {
570 data->container_command);
589 }
else if ((child != NULL) &&
data->untrusted) {
596 if (
data->container_command != NULL) {
598 data->container_command);
619 parent->priv->children = g_list_append(
parent->priv->children,
640 g_list_foreach(rsc->
priv->
children, (GFunc) disallow_node,
648 if (replica->
child && valid_network(
data)) {
649 GHashTableIter gIter;
651 xmlNode *xml_remote = NULL;
654 const char *
uname = NULL;
655 const char *connect_name = NULL;
672 connect_name = (replica->
ipaddr? replica->
ipaddr :
"#uname");
674 if (
data->control_port == NULL) {
685 connect_name, (
data->control_port?
686 data->control_port : port_s));
695 uname = pcmk__xe_id(xml_remote);
728 (GFunc) disallow_node, (gpointer)
uname);
749 g_hash_table_insert(
parent->priv->allowed_nodes,
758 while (g_hash_table_iter_next(&gIter, NULL, (
void **)&node)) {
759 if (pcmk__is_pacemaker_remote_node(node)) {
786 parent->priv->children = g_list_append(
parent->priv->children,
799 rc = create_container_resource(
parent,
data, replica);
804 rc = create_ip_resource(
parent,
data, replica);
809 rc = create_remote_resource(
parent,
data, replica);
814 if ((replica->
child != NULL) && (replica->
ipaddr != NULL)) {
818 if (replica->
remote != NULL) {
834 const char *
target,
const char *options, uint32_t
flags)
837 sizeof(pe__bundle_mount_t));
842 mount->flags =
flags;
843 bundle_data->mounts = g_list_append(bundle_data->mounts, mount);
847 mount_free(pe__bundle_mount_t *mount)
851 free(mount->options);
856 port_free(pe__bundle_port_t *port)
877 for (GList *gIter = bundle_data->replicas; gIter != NULL;
878 gIter = gIter->next) {
881 if (replica->
remote == remote) {
893 GHashTable *params = NULL;
920 replica = replica_for_remote(rsc);
921 if (replica == NULL) {
930 node = pcmk__current_node(replica->
container);
934 crm_trace(
"Cannot determine address for bundle connection %s", rsc->
id);
938 crm_trace(
"Setting address for bundle connection %s to bundle host %s",
939 rsc->
id, pcmk__node_name(node));
940 if(xml != NULL && field != NULL) {
947 #define pe__set_bundle_mount_flags(mount_xml, flags, flags_to_set) do { \ 948 flags = pcmk__set_flags_as(__func__, __LINE__, LOG_TRACE, \ 949 "Bundle mount", pcmk__xe_id(mount_xml), \ 950 flags, (flags_to_set), #flags_to_set); \ 956 const char *value = NULL;
957 xmlNode *xml_obj = NULL;
958 const xmlNode *xml_child = NULL;
959 xmlNode *xml_resource = NULL;
961 bool need_log_mount = TRUE;
968 bundle_data->prefix = strdup(rsc->
id);
972 if (xml_obj != NULL) {
976 if (xml_obj == NULL) {
979 if (xml_obj != NULL) {
984 if (xml_obj == NULL) {
996 if ((value == NULL) && (bundle_data->promoted_max > 0)) {
997 bundle_data->nreplicas = bundle_data->promoted_max;
1009 if (bundle_data->nreplicas_per_host == 1) {
1013 bundle_data->container_command =
1024 bundle_data->ip_range_start =
1026 bundle_data->host_netmask =
1028 bundle_data->host_network =
1030 bundle_data->control_port =
1034 bundle_data->add_host = TRUE;
1042 pe__bundle_port_t *port =
1047 if(port->source == NULL) {
1054 if(port->source != NULL && strlen(port->source) > 0) {
1055 if(port->target == NULL) {
1056 port->target = strdup(port->source);
1058 bundle_data->ports = g_list_append(bundle_data->ports, port);
1062 pcmk__xe_id(xml_child));
1080 if (source == NULL) {
1087 mount_add(bundle_data, source,
target, options,
flags);
1088 if (strcmp(
target,
"/var/log") == 0) {
1089 need_log_mount = FALSE;
1093 pcmk__xe_id(xml_child));
1099 if (xml_obj && valid_network(bundle_data)) {
1100 const char *suffix = NULL;
1102 xmlNode *xml_set = NULL;
1110 suffix = (
const char *) xml_resource->name;
1111 if (bundle_data->promoted_max > 0) {
1119 bundle_data->prefix, xml_resource->name);
1124 value = pcmk__itoa(bundle_data->nreplicas);
1128 value = pcmk__itoa(bundle_data->nreplicas_per_host);
1133 pcmk__btoa(bundle_data->nreplicas_per_host > 1));
1135 if (bundle_data->promoted_max) {
1139 value = pcmk__itoa(bundle_data->promoted_max);
1147 }
else if(xml_obj) {
1150 rsc->
id, pcmk__xe_id(xml_obj));
1156 GList *childIter = NULL;
1157 pe__bundle_port_t *port = NULL;
1158 GString *buffer = NULL;
1189 if (need_log_mount) {
1195 if(bundle_data->control_port) {
1196 port->source = strdup(bundle_data->control_port);
1209 port->target = strdup(port->source);
1210 bundle_data->ports = g_list_append(bundle_data->ports, port);
1212 buffer = g_string_sized_new(1024);
1213 for (childIter = bundle_data->child->priv->children;
1214 childIter != NULL; childIter = childIter->next) {
1219 replica->
child = childIter->data;
1228 allocate_ip(bundle_data, replica, buffer);
1229 bundle_data->replicas = g_list_append(bundle_data->replicas,
1231 bundle_data->attribute_target =
1235 bundle_data->container_host_options = g_string_free(buffer, FALSE);
1237 if (bundle_data->attribute_target) {
1240 bundle_data->attribute_target);
1243 bundle_data->attribute_target);
1248 GString *buffer = g_string_sized_new(1024);
1250 for (
int lpc = 0; lpc < bundle_data->nreplicas; lpc++) {
1255 allocate_ip(bundle_data, replica, buffer);
1256 bundle_data->replicas = g_list_append(bundle_data->replicas,
1259 bundle_data->container_host_options = g_string_free(buffer, FALSE);
1262 for (GList *gIter = bundle_data->replicas; gIter != NULL;
1263 gIter = gIter->next) {
1266 if (create_replica_resources(rsc, bundle_data, replica) !=
pcmk_rc_ok) {
1288 if (replica->
child != NULL) {
1298 if (bundle_data->child) {
1300 bundle_data->child);
1311 if (child_active && !all) {
1313 }
else if (!child_active && all) {
1327 for (iter = bundle_data->replicas; iter != NULL; iter = iter->next) {
1331 rsc_active = replica_resource_active(replica->
ip, all);
1332 if (rsc_active >= 0) {
1333 return (gboolean) rsc_active;
1336 rsc_active = replica_resource_active(replica->
child, all);
1337 if (rsc_active >= 0) {
1338 return (gboolean) rsc_active;
1341 rsc_active = replica_resource_active(replica->
container, all);
1342 if (rsc_active >= 0) {
1343 return (gboolean) rsc_active;
1346 rsc_active = replica_resource_active(replica->
remote, all);
1347 if (rsc_active >= 0) {
1348 return (gboolean) rsc_active;
1376 for (GList *gIter = bundle_data->replicas; gIter != NULL;
1377 gIter = gIter->next) {
1381 if (pcmk__same_node(replica->
node, node)) {
1382 return replica->
child;
1388 PCMK__OUTPUT_ARGS(
"bundle",
"uint32_t",
"pcmk_resource_t *",
"GList *",
1393 uint32_t show_opts = va_arg(args, uint32_t);
1395 GList *only_node = va_arg(args, GList *);
1396 GList *only_rsc = va_arg(args, GList *);
1400 gboolean printed_header = FALSE;
1401 gboolean print_everything = TRUE;
1403 const char *desc = NULL;
1414 for (GList *gIter = bundle_data->replicas; gIter != NULL;
1415 gIter = gIter->next) {
1422 gboolean print_ip, print_child, print_ctnr, print_remote;
1430 print_ip = (ip != NULL)
1433 print_child = (child != NULL)
1438 print_remote = (remote != NULL)
1442 if (!print_everything && !print_ip && !print_child && !print_ctnr && !print_remote) {
1446 if (!printed_header) {
1447 const char *
type = container_agent_str(bundle_data->agent_type);
1449 const char *maintenance = pcmk__flag_text(rsc->
flags,
1451 const char *managed = pcmk__flag_text(rsc->
flags,
1455 printed_header = TRUE;
1472 id = pcmk__itoa(replica->
offset);
1480 out->message(out, (
const char *) ip->
priv->
xml->name, show_opts,
1481 ip, only_node, only_rsc);
1485 out->message(out, (
const char *) child->
priv->
xml->name,
1486 show_opts, child, only_node, only_rsc);
1490 out->message(out, (
const char *) container->
priv->
xml->name,
1491 show_opts, container, only_node, only_rsc);
1495 out->message(out, (
const char *) remote->
priv->
xml->name,
1496 show_opts, remote, only_node, only_rsc);
1502 if (printed_header) {
1517 char buffer[LINE_MAX];
1524 offset += snprintf(buffer + offset, LINE_MAX - offset,
"%s",
1527 offset += snprintf(buffer + offset, LINE_MAX - offset,
"%s",
1531 offset += snprintf(buffer + offset, LINE_MAX - offset,
" (%s)",
1551 return " (maintenance)";
1554 return " (unmanaged)";
1559 PCMK__OUTPUT_ARGS(
"bundle",
"uint32_t",
"pcmk_resource_t *",
"GList *",
1564 uint32_t show_opts = va_arg(args, uint32_t);
1566 GList *only_node = va_arg(args, GList *);
1567 GList *only_rsc = va_arg(args, GList *);
1569 const char *desc = NULL;
1572 gboolean print_everything = TRUE;
1585 for (GList *gIter = bundle_data->replicas; gIter != NULL;
1586 gIter = gIter->next) {
1592 gboolean print_ip, print_child, print_ctnr, print_remote;
1600 print_ip = (ip != NULL)
1603 print_child = (child != NULL)
1608 print_remote = (remote != NULL)
1613 (print_everything == FALSE && (print_ip || print_child || print_ctnr || print_remote))) {
1620 (bundle_data->nreplicas > 1)?
" set" :
"",
1621 rsc->
id, bundle_data->image,
1623 desc ?
" (" :
"", desc ? desc :
"", desc ?
")" :
"",
1624 get_unmanaged_str(rsc));
1626 if (pcmk__list_of_multiple(bundle_data->replicas)) {
1627 out->begin_list(out, NULL, NULL,
"Replica[%d]", replica->
offset);
1631 out->message(out, (
const char *) ip->
priv->
xml->name,
1632 new_show_opts, ip, only_node, only_rsc);
1636 out->message(out, (
const char *) child->
priv->
xml->name,
1637 new_show_opts, child, only_node, only_rsc);
1641 out->message(out, (
const char *) container->
priv->
xml->name,
1642 new_show_opts, container, only_node, only_rsc);
1646 out->message(out, (
const char *) remote->
priv->
xml->name,
1647 new_show_opts, remote, only_node, only_rsc);
1650 if (pcmk__list_of_multiple(bundle_data->replicas)) {
1653 }
else if (print_everything == FALSE && !(print_ip || print_child || print_ctnr || print_remote)) {
1657 (bundle_data->nreplicas > 1)?
" set" :
"",
1658 rsc->
id, bundle_data->image,
1660 desc ?
" (" :
"", desc ? desc :
"", desc ?
")" :
"",
1661 get_unmanaged_str(rsc));
1663 pe__bundle_replica_output_html(out, replica,
1664 pcmk__current_node(container),
1681 char buffer[LINE_MAX];
1688 offset += snprintf(buffer + offset, LINE_MAX - offset,
"%s",
1691 offset += snprintf(buffer + offset, LINE_MAX - offset,
"%s",
1695 offset += snprintf(buffer + offset, LINE_MAX - offset,
" (%s)",
1702 PCMK__OUTPUT_ARGS(
"bundle",
"uint32_t",
"pcmk_resource_t *",
"GList *",
1707 uint32_t show_opts = va_arg(args, uint32_t);
1709 GList *only_node = va_arg(args, GList *);
1710 GList *only_rsc = va_arg(args, GList *);
1712 const char *desc = NULL;
1715 gboolean print_everything = TRUE;
1728 for (GList *gIter = bundle_data->replicas; gIter != NULL;
1729 gIter = gIter->next) {
1735 gboolean print_ip, print_child, print_ctnr, print_remote;
1743 print_ip = (ip != NULL)
1746 print_child = (child != NULL)
1751 print_remote = (remote != NULL)
1756 (print_everything == FALSE && (print_ip || print_child || print_ctnr || print_remote))) {
1763 (bundle_data->nreplicas > 1)?
" set" :
"",
1764 rsc->
id, bundle_data->image,
1766 desc ?
" (" :
"", desc ? desc :
"", desc ?
")" :
"",
1767 get_unmanaged_str(rsc));
1769 if (pcmk__list_of_multiple(bundle_data->replicas)) {
1770 out->list_item(out, NULL,
"Replica[%d]", replica->
offset);
1773 out->begin_list(out, NULL, NULL, NULL);
1776 out->message(out, (
const char *) ip->
priv->
xml->name,
1777 new_show_opts, ip, only_node, only_rsc);
1781 out->message(out, (
const char *) child->
priv->
xml->name,
1782 new_show_opts, child, only_node, only_rsc);
1786 out->message(out, (
const char *) container->
priv->
xml->name,
1787 new_show_opts, container, only_node, only_rsc);
1791 out->message(out, (
const char *) remote->
priv->
xml->name,
1792 new_show_opts, remote, only_node, only_rsc);
1796 }
else if (print_everything == FALSE && !(print_ip || print_child || print_ctnr || print_remote)) {
1800 (bundle_data->nreplicas > 1)?
" set" :
"",
1801 rsc->
id, bundle_data->image,
1803 desc ?
" (" :
"", desc ? desc :
"", desc ?
")" :
"",
1804 get_unmanaged_str(rsc));
1806 pe__bundle_replica_output_text(out, replica,
1807 pcmk__current_node(container),
1819 if (replica == NULL) {
1824 replica->
node = NULL;
1854 free(bundle_data->prefix);
1855 free(bundle_data->image);
1856 free(bundle_data->control_port);
1857 free(bundle_data->host_network);
1858 free(bundle_data->host_netmask);
1859 free(bundle_data->ip_range_start);
1860 free(bundle_data->container_network);
1861 free(bundle_data->launcher_options);
1862 free(bundle_data->container_command);
1863 g_free(bundle_data->container_host_options);
1865 g_list_free_full(bundle_data->replicas,
1866 (GDestroyNotify) free_bundle_replica);
1867 g_list_free_full(bundle_data->mounts, (GDestroyNotify)mount_free);
1868 g_list_free_full(bundle_data->ports, (GDestroyNotify)port_free);
1871 if(bundle_data->child) {
1873 bundle_data->child->priv->xml = NULL;
1874 bundle_data->child->priv->fns->free(bundle_data->child);
1883 return container_role;
1896 if (pcmk__is_bundle(rsc)) {
1900 return bundle_data->nreplicas;
1911 for (GList *item = bundle_data->replicas; item != NULL; item = item->next) {
1917 if (replica->
child) {
1931 gboolean check_parent)
1933 gboolean passes = FALSE;
1941 for (GList *gIter = bundle_data->replicas; gIter != NULL; gIter = gIter->next) {
1963 if ((remote != NULL)
1987 GList *containers = NULL;
1991 for (GList *iter =
data->replicas; iter != NULL; iter = iter->next) {
1994 containers = g_list_append(containers, replica->
container);
2002 unsigned int *count_clean)
2007 GList *containers = NULL;
2009 GHashTable *nodes = NULL;
2012 if (count_all != NULL) {
2015 if (count_clean != NULL) {
2026 for (iter =
data->replicas; iter != NULL; iter = iter->next) {
2030 containers = g_list_append(containers, replica->
container);
2033 if (containers == NULL) {
2043 if (pcmk__list_of_1(containers)) {
2044 container = containers->data;
2047 g_list_free(containers);
2052 nodes = g_hash_table_new(NULL, NULL);
2053 for (iter = containers; iter != NULL; iter = iter->next) {
2054 container = iter->data;
2056 node_iter != NULL; node_iter = node_iter->next) {
2058 node = node_iter->data;
2061 if (g_hash_table_insert(nodes, (gpointer) node->
details,
2071 g_list_free(containers);
2072 g_hash_table_destroy(nodes);
2091 return (
unsigned int) bundle_data->nreplicas_per_host;
const pcmk_resource_t * pe__const_top_resource(const pcmk_resource_t *rsc, bool include_bundle)
#define CRM_CHECK(expr, failure_action)
pcmk_node_t * pcmk_find_node(const pcmk_scheduler_t *scheduler, const char *node_name)
Find a node by name in scheduler data.
enum pcmk__probe_mode probe_mode
void pe__count_bundle(pcmk_resource_t *rsc)
xmlNode * pcmk__xml_copy(xmlNode *parent, xmlNode *src)
pcmk_node_t * pe__copy_node(const pcmk_node_t *this_node)
xmlNode * pcmk__xe_first_child(const xmlNode *parent, const char *node_name, const char *attr_n, const char *attr_v)
#define PCMK_XA_REPLICAS_PER_HOST
#define PCMK_META_PROMOTABLE
Control output from tools.
pcmk_node_t * node
Copy of node created for this instance.
gboolean(* active)(pcmk_resource_t *rsc, gboolean all)
#define PCMK__SERVER_REMOTED
int pcmk__scan_min_int(const char *text, int *result, int minimum)
gboolean pe__bundle_active(pcmk_resource_t *rsc, gboolean all)
enum pcmk_ipc_server type
#define PCMK_XE_PRIMITIVE
#define PE__CONTAINER_AGENT_DOCKER_S
#define pcmk__rsc_trace(rsc, fmt, args...)
#define PCMK_META_CONTAINER_ATTRIBUTE_TARGET
gboolean(* is_filtered)(const pcmk_resource_t *rsc, GList *only_rsc, gboolean check_parent)
pcmk_resource_t * pe_find_resource(GList *rsc_list, const char *id)
gboolean pe__unpack_bundle(pcmk_resource_t *rsc, pcmk_scheduler_t *scheduler)
#define pcmk__set_rsc_flags(resource, flags_to_set)
#define pcmk__insert_meta(obj, name, value)
#define pcmk__config_err(fmt...)
pcmk_resource_t * ip
IP address resource for ipaddr.
#define PCMK_ACTION_MONITOR
const char * pe__resource_description(const pcmk_resource_t *rsc, uint32_t show_opts)
#define PCMK_REMOTE_RA_ADDR
#define PCMK_XE_STORAGE_MAPPING
#define PCMK_XA_INTERNAL_PORT
pcmk__scheduler_private_t * priv
pcmk_node_t * pe_create_node(const char *id, const char *uname, const char *type, int score, pcmk_scheduler_t *scheduler)
#define PCMK__ENV_REMOTE_PORT
#define PCMK_XE_PORT_MAPPING
const pcmk_resource_t * pe__get_rsc_in_container(const pcmk_resource_t *instance)
void pcmk__add_separated_word(GString **list, size_t init_size, const char *word, const char *separator)
#define PCMK_RESOURCE_CLASS_OCF
#define CRM_LOG_ASSERT(expr)
#define PCMK_META_CLONE_MAX
const char * rsc_printable_id(const pcmk_resource_t *rsc)
char * ipaddr
IP address associated with this instance.
const pcmk__rsc_methods_t * fns
unsigned int pe__bundle_max_per_node(const pcmk_resource_t *rsc)
void pcmk__free_node_copy(void *data)
int pe__unpack_resource(xmlNode *xml_obj, pcmk_resource_t **rsc, pcmk_resource_t *parent, pcmk_scheduler_t *scheduler)
xmlNode * pcmk__xe_create(xmlNode *parent, const char *name)
int pe__bundle_html(pcmk__output_t *out, va_list args)
#define DEFAULT_REMOTE_PORT
void pcmk__xml_free(xmlNode *xml)
#define DEFAULT_REMOTE_KEY_LOCATION
#define get_bundle_variant_data(data, rsc)
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
struct pe__bundle_variant_data_s pe__bundle_variant_data_t
int pe__bundle_max(const pcmk_resource_t *rsc)
pcmk__node_private_t * priv
xmlNode * pe_create_remote_xml(xmlNode *parent, const char *uname, const char *container_id, const char *migrateable, const char *is_managed, const char *start_timeout, const char *server, const char *port)
#define PCMK_META_GLOBALLY_UNIQUE
void pe__foreach_const_bundle_replica(const pcmk_resource_t *bundle, bool(*fn)(const pcmk__bundle_replica_t *, void *), void *user_data)
void common_free(pcmk_resource_t *rsc)
int pe__bundle_text(pcmk__output_t *out, va_list args)
pcmk_scheduler_t * scheduler
void(* count)(pcmk_resource_t *rsc)
#define PCMK_META_CLONE_NODE_MAX
int pe__name_and_nvpairs_xml(pcmk__output_t *out, bool is_list, const char *tag_name,...) G_GNUC_NULL_TERMINATED
bool pe__bundle_needs_remote_name(pcmk_resource_t *rsc)
char * crm_element_value_copy(const xmlNode *data, const char *name)
Retrieve a copy of the value of an XML attribute.
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
#define PCMK__SERVER_EXECD
#define PCMK_XA_DESCRIPTION
#define crm_trace(fmt, args...)
#define PE__CONTAINER_AGENT_PODMAN_S
void pcmk__g_strcat(GString *buffer,...) G_GNUC_NULL_TERMINATED
bool xml_contains_remote_node(xmlNode *xml)
pcmk_node_t * assigned_node
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
#define pe__set_bundle_mount_flags(mount_xml, flags, flags_to_set)
pcmk__resource_private_t * priv
pcmk_resource_t * pe__first_container(const pcmk_resource_t *bundle)
Wrappers for and extensions to libxml2.
#define pcmk__clear_rsc_flags(resource, flags_to_clear)
#define PCMK_XE_OPERATIONS
enum rsc_role_e pe__bundle_resource_state(const pcmk_resource_t *rsc, gboolean current)
#define pcmk__str_copy(str)
pcmk_resource_t * child
Instance of bundled resource.
void pcmk__output_xml_pop_parent(pcmk__output_t *out)
GList * pe__bundle_containers(const pcmk_resource_t *bundle)
bool pe__node_is_bundle_instance(const pcmk_resource_t *bundle, const pcmk_node_t *node)
#define PCMK_XA_CONTROL_PORT
#define PCMK_XA_MAINTENANCE
#define PCMK_XE_META_ATTRIBUTES
GHashTable * allowed_nodes
A single instance of a bundle.
xmlNode * pcmk__xe_next(const xmlNode *node, const char *element_name)
#define pcmk__assert(expr)
#define PE__CONTAINER_AGENT_UNKNOWN_S
#define PCMK__OUTPUT_LIST_FOOTER(out_obj, retcode)
#define PCMK_XA_IP_RANGE_START
#define PCMK_XA_TARGET_DIR
pcmk_resource_t * container
Container associated with this instance.
int pe__bundle_xml(pcmk__output_t *out, va_list args)
#define PCMK_XA_SOURCE_DIR
#define PCMK__OUTPUT_LIST_HEADER(out_obj, cond, retcode, title...)
int pe__common_output_html(pcmk__output_t *out, const pcmk_resource_t *rsc, const char *name, const pcmk_node_t *node, unsigned int options)
Cluster status and scheduling.
const char * pe__add_bundle_remote_name(pcmk_resource_t *rsc, xmlNode *xml, const char *field)
GHashTable * pcmk__strkey_table(GDestroyNotify key_destroy_func, GDestroyNotify value_destroy_func)
pcmk_scheduler_t * scheduler
int pe__common_output_text(pcmk__output_t *out, const pcmk_resource_t *rsc, const char *name, const pcmk_node_t *node, unsigned int options)
#define PCMK_XA_PROMOTED_MAX
pcmk_resource_t * pe__find_bundle_replica(const pcmk_resource_t *bundle, const pcmk_node_t *node)
pcmk_resource_t * launcher
void pe__free_bundle(pcmk_resource_t *rsc)
bool pcmk__rsc_filtered_by_node(pcmk_resource_t *rsc, GList *only_node)
This structure contains everything that makes up a single output formatter.
void pcmk__xe_set_id(xmlNode *xml, const char *format,...) G_GNUC_PRINTF(2
#define PCMK_META_PROMOTED_MAX
#define PCMK_XA_HOST_INTERFACE
int crm_str_to_boolean(const char *s, int *ret)
gboolean pe__bundle_is_filtered(const pcmk_resource_t *rsc, GList *only_rsc, gboolean check_parent)
void pcmk__xml_sanitize_id(char *id)
xmlNode * crm_create_op_xml(xmlNode *parent, const char *prefix, const char *task, const char *interval_spec, const char *timeout)
Create a CIB XML element for an operation.
bool pe__count_active_node(const pcmk_resource_t *rsc, pcmk_node_t *node, pcmk_node_t **active, unsigned int *count_all, unsigned int *count_clean)
Resource role is unknown.
int pe_bundle_replicas(const pcmk_resource_t *rsc)
Get the number of configured replicas in a bundle.
pcmk_node_t * pe__bundle_active_node(const pcmk_resource_t *rsc, unsigned int *count_all, unsigned int *count_clean)
#define PCMK_META_ORDERED
xmlNode * crm_create_nvpair_xml(xmlNode *parent, const char *id, const char *name, const char *value)
Create an XML name/value pair.
GHashTable * pe_rsc_params(pcmk_resource_t *rsc, const pcmk_node_t *node, pcmk_scheduler_t *scheduler)
Get a table of resource parameters.
#define PCMK_XA_RUN_COMMAND
void(* free)(pcmk_resource_t *rsc)
struct pcmk__node_details * details
#define PCMK_XA_SOURCE_DIR_ROOT
#define pcmk__assert_alloc(nmemb, size)
#define PCMK_XE_INSTANCE_ATTRIBUTES
int offset
0-origin index of this instance in bundle
void pe__foreach_bundle_replica(pcmk_resource_t *bundle, bool(*fn)(pcmk__bundle_replica_t *, void *), void *user_data)
pcmk_resource_t * remote
Pacemaker Remote connection into container.
#define PCMK_VALUE_REMOTE
#define PCMK_XA_HOST_NETMASK
void pcmk__insert_dup(GHashTable *table, const char *name, const char *value)
pcmk_node_t *(* active_node)(const pcmk_resource_t *rsc, unsigned int *count_all, unsigned int *count_clean)
#define PCMK_SCORE_INFINITY
Integer score to use to represent "infinity".
pcmk_resource_t * pe__bundled_resource(const pcmk_resource_t *rsc)
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
gboolean pcmk__str_in_list(const gchar *s, const GList *lst, uint32_t flags)
struct pcmk__node_assignment * assign