Ovirt package CentOS6/7 virtual machine template

  1. Identifies "reconfigure"
touch /.unconfigured
  1. delete ssh host key
rm -rf /etc/ssh/ssh_host_*
  1. Restore the original hostname "localhost"
# CentOS6
sed -i '/^HOSTNAME/cHOSTNAME=localhost.localdomain' /etc/sysconfig/network
# CentOS7
sed -i '/^HOSTNAME/cHOSTNAME=localhost.localdomain' /etc/hostname
  1. clean up udev
rm -rf /etc/udev/rules.d/70-*
  1. Delete NIC hardware identification
sed -i -e '/HWADDR/d' -e '/UUID/d' /etc/sysconfig/network-scripts/ifcfg-{eth,enp}*
  1. clear log
rm -rf /var/log/*
  1. Shut down the virtual machine
poweroff

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325573086&siteId=291194637