Skip to content
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

Dev: migration: implement corosync.conf migration for corosync 3 (jsc#PED-8252) #1422

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
20c7f62
Dev: migration: implement corosync.conf migration for corosync 3 (jsc…
nicholasyang2022 Oct 23, 2024
23d795f
Dev: migration: populate node name in corosync node list for knet mul…
nicholasyang2022 May 17, 2024
0163979
Fix: corosync: use os.env instead of os.getenv for consistency (bsc#1…
nicholasyang2022 May 22, 2024
e332451
Dev: migration: implement multicast to knet migration (jsc#PED-8252)
nicholasyang2022 May 22, 2024
5eef6dd
Dev: profiles: set default crypto_hash to sha256 to follow corosync d…
nicholasyang2022 May 23, 2024
ca866e4
Dev: ui_cluster: add 'crm cluster health sles [--fix]' (jsc#PED-8252)
nicholasyang2022 Oct 23, 2024
70c02d2
Dev: prun: create event loop manually
nicholasyang2022 Oct 31, 2024
15959c3
Dev: migration: run checks on remote nodes (jsc#PED-8252)
nicholasyang2022 Nov 1, 2024
6381a7e
Dev: migration: copy migrated corosync.conf to remote nodes (jsc#PED-…
nicholasyang2022 Oct 31, 2024
ff061e9
Dev: pre-migration: add checks for used corosync features (jsc#PED-11…
nicholasyang2022 Dec 13, 2024
8a28b6f
Dev: pre-migration: check SAPHanaSR Classic resource agents (jsc#PED-…
nicholasyang2022 Jan 2, 2025
bfa773a
Dev: pre-migration: check removed resource agents (jsc#PED-11808)
nicholasyang2022 Dec 31, 2024
cfc0733
Dev: pre-migration: check removed fence agents (jsc#PED-11808)
nicholasyang2022 Dec 31, 2024
22b840f
Dev: pre-migration: check if ocfs2 is used (jsc#PED-11808)
nicholasyang2022 Jan 1, 2025
faf4e98
Dev: add pre-migration checks for pacemaker version (jsc#PED-11808)
nicholasyang2022 Jan 2, 2025
a6089c9
Dev: pre-migration: do not colorize hostname header (jsc#PED-11808)
nicholasyang2022 Jan 6, 2025
cf6b0e5
Dev: pre-migration: add completer for 'crm cluster health sles16' (js…
nicholasyang2022 Jan 6, 2025
8b66a54
Fix: ui_cluster: fix do_health usage output
nicholasyang2022 Jan 6, 2025
c7aa209
Dev: pre-migration: add message about removing stonith:external/sbd (…
nicholasyang2022 Jan 7, 2025
6302b31
Doc: ui_cluster: add document for `crm cluster health hawk2|sles16`
nicholasyang2022 Jan 7, 2025
911c188
Fix: cibquery: grouped primitives is missing from query results (jsc#…
nicholasyang2022 Jan 9, 2025
ca818e6
Refactor: cibquery: has_primitive_filesystem_ocfs2 to has_primitive_f…
nicholasyang2022 Jan 13, 2025
74d229b
Dev: pre-migration: add summary section to output (jsc#PED-11808)
nicholasyang2022 Jan 13, 2025
6ba6d12
Dev: migration: refine message wording (jsc#PED-11808)
nicholasyang2022 Feb 6, 2025
7c9c4f5
Dev: migration: do not check pacemaker version (jsc#PED-8252)
nicholasyang2022 Feb 7, 2025
8729183
Dev: behave: add functional tests for pre-migration checks (jsc#PED-8…
nicholasyang2022 Feb 13, 2025
b96f625
Fix: migration: should not show pre-migration check summary when call…
nicholasyang2022 Feb 13, 2025
a5c18a6
Dev: migration: check if the cluster is already migrated to SLES 16 (…
nicholasyang2022 Feb 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/crmsh-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,21 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
flags: integration

functional_test_migration:
runs-on: ubuntu-24.04
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
- name: functional test for migration
run: |
echo '{ "exec-opts": ["native.cgroupdriver=systemd"] }' | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker.service
$CONTAINER_SCRIPT `$GET_INDEX_OF migration` && $CONTAINER_SCRIPT -d && $CONTAINER_SCRIPT -u `$GET_INDEX_OF migration`
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: integration

original_regression_test:
runs-on: ubuntu-24.04
timeout-minutes: 40
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include crmsh *.txt
4 changes: 2 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ coverage:
threshold: 0.35%
codecov:
notify:
after_n_builds: 28
after_n_builds: 29
comment:
after_n_builds: 28
after_n_builds: 29
layout: "condensed_header, flags, files, condensed_footer"
26 changes: 26 additions & 0 deletions crmsh/cibquery.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""utilities for parsing CIB xml"""
import dataclasses
import typing

import lxml.etree


@dataclasses.dataclass(frozen=True)
class ResourceAgent:
m_class: str
m_provider: typing.Optional[str]
m_type: 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}"]'
))
2 changes: 1 addition & 1 deletion crmsh/corosync.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def configure_two_node(removing: bool = False, qdevice_adding: bool = False) ->


def conf():
return os.getenv('COROSYNC_MAIN_CONFIG_FILE', '/etc/corosync/corosync.conf')
return os.environ.get('COROSYNC_MAIN_CONFIG_FILE', '/etc/corosync/corosync.conf')


def check_tools():
Expand Down
147 changes: 147 additions & 0 deletions crmsh/migration-supported-resource-agents.txt
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
Loading