Recreate HCO from scratch for OpenShift Virtualization

Solution In Progress - Updated -

Environment

  • OpenShift Container Platform 4.7
  • OpenShift Virtualization 2.6

Issue

  • HCO hangs and needs to be recreated
  • OpenShift Virtualization installation or upgrade is stalled

Resolution

  • First open two terminals

  • In terminal 1 run :

watch -n 1 oc scale --replicas 0 -n openshift-cnv deployment hco-operator
  • In terminal 2 run :
    Please paste the whole command in one shot in your terminal, each command will execute in order
oc patch hco -n openshift-cnv kubevirt-hyperconverged --type json -p='[{"op": "remove", "path": "/metadata/finalizers"}]'; \
oc delete hco -n openshift-cnv kubevirt-hyperconverged; \
cat <<EOF | oc apply -f -
apiVersion: hco.kubevirt.io/v1beta1
kind: HyperConverged
metadata:
  labels:
    app: kubevirt-hyperconverged
  name: kubevirt-hyperconverged
  namespace: openshift-cnv
spec:
  infra: {}
  workloads: {}
EOF
  • When the command in terminal 2 is done, stop the watch in terminal 1.
  • This will allow the HCO operator to be scaled up by OLM again.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments