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

Test sdn live migration ovn #51412

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -2708,14 +2708,14 @@ tests:
test:
- chain: openshift-e2e-test-qe-destructive
workflow: cucushift-installer-rehearse-vsphere-ipi-remote-worker
- as: vsphere-ipi-sdn-migration-ovn-f14
- as: vsphere-ipi-sdn-live-migration-ovn-f28
cron: 39 9 1,17 * *
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please update the cron job time by ./ci-operator/config/openshift/openshift-tests-private/tools/generate-cron-entry.sh tool generate a new one

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zhaozhanqi Update it by using above tool.

steps:
cluster_profile: vsphere-2
env:
OVERRIDE_OPENSHIFT_SDN_DEPRECATION: "true"
test:
- chain: cucushift-sdn-migration-ovn
- chain: cucushift-sdn-live-migration-ovn
workflow: cucushift-installer-rehearse-vsphere-ipi-sdn
- as: vsphere-ipi-static-ip-tp-f28
cron: 44 0 14 * *
Expand Down
Expand Up @@ -36001,7 +36001,7 @@ periodics:
ci.openshift.io/generator: prowgen
job-release: "4.16"
pj-rehearse.openshift.io/can-be-rehearsed: "true"
name: periodic-ci-openshift-openshift-tests-private-release-4.16-amd64-nightly-vsphere-ipi-sdn-migration-ovn-f14
name: periodic-ci-openshift-openshift-tests-private-release-4.16-amd64-nightly-vsphere-ipi-sdn-live-migration-ovn-f28
spec:
containers:
- args:
Expand All @@ -36011,8 +36011,8 @@ periodics:
- --oauth-token-path=/usr/local/github-credentials/oauth
- --report-credentials-file=/etc/report/credentials
- --secret-dir=/secrets/ci-pull-credentials
- --secret-dir=/usr/local/vsphere-ipi-sdn-migration-ovn-f14-cluster-profile
- --target=vsphere-ipi-sdn-migration-ovn-f14
- --secret-dir=/usr/local/vsphere-ipi-sdn-live-migration-ovn-f28-cluster-profile
- --target=vsphere-ipi-sdn-live-migration-ovn-f28
- --variant=amd64-nightly
command:
- ci-operator
Expand All @@ -36029,7 +36029,7 @@ periodics:
- mountPath: /secrets/ci-pull-credentials
name: ci-pull-credentials
readOnly: true
- mountPath: /usr/local/vsphere-ipi-sdn-migration-ovn-f14-cluster-profile
- mountPath: /usr/local/vsphere-ipi-sdn-live-migration-ovn-f28-cluster-profile
name: cluster-profile
- mountPath: /secrets/gcs
name: gcs-credentials
Expand Down
@@ -0,0 +1,3 @@
approvers:
- zhaozhanqi
- weliang1
@@ -0,0 +1,9 @@
{
"path": "cucushift/sdn-live-migration-ovn/cucushift-sdn-live-migration-ovn-chain.yaml",
"owners": {
"approvers": [
"zhaozhanqi",
"weliang1"
]
}
}
@@ -0,0 +1,11 @@
chain:
as: cucushift-sdn-live-migration-ovn
steps:
- ref: idp-htpasswd
- ref: cucushift-pre
- ref: cucushift-upgrade-prepare
- ref: ovn-sdn-live-migration-ovn
- ref: cucushift-upgrade-check
- ref: openshift-upgrade-qe-test-report
documentation: |-
The workflow executes cucushift sdn live migration to ovn
4 changes: 4 additions & 0 deletions ci-operator/step-registry/ovn/sdn-live-migration-ovn/OWNERS
@@ -0,0 +1,4 @@
approvers:
- sdn-approvers
reviewers:
- sdn-reviewers
@@ -0,0 +1,71 @@
#!/bin/bash
set -x
set -o errexit
set -o nounset
set -o pipefail

TARGET=${TARGET:-OVNKubernetes}

# Wait for ClusterOperators to reach the desired state
co_timeout=${OVN_SDN_MIGRATION_TIMEOUT:-2400s}
timeout "$co_timeout" bash <<EOT
until
oc wait co --all --for='condition=Available=True' --timeout=10s &&
oc wait co --all --for='condition=Progressing=False' --timeout=10s &&
oc wait co --all --for='condition=Degraded=False' --timeout=10s;
do
sleep 10
echo "Some ClusterOperators are not in the desired state (Degraded=False, Progressing=False, Available=True)";
done
EOT

# Patch new setting for internalJoinSubnet and internalTransitSwitchSubnet
oc patch network.operator.openshift.io cluster --type='merge' -p='{"spec":{"defaultNetwork":{"ovnKubernetesConfig":{"ipv4":{"internalJoinSubnet": "100.65.0.0/16"}}}}}'
oc patch network.operator.openshift.io cluster --type='merge' -p='{"spec":{"defaultNetwork":{"ovnKubernetesConfig":{"ipv4":{"internalTransitSwitchSubnet": "100.85.0.0/16"}}}}}'

# Patch the network configuration for live migration
oc patch Network.config.openshift.io cluster --type='merge' --patch '{"metadata":{"annotations":{"network.openshift.io/network-type-migration":""}},"spec":{"networkType":"OVNKubernetes"}}'

# Wait for the network migration to start
co_timeout=${OVN_SDN_MIGRATION_TIMEOUT:-300s}
timeout "$co_timeout" bash <<EOT
until
oc get network -o yaml | grep NetworkTypeMigrationInProgress > /dev/null
do
echo "Migration is not started yet"
sleep 10
done
EOT
echo "Start Live Migration process now"

# Wait for the live migration to fully complete
co_timeout=${OVN_SDN_MIGRATION_TIMEOUT:-3600s}
timeout "$co_timeout" bash <<EOT
until
oc get network -o yaml | grep NetworkTypeMigrationCompleted > /dev/null && \
for NODE in \$(oc get nodes -o custom-columns=NAME:.metadata.name --no-headers); do oc get node \$NODE -o yaml | grep "k8s.ovn.org/node-transit-switch-port-ifaddr:" | grep "100.85"; done > /dev/null && \
for NODE in \$(oc get nodes -o custom-columns=NAME:.metadata.name --no-headers); do oc get node \$NODE -o yaml | grep "k8s.ovn.org/node-gateway-router-lrp-ifaddr:" | grep "100.65"; done > /dev/null && \
oc get network.config/cluster -o jsonpath='{.status.networkType}' | grep OVNKubernetes > /dev/null;
do
echo "Live migration is still in progress"
sleep 30
done
EOT
echo "The Migration is completed"

# Check all ClusterOperators back to normal after live migration
co_timeout=${OVN_SDN_MIGRATION_TIMEOUT:-3000s}
timeout "$co_timeout" bash <<EOT
until
oc wait co --all --for='condition=Available=True' --timeout=10s && \
oc wait co --all --for='condition=Progressing=False' --timeout=10s && \
oc wait co --all --for='condition=Degraded=False' --timeout=10s;
do
sleep 10 && echo "Some ClusterOperators are not in the desired state (Degraded=False, Progressing=False, Available=True)";
done
EOT
echo "All ClusterOperators are in the desired state"

# Output the status of ClusterOperators
oc get co

@@ -0,0 +1,11 @@
{
"path": "ovn/sdn-live-migration-ovn/ovn-sdn-live-migration-ovn-ref.yaml",
"owners": {
"approvers": [
"sdn-approvers"
],
"reviewers": [
"sdn-reviewers"
]
}
}
@@ -0,0 +1,18 @@
ref:
as: ovn-sdn-live-migration-ovn
from_image:
name: cli-jq
namespace: ocp
tag: latest
commands: ovn-sdn-live-migration-ovn-commands.sh
env:
- name: OVN_SDN_MIGRATION_TIMEOUT
default: 0s
documentation: |-
Default is 0s indicating variable not set, Generic timeout for all the steps involved in OpenshiftSDN to OVNKubernetes live migration
resources:
requests:
cpu: 10m
memory: 100Mi
documentation: |-
The step changes the networkType from OpenshiftSDN to OVNKubernetes in a running cluster