Bug 2176785

Summary: Headless service functionality loss for OCP-V VMs on live migration
Product: Container Native Virtualization (CNV) Reporter: Antonio Cardace <acardace>
Component: VirtualizationAssignee: lpivarc
Status: CLOSED ERRATA QA Contact: zhe peng <zpeng>
Severity: unspecified Docs Contact:
Priority: high    
Version: 4.11.2CC: acardace, danken, kbidarka, lpivarc, pvilayat, rgertzbe
Target Milestone: ---   
Target Release: 4.12.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: v4.12.3-49 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2166510 Environment:
Last Closed: 2023-05-23 22:31:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2166510, 2176787    
Bug Blocks:    

Description Antonio Cardace 2023-03-09 10:03:42 UTC
+++ This bug was initially created as a clone of Bug #2166510 +++

Description of problem:
Created a headless service and populated to VMs so they could be able to resolve the A record in an FQDN manner of: <vmi.spec.hostname>.<vmi.spec.subdomain>.<vmi.metadata.namespace>.svc.cluster.local.

Creation of their VMs seems to work, underlying Pod has its subdomain and hostname fields populated and resolution for the FQDN is functional.

However, when a live migration is triggered and the target Pod is created, it's created with the subdomain field populated but without the hostname field.


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


How reproducible:
Always


Steps to Reproduce:

- Created a headless service. My env headless service "subdomain"
- Populated the VM yaml with subdomain and hostname :
~~
hostname: hostname
      networks:
      - name: nic
        pod: {}
      subdomain: mysubdomain <----- Headless service
~~

- Started VM and I can see the virt-launcher has a hostname and subdomain spec :

~~
# oc get pod virt-launcher -o yaml |egrep 'hostame|subdomain'
  hostname: hostname
  subdomain: mysubdomain
~
  

-- After live migration, the target virt-launcher pod is missing Hostname. The subdomain spec is still there.

~~
# oc get pod virt-launcher -o yaml |egrep 'hostame|subdomain'
 subdomain: mysubdomain
~~

Actual results:

The hostname spec is missing after VM live migration on virt-launcher pod.


Expected results:

The hostname spec should also be shown on the target virt-launcher pod after migration.

--- Additional comment from Dan Kenigsberg on 2023-03-09 09:39:28 UTC ---

Customer requests backport to 4.11.z

Comment 2 zhe peng 2023-05-09 06:04:04 UTC
verify with build: CNV-v4.12.3-49

step: 
1: Created a headless service. 
apiVersion: v1
kind: Service
metadata:
  name: subdomain
spec:
  clusterIP: None
  selector:
    app: test-app
  ports:
    - protocol: TCP
      port: 80
      targetPort: 3000 
2: create a vm with:
...
spec:
  hostname: "myvmi"
  subdomain: "mysubdomain"
  domain:
...
3: start vm and check virt-launcher
...
hostname: myvmi
subdomain: mysubdomain
...
4: do livemigration
after migration, check virt-launcher again
...
hostname: myvmi
subdomain: mysubdomain
...

move to verified.

Comment 8 errata-xmlrpc 2023-05-23 22:31:22 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 (OpenShift Virtualization 4.12.3 Images), 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-2023:3283