Skip to content

Commit

Permalink
pacemaker_ra/VirtualDomain: add support of sync_config_on_stop
Browse files Browse the repository at this point in the history
This patch adds the support of the "sync_config_on_stop parameter" when
"seapath" parameter is set to "true".

When the "sync_config_on_stop" parameter is set to "true", the domain
configuration is saved to the rbd image metadata when the resource is
stopped.

Signed-off-by: Mathieu Dupré <[email protected]>
  • Loading branch information
dupremathieu committed Oct 4, 2024
1 parent e4270d3 commit 6333614
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion roles/debian_physical_machine/files/pacemaker_ra/VirtualDomain
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,15 @@ save_config(){
if virt-xml-validate ${CFGTMP} domain 2>/dev/null ; then
ocf_log info "Saving domain $DOMAIN_NAME to ${OCF_RESKEY_config}. Please make sure it's present on all nodes or sync_config_on_stop is on."
if cat ${CFGTMP} > ${OCF_RESKEY_config} ; then
ocf_log info "Saved $DOMAIN_NAME domain's configuration to ${OCF_RESKEY_config}."
if ocf_is_true "$OCF_RESKEY_seapath" ; then
if rbd image-meta set system_${DOMAIN_NAME} xml "$(cat ${CFGTMP})" ; then
ocf_log info "Saved $DOMAIN_NAME domain's configuration to ${OCF_RESKEY_config} and rbd system_${DOMAIN_NAME} metadata"
else
ocf_log warn "Saving $DOMAIN_NAME domain's configuration to rbd system_${DOMAIN_NAME} metadata failed."
fi
else
ocf_log info "Saved $DOMAIN_NAME domain's configuration to ${OCF_RESKEY_config}."
fi
if ocf_is_true "$OCF_RESKEY_sync_config_on_stop"; then
sync_config
fi
Expand Down

0 comments on commit 6333614

Please sign in to comment.