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 1141157 - virt-sysprep option '--user-accounts' don't work well
Summary: virt-sysprep option '--user-accounts' don't work well
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.1
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-12 10:58 UTC by Lingfei Kong
Modified: 2015-03-05 13:44 UTC (History)
5 users (show)

Fixed In Version: libguestfs-1.27.44-1.1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 13:44:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0303 0 normal SHIPPED_LIVE libguestfs bug fix and enhancement update 2015-03-05 17:34:44 UTC

Description Lingfei Kong 2014-09-12 10:58:55 UTC
Description of problem:
virt-sysprep option '--user-accounts' don't work well

Version-Release number of selected component (if applicable):
libguestfs-1.27.43-1.1.el7


How reproducible:
100%


Steps to Reproduce:
1. Create a raw format guest image: rhel6.6.img
2. Start the guest and create a new user lkong in the guest
# useradd lkong
3. #virt-sysprep --user-accounts lkong -a rhel6.6.img
[   0.0] Examining the guest ...
[   5.0] Performing "abrt-data" ...
[   5.0] Performing "bash-history" ...
[   5.0] Performing "blkid-tab" ...
[   5.0] Performing "crash-data" ...
[   5.0] Performing "cron-spool" ...
[   5.0] Performing "dhcp-client-state" ...
[   5.0] Performing "dhcp-server-state" ...
[   5.0] Performing "dovecot-data" ...
[   5.0] Performing "logfiles" ...
[   5.0] Performing "machine-id" ...
[   5.0] Performing "mail-spool" ...
[   5.0] Performing "net-hostname" ...
[   5.0] Performing "net-hwaddr" ...
[   5.0] Performing "pacct-log" ...
[   5.0] Performing "package-manager-cache" ...
[   5.0] Performing "pam-data" ...
[   5.0] Performing "puppet-data-log" ...
[   5.0] Performing "rh-subscription-manager" ...
[   5.0] Performing "rhn-systemid" ...
[   5.0] Performing "rpm-db" ...
[   5.0] Performing "samba-db-log" ...
[   5.0] Performing "script" ...
[   5.0] Performing "smolt-uuid" ...
[   5.0] Performing "ssh-hostkeys" ...
[   5.0] Performing "ssh-userdir" ...
[   5.0] Performing "sssd-db-log" ...
[   5.0] Performing "tmp-files" ...
[   5.0] Performing "udev-persistent-net" ...
[   5.0] Performing "utmp" ...
[   5.0] Performing "yum-uuid" ...
[   5.0] Performing "customize" ...
[   5.0] Setting a random seed
[   6.0] Performing "lvm-uuids" ...

4. Login the guest and check

Actual results:
At step 4, lkong account was not removed from the guest


Expected results:
At step 4, lkong account was removed from the guest


Additional info:

Comment 2 Pino Toscano 2014-09-12 13:04:55 UTC
(In reply to Lingfei Kong from comment #0)
> 3. #virt-sysprep --user-accounts lkong -a rhel6.6.img
> [   0.0] Examining the guest ...
> [   5.0] Performing "abrt-data" ...
> [   5.0] Performing "bash-history" ...
> [   5.0] Performing "blkid-tab" ...
> [   5.0] Performing "crash-data" ...
> [   5.0] Performing "cron-spool" ...
> [   5.0] Performing "dhcp-client-state" ...
> [   5.0] Performing "dhcp-server-state" ...
> [   5.0] Performing "dovecot-data" ...
> [   5.0] Performing "logfiles" ...
> [   5.0] Performing "machine-id" ...
> [   5.0] Performing "mail-spool" ...
> [   5.0] Performing "net-hostname" ...
> [   5.0] Performing "net-hwaddr" ...
> [   5.0] Performing "pacct-log" ...
> [   5.0] Performing "package-manager-cache" ...
> [   5.0] Performing "pam-data" ...
> [   5.0] Performing "puppet-data-log" ...
> [   5.0] Performing "rh-subscription-manager" ...
> [   5.0] Performing "rhn-systemid" ...
> [   5.0] Performing "rpm-db" ...
> [   5.0] Performing "samba-db-log" ...
> [   5.0] Performing "script" ...
> [   5.0] Performing "smolt-uuid" ...
> [   5.0] Performing "ssh-hostkeys" ...
> [   5.0] Performing "ssh-userdir" ...
> [   5.0] Performing "sssd-db-log" ...
> [   5.0] Performing "tmp-files" ...
> [   5.0] Performing "udev-persistent-net" ...
> [   5.0] Performing "utmp" ...
> [   5.0] Performing "yum-uuid" ...
> [   5.0] Performing "customize" ...
> [   5.0] Setting a random seed
> [   6.0] Performing "lvm-uuids" ...

--user-accounts is just the optional parameter for the user-account operation, which you are not actually enabling there; see the output of `virt-sysprep --list-operations` (user-account has no '*', so it is not enabled by default).

In the documentation there is:
        --user-accounts USERS (see "user-account" below)
which yes, gives the idea that --user-accounts is related to the user-account operation, but not actually saying more than that.

Rich, what do you think about turning the documentation text
  (see "OP" below)
into
  (needs the "OP" operation; see below)
?

Comment 3 Richard W.M. Jones 2014-09-12 15:43:55 UTC
I have a slightly different take on this problem.  See:

https://www.redhat.com/archives/libguestfs/2014-September/thread.html#00063

Comment 5 yuliu 2014-11-11 07:15:47 UTC
Version: libguestfs-1.28.1-1.9.el7.x86_64

Steps:
1. Login guest and create an user account test1
2. #virt-sysprep --enable user-account -a guest-image.qcow2
3. Login guest again by the account test1.

test1 was deleted already.

Verified.

Comment 7 errata-xmlrpc 2015-03-05 13:44:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0303.html


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