Bug 1619461

Summary: [v2v] Post migration playbook cannot find hostname/IP address and runs against localhost
Product: Red Hat CloudForms Management Engine Reporter: Kedar Kulkarni <kkulkarn>
Component: UI - OPSAssignee: Brett Thurber <bthurber>
Status: CLOSED NOTABUG QA Contact: Kedar Kulkarni <kkulkarn>
Severity: high Docs Contact:
Priority: high    
Version: 5.9.4CC: bthurber, dmetzger, fdupont, hkataria, jprause, lavenel, mfeifer, mpovolny, obarenbo, smallamp
Target Milestone: GA   
Target Release: cfme-future   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: v2v
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-03-06 22:09:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: V2V Target Upstream Version:
Embargoed:
Bug Depends On: 1626503    
Bug Blocks:    

Description Kedar Kulkarni 2018-08-20 22:44:03 UTC
Description of problem:
Post migration playbook cannot find hostname/IP address and runs against localhost. Then I checked the VM in RHV and found out that the VM did not show IP address associated with it in the UI. 
Installed rhevm guest agent as outlined in this https://access.redhat.com/solutions/261763 and VM did show the IP address in UI. And if I would run the playbook  now, it can get the correct IP address from VM and execute play successfully.

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

How reproducible:
100%

Steps to Reproduce:
1.Create a VM without rhvm-guest-agent installed in VMware
2.Migrate it and have pre and post migration playbook services attached to migration


Actual results:
Pre-migration playbook runs correctly, while post-migration cannot, as it can't find IP address and falls back to run against localhost.


Expected results:
Post migration playbook should run successfully against migrated VM and not run against localhost.

Additional info:
I have tested running migration with rhel7-server vm with and without guest tools and found out, if I had the guest tools installed, the IP address of the VM will be available for playbook to execute.

Comment 2 Fabien Dupont 2018-08-21 07:03:54 UTC
This is the expected behavior from a playbook point of view.

The IP address is provided to RHV by the guest agent. In CloudForms, the IP address is coming from the inventory, which is limited to what information RHV provides. So, if the guest agent is not installed, RHV doesn't have the IP, hence CloudForms doesn't have it either.

About the fact that it runs against localhost, it is also on purpose because we consider that we can run a playbook even if the VM is down. It's then the responsibility of the playbook writer to ensure it can run in a limited context.

As you pointed out, the question here is "how do we ensure that the guest agent is installed during the migration process ?"

Comment 14 Fabien Dupont 2019-03-06 22:09:49 UTC
The only remaining issue is on virt-v2v side and is tracked here. The CloudForms behavior is normal. Closing as NOTABUG