Bug 1417859 - [RFE] Would like to able to set a hostname based on dns during auto discovery.
Summary: [RFE] Would like to able to set a hostname based on dns during auto discovery.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Discovery Plugin
Version: 6.2.6
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: Unspecified
Assignee: Lukas Zapletal
QA Contact: Perry Gagne
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-31 10:29 UTC by vijsingh
Modified: 2020-07-16 09:10 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 16:54:17 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 18148 0 Normal Closed Report DHCP/DNS name and domain via facts on the image 2020-03-13 17:18:52 UTC

Description vijsingh 2017-01-31 10:29:52 UTC
1. Proposed title of this feature request

  Would like to able to set a hostname based on dns during auto discovery.

2. What is the nature and description of the request?

  In the discovery rules CU wants to set the hostname as per defined it's DNS name in 'host template'. so that when a system is auto provisioned it is set to the dns hostname based on the static IP address given by a DHCP server.

3. Why does the customer need this? (List the business requirements here)

  As per the CU they are having hundreds of systems at sites with predefined hostnames, if they need to reinstalled or installed as a new system it would require setting the exact hostname for them.

4. How would the customer like to achieve this? (List the functional requirements here)

  In the discovery rules CU wants to set the hostname as per defined it's DNS name in 'host template'.

5. For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.

   when a system is auto provisioned it is set to the dns hostname based on the static IP address given by a DHCP server

6. Is there already an existing RFE upstream or in Red Hat Bugzilla?
 
  No

7. Does the customer have any specific time-line dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?
 
  No

8. List any affected packages or components.

  No

9. Would the customer be able to assist in testing this functionality if implemented?

  Yes

Comment 3 Lukas Zapletal 2017-02-01 09:35:40 UTC
Hello,

we are tracking similar request to simply send DHCP "hostname" along with other facts and also DNS PTR name associated with a (static) IP. Any of the two new facts can be then used for discovered hostname instead of the default "macXXXX". Will this work for the user? Can you confirm?

Comment 5 pm-sat@redhat.com 2017-03-30 16:09:24 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/18148 has been resolved.

Comment 7 Lukas Zapletal 2017-06-05 11:18:24 UTC
This bug is scheduled for Satellite 6.3 as you can see in the flag: pm-rhel=sat-6.3.0. Since this is a new feature, it is not a candidate for backport into 6.2.

Comment 10 Lukas Zapletal 2018-02-07 10:05:24 UTC
QA notes, scenario A: use DHCP advertised hostname as discovered node name.

- Setup DHCP server to have longer lease (6 hours for testing)
- Restart DHCP server
- Create a VM, install OS manualy, give it a hostname "mytest"
- Reboot the system via DHCP and make sure the lease contains hostname option
- Set "Hostname facts" to [nmprimary_dhcp4_option_host_name, discovery_bootif] (this is array of two options)
- Set "Discovery prefix" to "xxx_"
- Reboot the system into discovery while keeping the MAC address
- The DHCP server advertise hostname "mytest" (from the lease)
- The host should appear as "xxx_mytest"
- Whole test scenario must be done within 6 hours

QA notes, scenario B: use DHCP advertised hostname as provisioned system hostname.

- Configure DHCP and install/boot a named OS with "myhost" hostname as in scenario A
- Revert "Hostname facts" to default value
- Revert "Discovery prefix" to default value
- Reboot the system into discovery
- The host should appear as "macAABBCCDDEEFF" (normally)
- Create a discovery rule with some valid hostgroup that always matches
-
- Set hostname to: xxx_<%= @host.facts['nmprimary_dhcp4_option_host_name'] %>
- Provision the discovered host via Auto provision
- The provisioned system should be named: xxx_myhost

Note both scenarios will only work when DHCP hostnames are unique. This is quite special Satellite 6 setup, I don't expect many customers to have this kind of setup.

Comment 17 pm-sat@redhat.com 2018-02-21 16:54:17 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-2018:0336


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