Bug 1721899

Summary: Provisionoing a VM on GCE creating two Host Profiles in foreman
Product: Red Hat Satellite Reporter: Jitendra Yejare <jyejare>
Component: Compute Resources - GCEAssignee: Kavita <kgaikwad>
Status: CLOSED WONTFIX QA Contact: Jitendra Yejare <jyejare>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 6.6.0CC: apatel, mmccune
Target Milestone: 6.6.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-10 05:20:57 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:    
Bug Blocks: 1721890    

Description Jitendra Yejare 2019-06-19 08:45:08 UTC
Description:
----------------------
Provisioning a VM on GCE CR is creating two host profiles in foreman.
The one is along with domain which we have provided while provisioning and another is with the actual domain appends from GCE.

Like :
1. testgceHost.domain-from-foreman
2. testgceHost.domain-from-foreman.us-east1-gce-internal


Steps:
---------
1. Create GCE CR
2. Create a domain in foreman
3. Provision a VM on GCE CR and assign the domain created while provisioning


Actual Behavior:
--------------------
Two host profiles are created in foreman instead of one for a provisioned VM  on GCE as described in the description of this bug.


Expected Behavior:
--------------------
Single host profiles should be created in foreman for a provisioned VM  on GCE.

Comment 3 Kavita 2019-06-26 07:42:59 UTC
Created redmine issue https://projects.theforeman.org/issues/27158 from this bug

Comment 4 Kavita 2019-07-10 05:20:57 UTC
When I tried to reproduce this issue on latest foreman, found below observations.
 

There is a setting called "Use UUID for certificates" which says "Satellite will use random UUIDs for certificate signing instead of hostnames".
In case of google compute resource, it is recommended to enable this setting for consistent Puppet certificate IDs instead of hostnames.

Upstream documentation link - https://theforeman.org/manuals/1.22/index.html#5.2.4GoogleComputeEngineNotes

By observation is that if this setting is disabled(by default it is) and user tries to provision a system with puppet integration using google compute resource,
it creates two host profiles. One which is already created while provisioning & other one is when facts from provisioned system are collected to the server. 
The reason behind this is because of hostnames are different.

With this setting, it will not create two host profiles. so closing this BZ.