Operations
If the --enable/--operations option is not given, then most sysprep operations are enabled.
Use "virt-sysprep --list-operations" to list all operations for your virt-sysprep binary. The ones which are enabled by default are marked with a "*" character. Regardless of the --enable/--operations options, sysprep operations are skipped for some guest types.
Operations can be individually enabled using the --enable/--operations options. Use a comma-separated list, for example:
virt-sysprep --operations ssh-hostkeys,udev-persistent-net [etc..]
Future versions of virt-sysprep may add more operations. If you are using virt-sysprep and want predictable behaviour, specify only the operations that you want to have enabled.
"*" = enabled by default when no --enable/--operations option is given.
abrt-data *
Remove the crash data generated by ABRT.
Remove the automatically generated ABRT crash data in "/var/spool/abrt/".
backup-files *
Remove editor backup files from the guest.
The following files are removed from anywhere in the guest filesystem:
On Linux and Unix operating systems, only the following filesystems will be examined:
·
|
/etc
|
·
|
/root
|
·
|
/srv
|
·
|
/tmp
|
·
|
/var
|
bash-history *
Remove the bash history in the guest.
Remove the bash history of user "root" and any other users who have a ".bash_history" file in their home directory.
Notes on bash-history
Currently this only looks in "/root" and "/home/*" for home directories, so users with home directories in other locations won't have the bash history removed.
blkid-tab *
Remove blkid tab in the guest.
ca-certificates
Remove CA certificates in the guest.
In case any certificate is removed, the system CA store is updated.
crash-data *
Remove the crash data generated by kexec-tools.
Remove the automatically generated kdump kernel crash data.
cron-spool *
Remove user at-jobs and cron-jobs.
customize *
Customize the guest.
Customize the guest by providing virt-customize(1) options for installing packages, editing files and so on.
dhcp-client-state *
Remove DHCP client leases.
dhcp-server-state *
Remove DHCP server leases.
dovecot-data *
Remove Dovecot (mail server) data.
firewall-rules
Remove the firewall rules.
This removes custom firewall rules by removing "/etc/sysconfig/iptables" or custom firewalld configuration in "/etc/firewalld/*/*".
Note this is not enabled by default since it may expose guests to exploits. Use with care.
flag-reconfiguration
Flag the system for reconfiguration.
For Linux guests, this touches "/.unconfigured", which causes the first boot to interactively query the user for settings such as the root password and timezone.
fs-uuids
Change filesystem UUIDs.
On guests and filesystem types where this is supported, new random UUIDs are generated and assigned to filesystems.
Notes on fs-uuids
The fs-uuids operation is disabled by default because it does not yet find and update all the places in the guest that use the UUIDs. For example "/etc/fstab" or the bootloader. Enabling this operation is more likely than not to make your guest unbootable.
See: https://bugzilla.redhat.com/show_bug.cgi?id=991641
ipa-client *
Remove the IPA files.
Remove all the files related to an IPA (Identity, Policy, Audit) system. This effectively unenrolls the guest from an IPA server without interacting with it.
This operation does not run "ipa-client".
kerberos-data
Remove Kerberos data in the guest.
kerberos-hostkeytab *
Remove the Kerberos host keytab file in the guest.
logfiles *
Remove many log files from the guest.
On Linux the following files are removed:
·
|
/etc/Pegasus/*.cnf
|
·
|
/etc/Pegasus/*.crt
|
·
|
/etc/Pegasus/*.csr
|
·
|
/etc/Pegasus/*.pem
|
·
|
/etc/Pegasus/*.srl
|
·
|
/root/anaconda-ks.cfg
|
·
|
/root/anaconda-post.log
|
·
|
/root/initial-setup-ks.cfg
|
·
|
/root/install.log
|
·
|
/root/install.log.syslog
|
·
|
/root/original-ks.cfg
|
·
|
/var/cache/fontconfig/*
|
·
|
/var/cache/gdm/*
|
·
|
/var/cache/man/*
|
·
|
/var/lib/AccountService/users/*
|
·
|
/var/lib/fprint/*
|
·
|
/var/lib/logrotate.status
|
·
|
/var/log/*.log*
|
·
|
/var/log/BackupPC/LOG
|
·
|
/var/log/ConsoleKit/*
|
·
|
/var/log/anaconda.syslog
|
·
|
/var/log/anaconda/*
|
·
|
/var/log/apache2/*_log
|
·
|
/var/log/apache2/*_log-*
|
·
|
/var/log/apt/*
|
·
|
/var/log/aptitude*
|
·
|
/var/log/audit/*
|
·
|
/var/log/btmp*
|
·
|
/var/log/ceph/*.log
|
·
|
/var/log/chrony/*.log
|
·
|
/var/log/cron*
|
·
|
/var/log/cups/*_log*
|
·
|
/var/log/debug*
|
·
|
/var/log/dmesg*
|
·
|
/var/log/exim4/*
|
·
|
/var/log/faillog*
|
·
|
/var/log/firewalld*
|
·
|
/var/log/gdm/*
|
·
|
/var/log/glusterfs/*glusterd.vol.log
|
·
|
/var/log/glusterfs/glusterfs.log
|
·
|
/var/log/grubby*
|
·
|
/var/log/httpd/*log
|
·
|
/var/log/installer/*
|
·
|
/var/log/jetty/jetty-console.log
|
·
|
/var/log/journal/*
|
·
|
/var/log/lastlog*
|
·
|
/var/log/libvirt/libvirtd.log
|
·
|
/var/log/libvirt/libxl/*.log
|
·
|
/var/log/libvirt/lxc/*.log
|
·
|
/var/log/libvirt/qemu/*.log
|
·
|
/var/log/libvirt/uml/*.log
|
·
|
/var/log/lightdm/*
|
·
|
/var/log/mail/*
|
·
|
/var/log/maillog*
|
·
|
/var/log/messages*
|
·
|
/var/log/ntp
|
·
|
/var/log/ntpstats/*
|
·
|
/var/log/ppp/connect-errors
|
·
|
/var/log/rhsm/*
|
·
|
/var/log/sa/*
|
·
|
/var/log/secure*
|
·
|
/var/log/setroubleshoot/*.log
|
·
|
/var/log/spooler*
|
·
|
/var/log/squid/*.log
|
·
|
/var/log/syslog*
|
·
|
/var/log/tallylog*
|
·
|
/var/log/tuned/tuned.log
|
·
|
/var/log/wtmp*
|
·
|
/var/log/xferlog*
|
·
|
/var/named/data/named.run
|
lvm-system-devices *
Remove LVM2 system.devices file.
On Linux guests, LVM2's scanning for physical volumes (PVs) may be restricted to those block devices whose WWIDs are listed in "/etc/lvm/devices/system.devices". When cloning VMs, WWIDs may change, breaking "lvm pvscan". Remove "/etc/lvm/devices/system.devices".
lvm-uuids *
Change LVM2 PV and VG UUIDs.
On Linux guests that have LVM2 physical volumes (PVs) or volume groups (VGs), new random UUIDs are generated and assigned to those PVs and VGs.
machine-id *
Remove the local machine ID.
The machine ID is usually generated from a random source during system installation and stays constant for all subsequent boots. Optionally, for stateless systems it is generated during runtime at boot if it is found to be empty.
mail-spool *
Remove email from the local mail spool directory.
net-hostname *
Remove HOSTNAME and DHCP_HOSTNAME in network interface configuration.
For Fedora and Red Hat Enterprise Linux, this is removed from "ifcfg-*" files.
net-hwaddr *
Remove HWADDR (hard-coded MAC address) configuration.
For Fedora and Red Hat Enterprise Linux, this is removed from "ifcfg-*" files.
net-nmconn *
Remove system-local NetworkManager connection profiles (keyfiles).
On Fedora and Red Hat Enterprise Linux, remove the "/etc/NetworkManager/system-connections/*.nmconnection" files.
pacct-log *
Remove the process accounting log files.
The system wide process accounting will store to the pacct log files if the process accounting is on.
package-manager-cache *
Remove package manager cache.
pam-data *
Remove the PAM data in the guest.
passwd-backups *
Remove /etc/passwd- and similar backup files.
On Linux the following files are removed:
·
|
/etc/group-
|
·
|
/etc/gshadow-
|
·
|
/etc/passwd-
|
·
|
/etc/shadow-
|
·
|
/etc/subgid-
|
·
|
/etc/subuid-
|
puppet-data-log *
Remove the data and log files of puppet.
rh-subscription-manager *
Remove the RH subscription manager files.
rhn-systemid *
Remove the RHN system ID.
rpm-db *
Remove host-specific RPM database files.
Remove host-specific RPM database files and locks. RPM will recreate these files automatically if needed.
samba-db-log *
Remove the database and log files of Samba.
script *
Run arbitrary scripts against the guest.
The "script" module lets you run arbitrary shell scripts or programs against the guest.
Note this feature requires FUSE support. You may have to enable this in your host, for example by adding the current user to the "fuse" group, or by loading a kernel module.
Use one or more --script parameters to specify scripts or programs that will be run against the guest.
The script or program is run with its current directory being the guest’s root directory, so relative paths should be used. For example: "rm etc/resolv.conf" in the script would remove a Linux guest’s DNS configuration file, but "rm /etc/resolv.conf" would (try to) remove the host’s file.
Normally a temporary mount point for the guest is used, but you can choose a specific one by using the --scriptdir parameter.
Note: This is different from --firstboot scripts (which run in the context of the guest when it is booting first time). --script scripts run on the host, not in the guest.
smolt-uuid *
Remove the Smolt hardware UUID.
ssh-hostkeys *
Remove the SSH host keys in the guest.
The SSH host keys are regenerated (differently) next time the guest is booted.
If, after cloning, the guest gets the same IP address, ssh will give you a stark warning about the host key changing:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
ssh-userdir *
Remove ".ssh" directories in the guest.
Remove the ".ssh" directory of user "root" and any other users who have a ".ssh" directory in their home directory.
Notes on ssh-userdir
Currently this only looks in "/root" and "/home/*" for home directories, so users with home directories in other locations won't have the ssh files removed.
sssd-db-log *
Remove the database and log files of sssd.
tmp-files *
Remove temporary files.
This removes temporary files under "/tmp" and "/var/tmp".
udev-persistent-net *
Remove udev persistent net rules.
Remove udev persistent net rules which map the guest’s existing MAC address to a fixed ethernet device (eg. eth0).
After a guest is cloned, the MAC address usually changes. Since the old MAC address occupies the old name (eg. eth0), this means the fresh MAC address is assigned to a new name (eg. eth1) and this is usually undesirable. Erasing the udev persistent net rules avoids this.
user-account
Remove the user accounts in the guest.
By default remove all the user accounts and their home directories. The "root" account is not removed.
See the --remove-user-accounts parameter for a way to specify how to remove only some users, or to not remove some others.
utmp *
Remove the utmp file.
This file records who is currently logged in on a machine. In modern Linux distros it is stored in a ramdisk and hence not part of the virtual machine’s disk, but it was stored on disk in older distros.
yum-uuid *
Remove the yum UUID.
Yum creates a fresh UUID the next time it runs when it notices that the original UUID has been erased.
zsh-history *
Remove the zsh history in the guest.
Remove the zsh history of user "root" and any other users who have a ".zsh_history" file in their home directory.
Notes on zsh-history
Currently this only looks in "/root" and "/home/*" for home directories, so users with home directories in other locations won't have the zsh history removed.