-
Notifications
You must be signed in to change notification settings - Fork 94
Dev: migration: implement corosync.conf migration for corosync 3 (jsc#PED-8252) #1422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
liangxin1300
merged 39 commits into
ClusterLabs:master
from
nicholasyang2022:ped-8252-20240516
Mar 12, 2025
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
d734737
Dev: migration: implement corosync.conf migration for corosync 3 (jsc…
nicholasyang2022 50296a4
Dev: migration: populate node name in corosync node list for knet mul…
nicholasyang2022 b577b8a
Fix: corosync: use os.env instead of os.getenv for consistency (bsc#1…
nicholasyang2022 73e08a7
Dev: migration: implement multicast to knet migration (jsc#PED-8252)
nicholasyang2022 42976bc
Dev: profiles: set default crypto_hash to sha256 to follow corosync d…
nicholasyang2022 bb1d3bb
Dev: ui_cluster: add 'crm cluster health sles [--fix]' (jsc#PED-8252)
nicholasyang2022 c98b0ca
Dev: prun: create event loop manually
nicholasyang2022 dc7deaf
Dev: migration: run checks on remote nodes (jsc#PED-8252)
nicholasyang2022 212ffb8
Dev: migration: copy migrated corosync.conf to remote nodes (jsc#PED-…
nicholasyang2022 2425aec
Dev: pre-migration: add checks for used corosync features (jsc#PED-11…
nicholasyang2022 058c020
Dev: pre-migration: check SAPHanaSR Classic resource agents (jsc#PED-…
nicholasyang2022 285a16e
Dev: pre-migration: check removed resource agents (jsc#PED-11808)
nicholasyang2022 2426613
Dev: pre-migration: check removed fence agents (jsc#PED-11808)
nicholasyang2022 31c6c84
Dev: pre-migration: check if ocfs2 is used (jsc#PED-11808)
nicholasyang2022 e7cb83a
Dev: add pre-migration checks for pacemaker version (jsc#PED-11808)
nicholasyang2022 b995f40
Dev: pre-migration: do not colorize hostname header (jsc#PED-11808)
nicholasyang2022 4a80940
Dev: pre-migration: add completer for 'crm cluster health sles16' (js…
nicholasyang2022 43f05d1
Fix: ui_cluster: fix do_health usage output
nicholasyang2022 9dd577c
Dev: pre-migration: add message about removing stonith:external/sbd (…
nicholasyang2022 afc701f
Doc: ui_cluster: add document for `crm cluster health hawk2|sles16`
nicholasyang2022 5489382
Fix: cibquery: grouped primitives is missing from query results (jsc#…
nicholasyang2022 c77a179
Refactor: cibquery: has_primitive_filesystem_ocfs2 to has_primitive_f…
nicholasyang2022 10f2155
Dev: pre-migration: add summary section to output (jsc#PED-11808)
nicholasyang2022 f95b050
Dev: migration: refine message wording (jsc#PED-11808)
nicholasyang2022 dd53f1d
Dev: migration: do not check pacemaker version (jsc#PED-8252)
nicholasyang2022 0108812
Dev: behave: add functional tests for pre-migration checks (jsc#PED-8…
nicholasyang2022 375ced4
Fix: migration: should not show pre-migration check summary when call…
nicholasyang2022 d0ab681
Dev: migration: check if the cluster is already migrated to SLES 16 (…
nicholasyang2022 06549a9
Dev: migration: split problem level and is_blocker (jsc#PED-8252)
nicholasyang2022 86c65b3
Dev: migration: add a checker for cib schema version (jsc#PED-8252)
nicholasyang2022 cbf0c48
Dev: migration: no need to check if cluster services is stopped (jsc#…
nicholasyang2022 6b50f7b
Fix: migration: should not report need migration when the cluster has…
nicholasyang2022 7a112fa
Dev: migration: add a message about corosync.conf.bak (jsc#PED-82582)
nicholasyang2022 249058d
Dev: migration: refine the message about unsupported component versio…
nicholasyang2022 e7859cc
Fix: migration: IndexError when there is only one interface (jsc#PED-…
nicholasyang2022 5e15450
Dev: migration: fix incorrect bindnetaddr when migrating a multicast …
nicholasyang2022 edc97d1
Refactor: cibquery: extract a function to get cluster nodes without s…
nicholasyang2022 e73323d
Refactor: migration: extract a function _migrate_totem_interface (jsc…
nicholasyang2022 2c7b93f
Dev: migration: minor refines in message wording
nicholasyang2022 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
recursive-include crmsh *.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
"""utilities for parsing CIB xml""" | ||
import dataclasses | ||
import typing | ||
|
||
import lxml.etree | ||
|
||
from crmsh import constants | ||
|
||
|
||
@dataclasses.dataclass(frozen=True) | ||
class ResourceAgent: | ||
m_class: str | ||
m_provider: typing.Optional[str] | ||
m_type: str | ||
|
||
|
||
@dataclasses.dataclass(frozen=True) | ||
class ClusterNode: | ||
node_id: int | ||
uname: str | ||
|
||
|
||
def get_configured_resource_agents(cib: lxml.etree.Element) -> typing.Set[ResourceAgent]: | ||
return set( | ||
ResourceAgent(e.get('class'), e.get('provider'), e.get('type')) | ||
for e in cib.xpath('/cib/configuration/resources//primitive') | ||
) | ||
|
||
|
||
def has_primitive_filesystem_with_fstype(cib: lxml.etree.Element, fstype: str) -> bool: | ||
return bool(cib.xpath( | ||
'/cib/configuration/resources//primitive[@class="ocf" and @provider="heartbeat" and @type="Filesystem"]' | ||
f'/instance_attributes/nvpair[@name="fstype" and @value="{fstype}"]' | ||
)) | ||
|
||
def get_cluster_nodes(cib: lxml.etree.Element) -> list[ClusterNode]: | ||
"""Return a list of cluster nodes, excluding pacemaker-remote nodes""" | ||
result = list() | ||
for element in cib.xpath(constants.XML_NODE_PATH): | ||
node_id = element.get('id') | ||
uname = element.get('uname') | ||
if element.get('type') == 'remote': | ||
xpath = "//primitive[@provider='pacemaker' and @type='remote']/instance_attributes/nvpair[@name='server' and @value='{}']".format( | ||
uname if uname is not None else node_id | ||
) | ||
if cib.xpath(xpath): | ||
continue | ||
assert node_id | ||
assert uname | ||
result.append(ClusterNode(int(node_id), uname)) | ||
return result |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
ocf:heartbeat:CTDB | ||
ocf:heartbeat:ClusterMon | ||
ocf:heartbeat:Delay | ||
ocf:heartbeat:Dummy | ||
ocf:heartbeat:Filesystem | ||
ocf:heartbeat:IPaddr2 | ||
ocf:heartbeat:IPsrcaddr | ||
ocf:heartbeat:IPv6addr | ||
ocf:heartbeat:LVM-activate | ||
ocf:heartbeat:MailTo | ||
ocf:heartbeat:NodeUtilization | ||
ocf:heartbeat:Raid1 | ||
ocf:heartbeat:Route | ||
ocf:heartbeat:SAPDatabase | ||
ocf:heartbeat:SAPInstance | ||
ocf:heartbeat:SendArp | ||
ocf:heartbeat:Squid | ||
ocf:heartbeat:Stateful | ||
ocf:heartbeat:VirtualDomain | ||
ocf:heartbeat:WAS | ||
ocf:heartbeat:WAS6 | ||
ocf:heartbeat:Xinetd | ||
ocf:heartbeat:aliyun-vpc-move-ip | ||
ocf:heartbeat:apache | ||
ocf:heartbeat:aws-vpc-move-ip | ||
ocf:heartbeat:aws-vpc-route53 | ||
ocf:heartbeat:awseip | ||
ocf:heartbeat:awsvip | ||
ocf:heartbeat:azure-events | ||
ocf:heartbeat:azure-events-az | ||
ocf:heartbeat:azure-lb | ||
ocf:heartbeat:conntrackd | ||
ocf:heartbeat:corosync-qnetd | ||
ocf:heartbeat:crypt | ||
ocf:heartbeat:db2 | ||
ocf:heartbeat:dhcpd | ||
ocf:heartbeat:docker | ||
ocf:heartbeat:docker-compose | ||
ocf:heartbeat:dummypy | ||
ocf:heartbeat:ethmonitor | ||
ocf:heartbeat:exportfs | ||
ocf:heartbeat:galera | ||
ocf:heartbeat:garbd | ||
ocf:heartbeat:gcp-ilb | ||
ocf:heartbeat:gcp-pd-move | ||
ocf:heartbeat:gcp-vpc-move-ip | ||
ocf:heartbeat:gcp-vpc-move-vip | ||
ocf:heartbeat:iSCSILogicalUnit | ||
ocf:heartbeat:iSCSITarget | ||
ocf:heartbeat:iface-bridge | ||
ocf:heartbeat:iface-macvlan | ||
ocf:heartbeat:iface-vlan | ||
ocf:heartbeat:ldirectord | ||
ocf:heartbeat:lvmlockd | ||
ocf:heartbeat:mariadb | ||
ocf:heartbeat:mdraid | ||
ocf:heartbeat:mpathpersist | ||
ocf:heartbeat:mysql | ||
ocf:heartbeat:mysql-proxy | ||
ocf:heartbeat:named | ||
ocf:heartbeat:nfsnotify | ||
ocf:heartbeat:nfsserver | ||
ocf:heartbeat:nginx | ||
ocf:heartbeat:nvmet-namespace | ||
ocf:heartbeat:nvmet-port | ||
ocf:heartbeat:nvmet-subsystem | ||
ocf:heartbeat:oraasm | ||
ocf:heartbeat:oracle | ||
ocf:heartbeat:oralsnr | ||
ocf:heartbeat:osceip | ||
ocf:heartbeat:ovsmonitor | ||
ocf:heartbeat:pgagent | ||
ocf:heartbeat:pgsql | ||
ocf:heartbeat:podman | ||
ocf:heartbeat:portblock | ||
ocf:heartbeat:postfix | ||
ocf:heartbeat:powervs-subnet | ||
ocf:heartbeat:rabbitmq-cluster | ||
ocf:heartbeat:rabbitmq-server-ha | ||
ocf:heartbeat:redis | ||
ocf:heartbeat:rsyncd | ||
ocf:heartbeat:sfex | ||
ocf:heartbeat:sg_persist | ||
ocf:heartbeat:slapd | ||
ocf:heartbeat:storage-mon | ||
ocf:heartbeat:symlink | ||
ocf:heartbeat:tomcat | ||
ocf:suse:aws-vpc-move-ip | ||
ocf:suse:SAPHanaController | ||
ocf:suse:SAPHanaFilesystem | ||
ocf:suse:SAPHanaTopology | ||
stonith:fence_aliyun | ||
stonith:fence_alom | ||
stonith:fence_apc | ||
stonith:fence_apc-snmp | ||
stonith:fence_aws | ||
stonith:fence_azure-arm | ||
stonith:fence_bladecenter | ||
stonith:fence_brocade | ||
stonith:fence_cisco-mds | ||
stonith:fence_cisco-ucs | ||
stonith:fence_compute | ||
stonith:fence_docker | ||
stonith:fence_drac5 | ||
stonith:fence_eaton-snmp | ||
stonith:fence_eaton-ssh | ||
stonith:fence_emerson | ||
stonith:fence_eps | ||
stonith:fence_gce | ||
stonith:fence_hds-cb | ||
stonith:fence_hpblade | ||
stonith:fence_ibm-powervs | ||
stonith:fence_ibm-vpc | ||
stonith:fence_ibmblade | ||
stonith:fence_ibmz | ||
stonith:fence_ifmib | ||
stonith:fence_ilo-moonshot | ||
stonith:fence_ilo-mp | ||
stonith:fence_ilo-ssh | ||
stonith:fence_ilo2 | ||
stonith:fence_intelmodular | ||
stonith:fence_ipdu | ||
stonith:fence_ipmilan | ||
stonith:fence_ironic | ||
stonith:fence_kdump | ||
stonith:fence_ldom | ||
stonith:fence_lpar | ||
stonith:fence_mpath | ||
stonith:fence_netio | ||
stonith:fence_openstack | ||
stonith:fence_pve | ||
stonith:fence_raritan | ||
stonith:fence_rcd-serial | ||
stonith:fence_redfish | ||
stonith:fence_rhevm | ||
stonith:fence_rsa | ||
stonith:fence_rsb | ||
stonith:fence_sanbox2 | ||
stonith:fence_sbd | ||
stonith:fence_scsi | ||
stonith:fence_vbox | ||
stonith:fence_virsh | ||
stonith:fence_vmware | ||
stonith:fence_vmware-rest | ||
stonith:fence_wti | ||
stonith:fence_xenapi | ||
stonith:fence_zvm |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For commonly use purpose, I do think this function can be renamed more commonly, like
has_primitive_ra_with
, with parameters like type and nvpair's name and valueThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do know xml queries can be more flexible, just like JAXB in java. But a complete, user-friendly and reliable implementation needs too much work and is impossible to be included in crmsh. I incline to implement some routines only when we really need to call it from many places. Do you have some real use cases?