Devstack OVS module: OVS compilation fails when using an old kernel (even if the build_modules param is False)

Bug #1802101 reported by Lucas Alvares Gomes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Lucas Alvares Gomes

Bug Description

The compile_ovs function from the DevStack OVS module fails when the host OS is using a older kernel even if the "build_modules" parameter is set to False.

The code will attempt to install the matching version of the kernel-devel and kernel-headers package, but, since we are running with an older kernel those package may not be presented.

There's no reason to install these packages when we are not compiling the modules, so, I suggest we use the "build_modules" parameters as a flag to indicate whether these packages should be installed or not.

Output:

+ RETRY_UPDATE=True
+ [[ False = \T\r\u\e ]]
+ is_ubuntu
+ [[ -z rpm ]]
+ '[' rpm = deb ']'
+ real_install_package kernel-devel-3.10.0-944.el7.x86_64
+ is_ubuntu
+ [[ -z rpm ]]
+ '[' rpm = deb ']'
+ is_fedora
+ [[ -z RedHatEnterpriseServer ]]
+ '[' RedHatEnterpriseServer = Fedora ']'
+ '[' RedHatEnterpriseServer = 'Red Hat' ']'
+ '[' RedHatEnterpriseServer = RedHatEnterpriseServer ']'
+ yum_install kernel-devel-3.10.0-944.el7.x86_64
+ local result parse_yum_result
+ [[ '' = \T\r\u\e ]]
+ time_start yum_install
+ local name=yum_install
+ local start_time=
+ [[ -n '' ]]
++ date +%s%3N
+ _TIME_START[$name]=1541413607804
+ parse_yum_result=' \
        BEGIN { result=0 } \
        /^YUM_FAILED/ { result=$2 } \
        /^No package/ { result=2 } \
        /^Failed:/ { result=2 } \
        //{ print } \
        END { exit result }'
+ sudo_with_proxies yum install -y kernel-devel-3.10.0-944.el7.x86_64
+ awk ' \
        BEGIN { result=0 } \
        /^YUM_FAILED/ { result=$2 } \
        /^No package/ { result=2 } \
        /^Failed:/ { result=2 } \
        //{ print } \
        END { exit result }'
+ echo YUM_FAILED 1
+ result=1

Changed in neutron:
assignee: nobody → Lucas Alvares Gomes (lucasagomes)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/616195

Changed in neutron:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/616195
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=cdfeeaf2bcd422c1b5cbb9d9ccc49ec639f5abea
Submitter: Zuul
Branch: master

commit cdfeeaf2bcd422c1b5cbb9d9ccc49ec639f5abea
Author: Lucas Alvares Gomes <email address hidden>
Date: Wed Nov 7 13:17:43 2018 +0000

    DevStack: OVS: Only install kernel-* packages when needed

    If the host OS is using an older kernel and invoke the compile_ovs
    function from the DevStack OVS library (devstack/lib/ovs), that function
    will try to install the kernel-dev and kernel-headers package even if
    the "build_modules" parameter is set to False.

    That could fail because the specific kernel-* packages for the version
    of the kernel running may not be present in the distro's repository
    anymore. Plus, if the kernel modules will not be compiled, there's no
    reason to install such packages.

    This patch is fixing this problem by using the "build_modules" parameter
    as a flag to whether install or not those kernel-* packages.

    Change-Id: I11af0e22d25973e6334e867ab2659fbdf9f10d86
    Closes-Bug: #1802101
    Signed-off-by: Lucas Alvares Gomes <email address hidden>

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/616539

tags: added: neutron-proactive-backport-potential
tags: added: neutron-easy-proactive-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/rocky)

Reviewed: https://review.openstack.org/616539
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=bbb60c0d6933fc0a40612dd227077287997f16f0
Submitter: Zuul
Branch: stable/rocky

commit bbb60c0d6933fc0a40612dd227077287997f16f0
Author: Lucas Alvares Gomes <email address hidden>
Date: Wed Nov 7 13:17:43 2018 +0000

    DevStack: OVS: Only install kernel-* packages when needed

    If the host OS is using an older kernel and invoke the compile_ovs
    function from the DevStack OVS library (devstack/lib/ovs), that function
    will try to install the kernel-dev and kernel-headers package even if
    the "build_modules" parameter is set to False.

    That could fail because the specific kernel-* packages for the version
    of the kernel running may not be present in the distro's repository
    anymore. Plus, if the kernel modules will not be compiled, there's no
    reason to install such packages.

    This patch is fixing this problem by using the "build_modules" parameter
    as a flag to whether install or not those kernel-* packages.

    Change-Id: I11af0e22d25973e6334e867ab2659fbdf9f10d86
    Closes-Bug: #1802101
    Signed-off-by: Lucas Alvares Gomes <email address hidden>
    (cherry picked from commit cdfeeaf2bcd422c1b5cbb9d9ccc49ec639f5abea)

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/619711

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/619712

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/queens)

Reviewed: https://review.openstack.org/619711
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=fb9d25eb53217e2cc58972e8a221ac1754563e46
Submitter: Zuul
Branch: stable/queens

commit fb9d25eb53217e2cc58972e8a221ac1754563e46
Author: Lucas Alvares Gomes <email address hidden>
Date: Wed Nov 7 13:17:43 2018 +0000

    DevStack: OVS: Only install kernel-* packages when needed

    If the host OS is using an older kernel and invoke the compile_ovs
    function from the DevStack OVS library (devstack/lib/ovs), that function
    will try to install the kernel-dev and kernel-headers package even if
    the "build_modules" parameter is set to False.

    That could fail because the specific kernel-* packages for the version
    of the kernel running may not be present in the distro's repository
    anymore. Plus, if the kernel modules will not be compiled, there's no
    reason to install such packages.

    This patch is fixing this problem by using the "build_modules" parameter
    as a flag to whether install or not those kernel-* packages.

    Change-Id: I11af0e22d25973e6334e867ab2659fbdf9f10d86
    Closes-Bug: #1802101
    Signed-off-by: Lucas Alvares Gomes <email address hidden>
    (cherry picked from commit cdfeeaf2bcd422c1b5cbb9d9ccc49ec639f5abea)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/pike)

Reviewed: https://review.openstack.org/619712
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=a2b6f4af6b139f9d1b9f1170ae4998dade56da80
Submitter: Zuul
Branch: stable/pike

commit a2b6f4af6b139f9d1b9f1170ae4998dade56da80
Author: Lucas Alvares Gomes <email address hidden>
Date: Wed Nov 7 13:17:43 2018 +0000

    DevStack: OVS: Only install kernel-* packages when needed

    If the host OS is using an older kernel and invoke the compile_ovs
    function from the DevStack OVS library (devstack/lib/ovs), that function
    will try to install the kernel-dev and kernel-headers package even if
    the "build_modules" parameter is set to False.

    That could fail because the specific kernel-* packages for the version
    of the kernel running may not be present in the distro's repository
    anymore. Plus, if the kernel modules will not be compiled, there's no
    reason to install such packages.

    This patch is fixing this problem by using the "build_modules" parameter
    as a flag to whether install or not those kernel-* packages.

    Change-Id: I11af0e22d25973e6334e867ab2659fbdf9f10d86
    Closes-Bug: #1802101
    Signed-off-by: Lucas Alvares Gomes <email address hidden>
    (cherry picked from commit cdfeeaf2bcd422c1b5cbb9d9ccc49ec639f5abea)

tags: added: in-stable-pike
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 14.0.0.0b1

This issue was fixed in the openstack/neutron 14.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 11.0.7

This issue was fixed in the openstack/neutron 11.0.7 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 13.0.3

This issue was fixed in the openstack/neutron 13.0.3 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 12.0.6

This issue was fixed in the openstack/neutron 12.0.6 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.