49 #define PE__CONTAINER_AGENT_UNKNOWN_S "unknown" 50 #define PE__CONTAINER_AGENT_DOCKER_S "docker" 51 #define PE__CONTAINER_AGENT_RKT_S "rkt" 52 #define PE__CONTAINER_AGENT_PODMAN_S "podman" 54 typedef struct pe__bundle_variant_data_s {
57 int nreplicas_per_host;
64 char *container_network;
67 gchar *container_host_options;
68 char *container_command;
69 char *launcher_options;
70 const char *attribute_target;
81 #define get_bundle_variant_data(data, rsc) \ 82 pcmk__assert(pcmk__is_bundle(rsc) && (rsc->variant_opaque != NULL)); \ 83 data = (pe__bundle_variant_data_t *) rsc->variant_opaque; 99 return bundle_data->nreplicas;
116 return bundle_data->child;
134 if (!pcmk__is_bundle(top)) {
139 for (
const GList *iter =
data->replicas; iter != NULL; iter = iter->next) {
143 return replica->
child;
165 for (GList *iter = bundle_data->replicas; iter != NULL; iter = iter->next) {
168 if (pcmk__same_node(node, replica->
node)) {
191 if (bundle_data->replicas == NULL) {
194 replica = bundle_data->replicas->data;
215 for (GList *iter = bundle_data->replicas; iter != NULL; iter = iter->next) {
240 for (
const GList *iter = bundle_data->replicas; iter != NULL;
250 next_ip(
const char *last_ip)
252 unsigned int oct1 = 0;
253 unsigned int oct2 = 0;
254 unsigned int oct3 = 0;
255 unsigned int oct4 = 0;
256 int rc = sscanf(last_ip,
"%u.%u.%u.%u", &oct1, &oct2, &oct3, &oct4);
262 }
else if (oct3 > 253) {
265 }
else if (oct4 > 253) {
280 if(
data->ip_range_start == NULL) {
283 }
else if(
data->ip_last) {
287 replica->
ipaddr = strdup(
data->ip_range_start);
291 switch (
data->agent_type) {
294 if (
data->add_host) {
295 g_string_append_printf(buffer,
" --add-host=%s-%d:%s",
299 g_string_append_printf(buffer,
" --hosts-entry=%s=%s-%d",
306 g_string_append_printf(buffer,
" --hosts-entry=%s=%s-%d",
317 create_resource(
const char *
name,
const char *provider,
const char *kind)
344 if(
data->ip_range_start) {
347 if(
data->control_port) {
348 if(
data->nreplicas_per_host > 1) {
352 data->nreplicas_per_host = 1;
365 if(
data->ip_range_start) {
367 xmlNode *xml_ip = NULL;
368 xmlNode *xml_obj = NULL;
372 xml_ip = create_resource(
id,
"heartbeat",
"IPaddr2");
380 if(
data->host_network) {
384 if(
data->host_netmask) {
386 "cidr_netmask",
data->host_netmask);
427 xmlNode *xml_container = NULL;
428 xmlNode *xml_obj = NULL;
431 const char *hostname_opt = NULL;
432 const char *env_opt = NULL;
433 const char *agent_str = NULL;
436 GString *buffer = NULL;
437 GString *dbuffer = NULL;
440 switch (
data->agent_type) {
443 hostname_opt =
"-h ";
447 hostname_opt =
"--hostname=";
448 env_opt =
"--environment=";
453 agent_str = container_agent_str(
data->agent_type);
455 buffer = g_string_sized_new(4096);
460 xml_container = create_resource(
id,
"heartbeat", agent_str);
472 g_string_append(buffer,
" --restart=no");
480 if (
data->ip_range_start != NULL) {
481 g_string_append_printf(buffer,
" %s%s-%d", hostname_opt,
data->prefix,
486 if (
data->container_network != NULL) {
490 if (
data->control_port != NULL) {
492 data->control_port, NULL);
498 for (GList *iter =
data->mounts; iter != NULL; iter = iter->next) {
499 pe__bundle_mount_t *mount = (pe__bundle_mount_t *) iter->data;
508 switch (
data->agent_type) {
512 " -v ", pcmk__s(source, mount->source),
513 ":", mount->target, NULL);
515 if (mount->options != NULL) {
520 g_string_append_printf(buffer,
521 " --volume vol%d,kind=host," 523 "--mount volume=vol%d,target=%s",
524 volid, pcmk__s(source, mount->source),
525 (mount->options != NULL)?
"," :
"",
526 pcmk__s(mount->options,
""),
527 volid, mount->target);
536 for (GList *iter =
data->ports; iter != NULL; iter = iter->next) {
537 pe__bundle_port_t *port = (pe__bundle_port_t *) iter->data;
539 switch (
data->agent_type) {
542 if (replica->
ipaddr != NULL) {
544 " -p ", replica->
ipaddr,
":", port->source,
545 ":", port->target, NULL);
547 }
else if (!pcmk__str_eq(
data->container_network,
551 " -p ", port->source,
":", port->target,
556 if (replica->
ipaddr != NULL) {
558 " --port=", port->target,
559 ":", replica->
ipaddr,
":", port->source,
563 " --port=", port->target,
":", port->source,
584 if (
data->launcher_options != NULL) {
588 if (
data->container_host_options != NULL) {
593 (
const char *) buffer->str);
594 g_string_free(buffer, TRUE);
597 (dbuffer != NULL)? (
const char *) dbuffer->str :
"");
598 if (dbuffer != NULL) {
599 g_string_free(dbuffer, TRUE);
602 if (replica->
child != NULL) {
603 if (
data->container_command != NULL) {
605 data->container_command);
624 }
else if ((child != NULL) &&
data->untrusted) {
631 if (
data->container_command != NULL) {
633 data->container_command);
675 g_list_foreach(rsc->
children, (GFunc) disallow_node, (gpointer)
uname);
683 if (replica->
child && valid_network(
data)) {
684 GHashTableIter gIter;
686 xmlNode *xml_remote = NULL;
689 const char *
uname = NULL;
690 const char *connect_name = NULL;
706 connect_name = (replica->
ipaddr? replica->
ipaddr :
"#uname");
708 if (
data->control_port == NULL) {
719 connect_name, (
data->control_port?
720 data->control_port : port_s));
729 uname = pcmk__xe_id(xml_remote);
761 g_list_foreach(
parent->cluster->resources, (GFunc) disallow_node,
789 while (g_hash_table_iter_next(&gIter, NULL, (
void **)&node)) {
790 if (pcmk__is_pacemaker_remote_node(node)) {
828 rc = create_container_resource(
parent,
data, replica);
833 rc = create_ip_resource(
parent,
data, replica);
838 rc = create_remote_resource(
parent,
data, replica);
843 if ((replica->
child != NULL) && (replica->
ipaddr != NULL)) {
847 if (replica->
remote != NULL) {
863 const char *
target,
const char *options, uint32_t
flags)
866 sizeof(pe__bundle_mount_t));
871 mount->flags =
flags;
872 bundle_data->mounts = g_list_append(bundle_data->mounts, mount);
876 mount_free(pe__bundle_mount_t *mount)
880 free(mount->options);
885 port_free(pe__bundle_port_t *port)
902 while (top->
parent != NULL) {
907 for (GList *gIter = bundle_data->replicas; gIter != NULL;
908 gIter = gIter->next) {
911 if (replica->
remote == remote) {
923 GHashTable *params = NULL;
950 replica = replica_for_remote(rsc);
951 if (replica == NULL) {
960 node = pcmk__current_node(replica->
container);
964 crm_trace(
"Cannot determine address for bundle connection %s", rsc->
id);
968 crm_trace(
"Setting address for bundle connection %s to bundle host %s",
969 rsc->
id, pcmk__node_name(node));
970 if(xml != NULL && field != NULL) {
977 #define pe__set_bundle_mount_flags(mount_xml, flags, flags_to_set) do { \ 978 flags = pcmk__set_flags_as(__func__, __LINE__, LOG_TRACE, \ 979 "Bundle mount", pcmk__xe_id(mount_xml), \ 980 flags, (flags_to_set), #flags_to_set); \ 986 const char *value = NULL;
987 xmlNode *xml_obj = NULL;
988 const xmlNode *xml_child = NULL;
989 xmlNode *xml_resource = NULL;
991 bool need_log_mount = TRUE;
998 bundle_data->prefix = strdup(rsc->
id);
1001 if (xml_obj != NULL) {
1005 if (xml_obj != NULL) {
1008 "(such as %s) is deprecated and will be " 1009 "removed in a future release", rsc->
id);
1014 if (xml_obj != NULL) {
1024 if (value == NULL) {
1028 if (value != NULL) {
1031 " attribute (such as in %s) is deprecated and " 1032 "will be removed in a future release. Use " 1043 if ((value == NULL) && (bundle_data->promoted_max > 0)) {
1044 bundle_data->nreplicas = bundle_data->promoted_max;
1056 if (bundle_data->nreplicas_per_host == 1) {
1060 bundle_data->container_command =
1070 bundle_data->ip_range_start =
1072 bundle_data->host_netmask =
1074 bundle_data->host_network =
1076 bundle_data->control_port =
1080 bundle_data->add_host = TRUE;
1087 pe__bundle_port_t *port =
1092 if(port->source == NULL) {
1099 if(port->source != NULL && strlen(port->source) > 0) {
1100 if(port->target == NULL) {
1101 port->target = strdup(port->source);
1103 bundle_data->ports = g_list_append(bundle_data->ports, port);
1107 pcmk__xe_id(xml_child));
1123 if (source == NULL) {
1130 mount_add(bundle_data, source,
target, options,
flags);
1131 if (strcmp(
target,
"/var/log") == 0) {
1132 need_log_mount = FALSE;
1136 pcmk__xe_id(xml_child));
1141 if (xml_obj && valid_network(bundle_data)) {
1143 xmlNode *xml_set = NULL;
1152 (bundle_data->promoted_max?
"master" 1153 : (
const char *)xml_resource->name));
1156 crm_xml_set_id(xml_set,
"%s-%s-meta", bundle_data->prefix, xml_resource->name);
1161 value = pcmk__itoa(bundle_data->nreplicas);
1165 value = pcmk__itoa(bundle_data->nreplicas_per_host);
1170 pcmk__btoa(bundle_data->nreplicas_per_host > 1));
1172 if (bundle_data->promoted_max) {
1176 value = pcmk__itoa(bundle_data->promoted_max);
1184 }
else if(xml_obj) {
1187 rsc->
id, pcmk__xe_id(xml_obj));
1193 GList *childIter = NULL;
1194 pe__bundle_port_t *port = NULL;
1195 GString *buffer = NULL;
1226 if (need_log_mount) {
1232 if(bundle_data->control_port) {
1233 port->source = strdup(bundle_data->control_port);
1246 port->target = strdup(port->source);
1247 bundle_data->ports = g_list_append(bundle_data->ports, port);
1249 buffer = g_string_sized_new(1024);
1250 for (childIter = bundle_data->child->children; childIter != NULL;
1251 childIter = childIter->next) {
1256 replica->
child = childIter->data;
1265 allocate_ip(bundle_data, replica, buffer);
1266 bundle_data->replicas = g_list_append(bundle_data->replicas,
1268 bundle_data->attribute_target =
1269 g_hash_table_lookup(replica->
child->
meta,
1272 bundle_data->container_host_options = g_string_free(buffer, FALSE);
1274 if (bundle_data->attribute_target) {
1276 bundle_data->attribute_target);
1279 bundle_data->attribute_target);
1284 GString *buffer = g_string_sized_new(1024);
1286 for (
int lpc = 0; lpc < bundle_data->nreplicas; lpc++) {
1291 allocate_ip(bundle_data, replica, buffer);
1292 bundle_data->replicas = g_list_append(bundle_data->replicas,
1295 bundle_data->container_host_options = g_string_free(buffer, FALSE);
1298 for (GList *gIter = bundle_data->replicas; gIter != NULL;
1299 gIter = gIter->next) {
1302 if (create_replica_resources(rsc, bundle_data, replica) !=
pcmk_rc_ok) {
1324 if (replica->
child != NULL) {
1332 if (bundle_data->child) {
1342 gboolean child_active = rsc->
fns->
active(rsc, all);
1344 if (child_active && !all) {
1346 }
else if (!child_active && all) {
1360 for (iter = bundle_data->replicas; iter != NULL; iter = iter->next) {
1364 rsc_active = replica_resource_active(replica->
ip, all);
1365 if (rsc_active >= 0) {
1366 return (gboolean) rsc_active;
1369 rsc_active = replica_resource_active(replica->
child, all);
1370 if (rsc_active >= 0) {
1371 return (gboolean) rsc_active;
1374 rsc_active = replica_resource_active(replica->
container, all);
1375 if (rsc_active >= 0) {
1376 return (gboolean) rsc_active;
1379 rsc_active = replica_resource_active(replica->
remote, all);
1380 if (rsc_active >= 0) {
1381 return (gboolean) rsc_active;
1409 for (GList *gIter = bundle_data->replicas; gIter != NULL;
1410 gIter = gIter->next) {
1414 if (pcmk__same_node(replica->
node, node)) {
1415 return replica->
child;
1426 print_rsc_in_list(
pcmk_resource_t *rsc,
const char *pre_text,
long options,
1433 rsc->
fns->
print(rsc, pre_text, options, print_data);
1445 bundle_print_xml(
pcmk_resource_t *rsc,
const char *pre_text,
long options,
1449 char *child_text = NULL;
1452 if (pre_text == NULL) {
1461 status_print(
"type=\"%s\" ", container_agent_str(bundle_data->agent_type));
1471 for (GList *gIter = bundle_data->replicas; gIter != NULL;
1472 gIter = gIter->next) {
1477 pre_text, replica->
offset);
1478 print_rsc_in_list(replica->
ip, child_text, options, print_data);
1479 print_rsc_in_list(replica->
child, child_text, options, print_data);
1480 print_rsc_in_list(replica->
container, child_text, options, print_data);
1481 print_rsc_in_list(replica->
remote, child_text, options, print_data);
1493 uint32_t show_opts = va_arg(args, uint32_t);
1495 GList *only_node = va_arg(args, GList *);
1496 GList *only_rsc = va_arg(args, GList *);
1500 gboolean printed_header = FALSE;
1501 gboolean print_everything = TRUE;
1503 const char *desc = NULL;
1515 for (GList *gIter = bundle_data->replicas; gIter != NULL;
1516 gIter = gIter->next) {
1519 gboolean print_ip, print_child, print_ctnr, print_remote;
1527 print_ip = replica->
ip != NULL &&
1529 print_child = replica->
child != NULL &&
1532 print_remote = replica->
remote != NULL &&
1535 if (!print_everything && !print_ip && !print_child && !print_ctnr && !print_remote) {
1539 if (!printed_header) {
1540 const char *
type = container_agent_str(bundle_data->agent_type);
1542 const char *maintenance = pcmk__flag_text(rsc->
flags,
1547 printed_header = TRUE;
1564 id = pcmk__itoa(replica->
offset);
1572 out->message(out, (
const char *) replica->
ip->
xml->name, show_opts,
1573 replica->
ip, only_node, only_rsc);
1577 out->message(out, (
const char *) replica->
child->
xml->name,
1578 show_opts, replica->
child, only_node, only_rsc);
1582 out->message(out, (
const char *) replica->
container->
xml->name,
1583 show_opts, replica->
container, only_node, only_rsc);
1587 out->message(out, (
const char *) replica->
remote->
xml->name,
1588 show_opts, replica->
remote, only_node, only_rsc);
1594 if (printed_header) {
1609 char buffer[LINE_MAX];
1616 offset += snprintf(buffer + offset, LINE_MAX - offset,
"%s",
1619 offset += snprintf(buffer + offset, LINE_MAX - offset,
"%s",
1623 offset += snprintf(buffer + offset, LINE_MAX - offset,
" (%s)",
1643 return " (maintenance)";
1646 return " (unmanaged)";
1656 uint32_t show_opts = va_arg(args, uint32_t);
1658 GList *only_node = va_arg(args, GList *);
1659 GList *only_rsc = va_arg(args, GList *);
1661 const char *desc = NULL;
1664 gboolean print_everything = TRUE;
1678 for (GList *gIter = bundle_data->replicas; gIter != NULL;
1679 gIter = gIter->next) {
1681 gboolean print_ip, print_child, print_ctnr, print_remote;
1689 print_ip = replica->
ip != NULL &&
1691 print_child = replica->
child != NULL &&
1694 print_remote = replica->
remote != NULL &&
1698 (print_everything == FALSE && (print_ip || print_child || print_ctnr || print_remote))) {
1705 (bundle_data->nreplicas > 1)?
" set" :
"",
1706 rsc->
id, bundle_data->image,
1708 desc ?
" (" :
"", desc ? desc :
"", desc ?
")" :
"",
1709 get_unmanaged_str(rsc));
1711 if (pcmk__list_of_multiple(bundle_data->replicas)) {
1712 out->begin_list(out, NULL, NULL,
"Replica[%d]", replica->
offset);
1716 out->message(out, (
const char *) replica->
ip->
xml->name,
1717 new_show_opts, replica->
ip, only_node, only_rsc);
1721 out->message(out, (
const char *) replica->
child->
xml->name,
1722 new_show_opts, replica->
child, only_node,
1727 out->message(out, (
const char *) replica->
container->
xml->name,
1728 new_show_opts, replica->
container, only_node,
1733 out->message(out, (
const char *) replica->
remote->
xml->name,
1734 new_show_opts, replica->
remote, only_node,
1738 if (pcmk__list_of_multiple(bundle_data->replicas)) {
1741 }
else if (print_everything == FALSE && !(print_ip || print_child || print_ctnr || print_remote)) {
1745 (bundle_data->nreplicas > 1)?
" set" :
"",
1746 rsc->
id, bundle_data->image,
1748 desc ?
" (" :
"", desc ? desc :
"", desc ?
")" :
"",
1749 get_unmanaged_str(rsc));
1751 pe__bundle_replica_output_html(out, replica,
1769 char buffer[LINE_MAX];
1776 offset += snprintf(buffer + offset, LINE_MAX - offset,
"%s",
1779 offset += snprintf(buffer + offset, LINE_MAX - offset,
"%s",
1783 offset += snprintf(buffer + offset, LINE_MAX - offset,
" (%s)",
1795 uint32_t show_opts = va_arg(args, uint32_t);
1797 GList *only_node = va_arg(args, GList *);
1798 GList *only_rsc = va_arg(args, GList *);
1800 const char *desc = NULL;
1803 gboolean print_everything = TRUE;
1817 for (GList *gIter = bundle_data->replicas; gIter != NULL;
1818 gIter = gIter->next) {
1820 gboolean print_ip, print_child, print_ctnr, print_remote;
1828 print_ip = replica->
ip != NULL &&
1830 print_child = replica->
child != NULL &&
1833 print_remote = replica->
remote != NULL &&
1837 (print_everything == FALSE && (print_ip || print_child || print_ctnr || print_remote))) {
1844 (bundle_data->nreplicas > 1)?
" set" :
"",
1845 rsc->
id, bundle_data->image,
1847 desc ?
" (" :
"", desc ? desc :
"", desc ?
")" :
"",
1848 get_unmanaged_str(rsc));
1850 if (pcmk__list_of_multiple(bundle_data->replicas)) {
1851 out->list_item(out, NULL,
"Replica[%d]", replica->
offset);
1854 out->begin_list(out, NULL, NULL, NULL);
1857 out->message(out, (
const char *) replica->
ip->
xml->name,
1858 new_show_opts, replica->
ip, only_node, only_rsc);
1862 out->message(out, (
const char *) replica->
child->
xml->name,
1863 new_show_opts, replica->
child, only_node,
1868 out->message(out, (
const char *) replica->
container->
xml->name,
1869 new_show_opts, replica->
container, only_node,
1874 out->message(out, (
const char *) replica->
remote->
xml->name,
1875 new_show_opts, replica->
remote, only_node,
1880 }
else if (print_everything == FALSE && !(print_ip || print_child || print_ctnr || print_remote)) {
1884 (bundle_data->nreplicas > 1)?
" set" :
"",
1885 rsc->
id, bundle_data->image,
1887 desc ?
" (" :
"", desc ? desc :
"", desc ?
")" :
"",
1888 get_unmanaged_str(rsc));
1890 pe__bundle_replica_output_text(out, replica,
1906 long options,
void *print_data)
1912 char buffer[LINE_MAX];
1919 offset += snprintf(buffer + offset, LINE_MAX - offset,
"%s",
1922 offset += snprintf(buffer + offset, LINE_MAX - offset,
"%s",
1926 offset += snprintf(buffer + offset, LINE_MAX - offset,
" (%s)",
1930 node = pcmk__current_node(replica->
container);
1931 common_print(rsc, pre_text, buffer, node, options, print_data);
1943 char *child_text = NULL;
1947 bundle_print_xml(rsc, pre_text, options, print_data);
1953 if (pre_text == NULL) {
1958 pre_text, ((bundle_data->nreplicas > 1)?
" set" :
""),
1959 rsc->
id, bundle_data->image,
1967 for (GList *gIter = bundle_data->replicas; gIter != NULL;
1968 gIter = gIter->next) {
1978 if (pcmk__list_of_multiple(bundle_data->replicas)) {
1984 print_rsc_in_list(replica->
ip, child_text, options, print_data);
1985 print_rsc_in_list(replica->
container, child_text, options, print_data);
1986 print_rsc_in_list(replica->
remote, child_text, options, print_data);
1987 print_rsc_in_list(replica->
child, child_text, options, print_data);
1993 print_bundle_replica(replica, child_text, options, print_data);
2009 if (replica == NULL) {
2013 if (replica->
node) {
2014 free(replica->
node);
2015 replica->
node = NULL;
2020 replica->
ip->
xml = NULL;
2049 free(bundle_data->prefix);
2050 free(bundle_data->image);
2051 free(bundle_data->control_port);
2052 free(bundle_data->host_network);
2053 free(bundle_data->host_netmask);
2054 free(bundle_data->ip_range_start);
2055 free(bundle_data->container_network);
2056 free(bundle_data->launcher_options);
2057 free(bundle_data->container_command);
2058 g_free(bundle_data->container_host_options);
2060 g_list_free_full(bundle_data->replicas,
2061 (GDestroyNotify) free_bundle_replica);
2062 g_list_free_full(bundle_data->mounts, (GDestroyNotify)mount_free);
2063 g_list_free_full(bundle_data->ports, (GDestroyNotify)port_free);
2066 if(bundle_data->child) {
2068 bundle_data->child->xml = NULL;
2069 bundle_data->child->fns->free(bundle_data->child);
2078 return container_role;
2091 if (pcmk__is_bundle(rsc)) {
2095 return bundle_data->nreplicas;
2106 for (GList *item = bundle_data->replicas; item != NULL; item = item->next) {
2112 if (replica->
child) {
2126 gboolean check_parent)
2128 gboolean passes = FALSE;
2136 for (GList *gIter = bundle_data->replicas; gIter != NULL; gIter = gIter->next) {
2171 GList *containers = NULL;
2175 for (GList *iter =
data->replicas; iter != NULL; iter = iter->next) {
2178 containers = g_list_append(containers, replica->
container);
2186 unsigned int *count_clean)
2191 GList *containers = NULL;
2193 GHashTable *nodes = NULL;
2196 if (count_all != NULL) {
2199 if (count_clean != NULL) {
2210 for (iter =
data->replicas; iter != NULL; iter = iter->next) {
2214 containers = g_list_append(containers, replica->
container);
2217 if (containers == NULL) {
2227 if (pcmk__list_of_1(containers)) {
2228 container = containers->data;
2229 node = container->
fns->
active_node(container, count_all, count_clean);
2230 g_list_free(containers);
2235 nodes = g_hash_table_new(NULL, NULL);
2236 for (iter = containers; iter != NULL; iter = iter->next) {
2237 container = iter->data;
2239 for (GList *node_iter = container->
running_on; node_iter != NULL;
2240 node_iter = node_iter->next) {
2241 node = node_iter->data;
2244 if (g_hash_table_insert(nodes, (gpointer) node->
details,
2254 g_list_free(containers);
2255 g_hash_table_destroy(nodes);
2274 return (
unsigned int) bundle_data->nreplicas_per_host;
const pcmk_resource_t * pe__const_top_resource(const pcmk_resource_t *rsc, bool include_bundle)
void pe__print_bundle(pcmk_resource_t *rsc, const char *pre_text, long options, void *print_data)
#define PCMK__XA_PROMOTED_MAX_LEGACY
#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.
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)
pcmk_scheduler_t * cluster
#define PCMK_XA_REPLICAS_PER_HOST
#define PCMK_META_PROMOTABLE
Control output from tools.
pcmk_node_t * node
Node created for this instance.
int pcmk__scan_min_int(const char *text, int *result, int minimum)
gboolean pe__bundle_active(pcmk_resource_t *rsc, gboolean all)
#define PCMK_XE_PRIMITIVE
#define PE__CONTAINER_AGENT_DOCKER_S
#define pcmk__rsc_trace(rsc, fmt, args...)
#define PCMK_META_CONTAINER_ATTRIBUTE_TARGET
pcmk_resource_t * pe_find_resource(GList *rsc_list, const char *id)
gboolean pe__unpack_bundle(pcmk_resource_t *rsc, pcmk_scheduler_t *scheduler)
gboolean exclusive_discover
#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)
void common_print(pcmk_resource_t *rsc, const char *pre_text, const char *name, const pcmk_node_t *node, long options, void *print_data)
#define PCMK_REMOTE_RA_ADDR
#define PCMK_XE_STORAGE_MAPPING
#define PCMK_XA_INTERNAL_PORT
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
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
enum crm_ais_msg_types type
const char * rsc_printable_id(const pcmk_resource_t *rsc)
char * ipaddr
IP address associated with this instance.
unsigned int pe__bundle_max_per_node(const pcmk_resource_t *rsc)
void(* print)(pcmk_resource_t *rsc, const char *pre_text, long options, void *print_data)
pcmk_resource_t * container
int pe__unpack_resource(xmlNode *xml_obj, pcmk_resource_t **rsc, pcmk_resource_t *parent, pcmk_scheduler_t *scheduler)
int pe__bundle_html(pcmk__output_t *out, va_list args)
void crm_xml_sanitize_id(char *id)
Sanitize a string so it is usable as an XML ID.
#define DEFAULT_REMOTE_PORT
#define DEFAULT_REMOTE_KEY_LOCATION
#define get_bundle_variant_data(data, rsc)
struct pe__bundle_variant_data_s pe__bundle_variant_data_t
int pe__bundle_max(const pcmk_resource_t *rsc)
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)
void(* free)(pcmk_resource_t *rsc)
int pe__bundle_text(pcmk__output_t *out, va_list args)
char * crm_element_value_copy(const xmlNode *data, const char *name)
Retrieve a copy of the value of an XML attribute.
#define PCMK_META_CLONE_NODE_MAX
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
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)
xmlNode * pcmk__xe_first_child(const xmlNode *parent, const char *node_name, const char *attr_n, const char *attr_v)
#define PCMK_XA_DESCRIPTION
#define crm_trace(fmt, args...)
PCMK__OUTPUT_ARGS("bundle", "uint32_t", "pcmk_resource_t *", "GList *", "GList *")
#define PE__CONTAINER_AGENT_PODMAN_S
void pcmk__g_strcat(GString *buffer,...) G_GNUC_NULL_TERMINATED
bool xml_contains_remote_node(xmlNode *xml)
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
void crm_xml_set_id(xmlNode *xml, const char *format,...) G_GNUC_PRINTF(2
struct pe_node_shared_s * details
#define pe__set_bundle_mount_flags(mount_xml, flags, flags_to_set)
pcmk_resource_t * pe__first_container(const pcmk_resource_t *bundle)
Wrappers for and extensions to libxml2.
#define PCMK_XE_OPERATIONS
#define pcmk__set_rsc_flags(resource, flags_to_set)
enum rsc_role_e pe__bundle_resource_state(const pcmk_resource_t *rsc, gboolean current)
void free_xml(xmlNode *child)
#define pcmk__str_copy(str)
#define pcmk__warn_once(wo_flag, fmt...)
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
A single instance of a bundle.
#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 crm_str_to_boolean(const char *s, int *ret)
gboolean(* active)(pcmk_resource_t *rsc, gboolean all)
int pe__bundle_xml(pcmk__output_t *out, va_list args)
#define PCMK_XA_SOURCE_DIR
#define PE__CONTAINER_AGENT_RKT_S
#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)
#define status_print(fmt, args...)
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.
pcmk_node_t *(* active_node)(const pcmk_resource_t *rsc, unsigned int *count_all, unsigned int *count_clean)
pcmk_node_t * allocated_to
#define PCMK_META_PROMOTED_MAX
gboolean(* is_filtered)(const pcmk_resource_t *rsc, GList *only_rsc, gboolean check_parent)
#define PCMK_XA_HOST_INTERFACE
gboolean pe__bundle_is_filtered(const pcmk_resource_t *rsc, GList *only_rsc, gboolean check_parent)
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
#define PCMK_XA_SOURCE_DIR_ROOT
xmlNode * pcmk__xe_create(xmlNode *parent, const char *name)
#define pcmk__assert_alloc(nmemb, size)
#define PCMK_XE_INSTANCE_ATTRIBUTES
xmlNode * pcmk__xe_next_same(const xmlNode *node)
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
#define pcmk__clear_rsc_flags(resource, flags_to_clear)
void pcmk__insert_dup(GHashTable *table, const char *name, const char *value)
void(* count)(pcmk_resource_t *rsc)
pcmk_resource_t * remote_rsc
#define PCMK_SCORE_INFINITY
Integer score to use to represent "infinity".
pcmk_resource_t * pe__bundled_resource(const pcmk_resource_t *rsc)
GHashTable * allowed_nodes
gboolean pcmk__str_in_list(const gchar *s, const GList *lst, uint32_t flags)