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):
Steps to Reproduce:
1. Run virt-sysprep on an image. The hostname is not correctly removed from the VM.
virt-sysprep is not removing hostname correctly.
virt-sysprep should remove hostname correctly.
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.
Closing this bug, as virt-sysprep works as intended, and --hostname must be used to change the hostname.