RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1571324 - virt-sysprep net-hostname is only removing HOSTNAME from ifcfg file
Summary: virt-sysprep net-hostname is only removing HOSTNAME from ifcfg file
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.4
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-04-24 14:07 UTC by nijin ashok
Modified: 2021-06-10 15:57 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-05-23 17:03:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description nijin ashok 2018-04-24 14:07:09 UTC
Description of problem:

Currently, virt-sysprep net-hostname is only removing hostname from ifcfg files which is not adequate for clearing the hostname from the VM. We also have to remove it from /etc/sysconfig/network and /etc/hostname so that it would make sure that the hostname is properly removed from the VM.


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

libguestfs-1.36.10

How reproducible:

100%

Steps to Reproduce:

1. Run virt-sysprep on an image. The hostname is not correctly removed from the VM. 


Actual results:

virt-sysprep is not removing hostname correctly.

Expected results:

virt-sysprep should remove hostname correctly.


Additional info:

Comment 3 Pino Toscano 2018-05-02 11:58:37 UTC
A guest always has an hostname, be it "vm01.intranet.corp.com" or simply "localhost.localdomain". You cannot "clear" the hostname from an OS.

If you want to use the same template as a base for creating multiple VMs, then the best way is to use e.g. virt-customize/virt-sysrep --hostname (offline), cloud-init (at runtime), or any other solution to set the hostname.

Comment 4 Pino Toscano 2018-05-23 17:03:49 UTC
Closing this bug, as virt-sysprep works as intended, and --hostname must be used to change the hostname.


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