Bug 1787213

Summary: KubeMacpool may not work from time to time since it is skipped when we face certificate issue.
Product: Container Native Virtualization (CNV) Reporter: Meni Yakove <myakove>
Component: NetworkingAssignee: Ram Lavi <ralavi>
Status: CLOSED ERRATA QA Contact: Geetika Kapoor <gkapoor>
Severity: high Docs Contact:
Priority: high    
Version: 2.2.0CC: cnv-qe-bugs, danken, gkapoor, phoracek
Target Milestone: ---   
Target Release: 2.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: kubemacpool-container-v2.4.0-24 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-07-28 19:09:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Meni Yakove 2020-01-01 14:15:27 UTC
Since we ignore failures on certificate issues (https://github.com/k8snetworkplumbingwg/kubemacpool/pull/69) MacPool will not work once we hit the issue.

Comment 1 Petr Horáček 2020-01-02 17:02:04 UTC
Due to this issue, we may get different MAC address after reboot/migration. That would lead into a different MAC and may break VM's workload.

Comment 2 Dan Kenigsberg 2020-01-05 09:04:28 UTC
This bug is bad and embarrassing, but not a blocker. I believe that we release cnv-2.1 like that.

Comment 3 Petr Horáček 2020-05-13 18:32:57 UTC
This should be solved on master now. We just need to get needed changes to D/S.

Comment 4 Petr Horáček 2020-06-04 14:10:31 UTC
This should be on D/S now. This bug was opened as a tracker, so we don't forget dropping the "skip". I suggest we verify it by focusing on the "skip" part. Killing KMP pods (KMP not able to serve) should prevent us from creating a VM.

Comment 5 Geetika Kapoor 2020-06-10 13:51:53 UTC
Test Environment :
==================

$ oc version
Client Version: 4.5.0-rc.1
Server Version: 4.5.0-rc.1
Kubernetes Version: v1.18.3+a637491

CNV Version
$ oc get csv -n openshift-cnv | awk ' { print $4 } ' | tail -n1
2.4.0

Steps:
=====


Test case 1: Create a vm and make sure it works with config (vm.yaml)

oc apply -f vm.yaml 
virtualmachine.kubevirt.io/vm-cirros-after-device2 created


2. Now try to kill/terminate all the KMP pods. (I used a simple script to keep killing pods)

$  oc get pods -A | grep kubemac
openshift-cnv                                      kubemacpool-mac-controller-manager-57b6cc7986-2m5hb               0/1     Running            0          6s
openshift-cnv                                      kubemacpool-mac-controller-manager-57b6cc7986-5ftv9               0/1     Terminating        0          33s
openshift-cnv                                      kubemacpool-mac-controller-manager-57b6cc7986-hrsxz               0/1     Running            0          20s


3. Retry to create a vm while script is killing the pods all the time.

$ oc apply -f vm.yaml 
Error from server (InternalError): error when creating "vm.yaml": Internal error occurred: failed calling webhook "mutatevirtualmachines.kubemacpool.io": Post https://kubemacpool-service.openshift-cnv.svc:443/mutate-virtualmachines?timeout=30s: no endpoints available for service "kubemacpool-service"


Test Case 2: Test vm mac address after stopping and starting vm again. Macaddress should be same

1. use the same config vm.yaml.

$ oc get vm -A
NAMESPACE               NAME                      AGE     RUNNING   VOLUME
   
kubevirt-test-default   vm-cirros-after-device2   15m     true 

Check Macaddress :

$ oc get  vm vm-cirros-after-device2 -n kubevirt-test-default -o yaml | grep -i macaddress
          - macAddress: 02:6d:bb:00:00:01

2. Make sure vm stopped.set running to false.

$ oc get vm -A
NAMESPACE               NAME                      AGE     RUNNING   VOLUME
   
kubevirt-test-default   vm-cirros-after-device2   18m     false  

3. Restart the vm and compare macaddress.(set running to true)

$ oc get vm -A
NAMESPACE               NAME                      AGE     RUNNING   VOLUME
    
kubevirt-test-default   vm-cirros-after-device2   20m     true 

Check macaddress:

$ oc get  vm vm-cirros-after-device2 -n kubevirt-test-default -o yaml | grep -i macaddress
          - macAddress: 02:6d:bb:00:00:01

Comment 8 errata-xmlrpc 2020-07-28 19:09:38 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/RHSA-2020:3194