Help Center> Cloud Container Engine> FAQs> Node> Node Running> What Can I Do If the Container Network Becomes Unavailable After yum update Is Used to Upgrade the OS?
Updated on 2023-08-07 GMT+08:00

What Can I Do If the Container Network Becomes Unavailable After yum update Is Used to Upgrade the OS?

The CCE console does not support OS upgrades on a node. You are advised not to upgrade the OS using the yum update command.

If you upgrade the OS using yum update, the container networking will be unavailable.

Perform the following operations to restore the container network:

This restoration method is valid only for EulerOS 2.2.

  1. Run the following script as user root:

    #!/bin/bash
    function upgrade_kmod()
    {
        openvswicth_mod_path=$(rpm -qal openvswitch-kmod)
        rpm_version=$(rpm -qal openvswitch-kmod|grep -w openvswitch|head -1|awk -F "/" '{print $4}')
        sys_version=`cat /boot/grub2/grub.cfg | grep EulerOS|awk 'NR==1{print $3}' | sed 's/[()]//g'`
    
        if [[ "${rpm_version}" != "${sys_version}" ]];then
            mkdir -p /lib/modules/"${sys_version}"/extra/openvswitch
            for path in ${openvswicth_mod_path[@]};do
                name=$(echo "$path" | awk -F "/" '{print $NF}')
                rm -f /lib/modules/"${sys_version}"/updates/"${name}"
    			rm -f /lib/modules/"${sys_version}"/extra/openvswitch/"${name}"
                ln -s "${path}" /lib/modules/"${sys_version}"/extra/openvswitch/"${name}"
            done
        fi
    	depmod ${sys_version}
    }
    upgrade_kmod
    

  2. Restart the VM.

Node Running FAQs

more