Bug 1751869 - rhel templates use bridge on pod network
Summary: rhel templates use bridge on pod network
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Networking
Version: 2.2.0
Hardware: Unspecified
OS: Unspecified
urgent
high
Target Milestone: ---
: 2.2.0
Assignee: Alon Sadan
QA Contact: Yan Du
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-09-12 19:35 UTC by Meni Yakove
Modified: 2020-01-30 16:27 UTC (History)
9 users (show)

Fixed In Version: kubevirt-ssp-operator-container-v2.2.0-7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-01-30 16:27:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt common-templates pull 84 0 'None' closed change default interface to masquerade instead of bridge 2020-12-04 02:35:14 UTC
Github kubevirt kubevirt pull 2701 0 'None' closed add masquerade binding method to templates 2020-12-04 02:34:46 UTC
Red Hat Product Errata RHEA-2020:0307 0 None None None 2020-01-30 16:27:23 UTC

Description Meni Yakove 2019-09-12 19:35:06 UTC
Description of problem:
RHEL templates are using 'bridge' as pod network while it should be using 'masquerade'

VMs with 'bridge' as pod networks cannot be migrated.
 

Version-Release number of selected component (if applicable):



Additional info:
oc get templates -n openshift rhel8-server-tiny-v0.6.2 -oyaml
apiVersion: template.openshift.io/v1
kind: Template
metadata:
  annotations:
    defaults.template.kubevirt.io/disk: rootdisk
    description: This template can be used to create a VM suitable for Red Hat Enterprise
      Linux 7 and newer. The template assumes that a PVC is available which is providing
      the necessary RHEL disk image.
    iconClass: icon-rhel
    name.os.template.kubevirt.io/rhel8.0: Red Hat Enterprise Linux 8.0
    openshift.io/display-name: Red Hat Enterprise Linux 7.0+ VM
    openshift.io/documentation-url: https://github.com/kubevirt/common-templates
    openshift.io/provider-display-name: KubeVirt
    openshift.io/support-url: https://github.com/kubevirt/common-templates/issues
    tags: kubevirt,virtualmachine,linux,rhel
    template.kubevirt.io/editable: |
      /objects[0].spec.template.spec.domain.cpu.sockets
      /objects[0].spec.template.spec.domain.cpu.cores
      /objects[0].spec.template.spec.domain.cpu.threads
      /objects[0].spec.template.spec.domain.resources.requests.memory
      /objects[0].spec.template.spec.domain.devices.disks
      /objects[0].spec.template.spec.volumes
      /objects[0].spec.template.spec.networks
    template.kubevirt.io/version: v1alpha1
    template.openshift.io/bindable: "false"
    validations: |
      [
        {
          "name": "minimal-required-memory",
          "path": "jsonpath::.spec.domain.resources.requests.memory",
          "rule": "integer",
          "message": "This VM requires more memory.",
          "min": 2147483648
        },
      ]
  creationTimestamp: "2019-09-12T13:17:30Z"
  labels:
    flavor.template.kubevirt.io/tiny: "true"
    os.template.kubevirt.io/rhel8.0: "true"
    template.kubevirt.io/type: base
    workload.template.kubevirt.io/server: "true"
  name: rhel8-server-tiny-v0.6.2
  namespace: openshift
  ownerReferences:
  - apiVersion: kubevirt.io/v1
    kind: KubevirtCommonTemplatesBundle
    name: common-templates-hyperconverged-cluster
    uid: 49e5a996-d55f-11e9-b3ac-fa163ee93bc1
  resourceVersion: "838178"
  selfLink: /apis/template.openshift.io/v1/namespaces/openshift/templates/rhel8-server-tiny-v0.6.2
  uid: ac664b41-d55f-11e9-b1ec-0a580a80002f
objects:
- apiVersion: kubevirt.io/v1alpha3
  kind: VirtualMachine
  metadata:
    labels:
      app: ${NAME}
      vm.kubevirt.io/template: rhel8-server-tiny
      vm.kubevirt.io/template.revision: "1"
      vm.kubevirt.io/template.version: v0.6.2
    name: ${NAME}
  spec:
    running: false
    template:
      metadata:
        labels:
          kubevirt.io/domain: ${NAME}
          kubevirt.io/size: tiny
      spec:
        domain:
          cpu:
            cores: 1
            sockets: 1
            threads: 1
          devices:
            disks:
            - disk:
                bus: virtio
              name: rootdisk
            - disk:
                bus: virtio
              name: cloudinitdisk
            interfaces:
            - bridge: {}
              name: default
            rng: {}
          resources:
            requests:
              memory: 1G
        evictionStrategy: LiveMigrate
        networks:
        - name: default
          pod: {}
        terminationGracePeriodSeconds: 0
        volumes:
        - name: rootdisk
          persistentVolumeClaim:
            claimName: ${PVCNAME}
        - cloudInitNoCloud:
            userData: |-
              #cloud-config
              password: redhat
              chpasswd: { expire: False }
          name: cloudinitdisk
parameters:
- description: VM name
  from: rhel8-[a-z0-9]{16}
  generate: expression
  name: NAME
- description: Name of the PVC with the disk image
  name: PVCNAME
  required: true

Comment 1 Dan Kenigsberg 2019-09-15 11:19:27 UTC
The templates we ship should use `masquerade`, but this should not block cnv-2.1.

Comment 2 Nelly Credi 2019-09-15 13:39:18 UTC
In this case we should at least document it as a known issue,
but would like to get Steve's ack about pushing it out first

just to be clear, when using the rhel template to create vm it wont be migratable

Comment 5 Alon Sadan 2019-09-24 12:39:45 UTC
Right now there are two patches handling this bug. 
one in 'kubevirt/common templates' and one in 'kubevirt/kubevirt'. both of them change the templates to be with masquerade interface instead of bridge.

The one in 'kubevirt/common templates'  is already merged U\S ( https://github.com/MarSik/kubevirt-ssp-operator/commits/master) and D/S (https://code.engineering.redhat.com/gerrit/gitweb?p=kubevirt-ssp-operator.git;a=shortlog;h=refs/heads/cnv-2.1-rhel-7).

About the one in kubevirt/kubvirt - still not merged.

Comment 6 Alon Sadan 2019-09-25 07:25:19 UTC
Both patches are merged

Comment 7 Alon Sadan 2019-09-25 09:58:42 UTC
https://github.com/kubevirt/kubevirt/pull/2701

Comment 8 Nelly Credi 2019-09-25 10:11:57 UTC
is this really on qa? was it backported from master?
whats the 'fixed in version'?

Comment 9 Alon Sadan 2019-09-25 12:13:35 UTC
It wasn't backported from master but it is part of the D\S release. 
kubevirt-ssp-operator-container-v2.1.0-12 probably has the change.

Comment 10 Martin Sivák 2019-09-25 12:30:15 UTC
I have a silly wording related note: It was not backported as that implies backport to an older version (like 2.0). But it was released as part of 2.1.

Comment 11 Dan Kenigsberg 2019-10-22 12:25:09 UTC
moving to 2.2.0 as we would like to avoid an HCO rebuild in 2.2.1.

Comment 12 Ric Garcia 2019-10-25 16:55:55 UTC
Changing target release to 2.2.0 per previous comment.

Comment 13 Petr Horáček 2019-11-09 22:53:53 UTC
Moving back to ON_QA. The "Fixed in version" is already set since 2.1.

Comment 14 Petr Horáček 2019-11-09 22:55:39 UTC
Martin, based on https://bugzilla.redhat.com/show_bug.cgi?id=1751869#c10 I assume this is also a part of 2.2, right?

Comment 15 Martin Sivák 2019-11-10 16:51:22 UTC
Yes, it is part of every release since 2.1 and that includes 2.2.

Comment 16 Yan Du 2019-11-14 05:36:27 UTC
Testing on OCP4.2 + CNV2.2 with image container-native-virtualization-kubevirt-ssp-operator:v2.2.0-5
But still can see it is using bridge:

$ oc get templates -n openshift rhel8-server-tiny-v0.6.2 -oyaml | grep -A 5 interface
            interfaces:
            - bridge: {}
              name: default
            rng: {}
          resources:
            requests:

Comment 17 Martin Sivák 2019-11-14 07:16:04 UTC
Was that a clean setup? The name should be rhel8-server-tiny-v0.7.0. We stopped using v0.6.2 long time ago. Both CNV 2.1 and CNV 2.2 have v0.7.0 in the name.

Comment 18 Martin Sivák 2019-11-14 07:35:05 UTC
Ah, I think I know what the issue is. The installed common templates are too old due to one forgotten default in the cPaaS related files..

Comment 19 Martin Sivák 2019-11-14 08:05:36 UTC
There is a simple workaround. The customer can redeploy the proper templates by providing the proper version in the CR. See here for example: https://github.com/MarSik/kubevirt-ssp-operator/blob/master/deploy/crds/kubevirt_v1_commontemplatesbundle_cr.yaml

CNV 2.1 contains templates v0.7.0 and CNV 2.2 contains templates v0.8.0 that both contain the masquerade fix. The only issue is that HCO is not providing the version (intentionally) and the default was kept at 0.6.2.

Comment 20 Martin Sivák 2019-11-14 08:11:07 UTC
I will fix this for CNV 2.2. Clean installs will be fine, but upgrades might end up with both versions installed. We can either invest more time into it (somehow removing the old templates) or just add a release note.

Comment 21 Martin Sivák 2019-11-14 10:13:07 UTC
SSP operator 2.2.0-7 should install the newest templates by default.

Comment 22 Dan Kenigsberg 2019-11-14 12:22:10 UTC
Would future updates to the template have the same problem? If not, I would not bother even with a release note.

Comment 23 Martin Sivák 2019-11-14 12:28:33 UTC
(In reply to Dan Kenigsberg from comment #22)
> Would future updates to the template have the same problem? If not, I would
> not bother even with a release note.

No, all future updates will properly replace the upgraded templates (the names are stable since v0.7.0 which should have been the default in CNV 2.1). Any extra templates you might have (custom or from the past like here) will stay though. So one time deletion might be needed to get into sane state.

The issue here is that the UI does not know how to handle this and will select a random template for a given OS. And that might mean the old one.

Comment 24 Meni Yakove 2019-11-19 12:43:31 UTC
OCP 4.3 and CNV 2.2, new deployment all templates have masquerade.

Comment 25 Yan Du 2019-11-21 04:24:54 UTC
# oc get template -n openshift rhel7-server-tiny-v0.7.0 -o yaml | grep -i -A 3 interfaces
            interfaces:
            - masquerade: {}
              name: default
            networkInterfaceMultiqueue: true

Comment 27 errata-xmlrpc 2020-01-30 16:27:13 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2020:0307


Note You need to log in before you can comment on or make changes to this bug.