In fact it behaves differently. The machine-id
step is really enabled by default, but it deletes the original content and generates new. It is intended for 1 to 1 image deployments.
However if you want the content of the /etc/machine-id
to be cleared for 1 to many scenario, you have to run the command with --enable machine-id
option specified explicitly:
# virt-sysprep --format qcow2 --enable machine-id -a <qcow2 image>
It ignores other steps then and does just the machine-id
step, which makes /etc/machine-id
empty so it is generated during the first boot. You can run it as additional command to the original with all other defaults. Or you can add additional required steps to the line.
EDIT: In fact the culprit is the operation customize
, which generates the new machine-id, despite the operation machine-id
removed it. The operation customize
is by default enabled too.
The RH knows about this and possibly RH will fix the man page in the future.
It is also possible that the command behaves like this on RHEL9 or other distributions, I haven't tried.