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 1293527 - There should be a reminder to avoid user to edit a guest image by multiple tools at the same time in guestfish man page
Summary: There should be a reminder to avoid user to edit a guest image by multiple to...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.2
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: 7.3
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1301891
TreeView+ depends on / blocked
 
Reported: 2015-12-22 03:12 UTC by Xianghua Chen
Modified: 2016-11-03 17:57 UTC (History)
5 users (show)

Fixed In Version: libguestfs-1.32.0-3.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 17:57:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2576 0 normal SHIPPED_LIVE Moderate: libguestfs and virt-p2v security, bug fix, and enhancement update 2016-11-03 12:06:51 UTC

Description Xianghua Chen 2015-12-22 03:12:08 UTC
Description of problem:
I was using "guestfish -a $guest_image -i" without --ro, and at the mean time I used virt-edit/virt-sysprep to modify the guest image, there will be a crash if I'm modifying the same file.
According to the mail discussion with Rich, It's hard to determine that you're using the disk image from multiple tools at once, but it won't work and it will corrupt the disk image.

So, there should be a reminder to avoid user to edit a guest image by multiple tools at the same time in guestfish man page (perhaps in the warning part: http://libguestfs.org/guestfish.1.html#warning)


Version-Release number of selected component (if applicable):
libguestfs-1.20.11-16.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Prepare a guest image RHEL-Server-6.7-32-hvm.raw .
2.
# guestfish -a RHEL-Server-6.7-32-hvm.raw -i
><fs> touch /home/file1
><fs> vi /home/file1 
><fs> cat /home/file1
guestfish
><fs> vi /home/file1
Add the content "guestfish add", don't save or exit.

3. At the mean time, open a new tab and execute:
# virt-edit -a RHEL-Server-6.7-32-hvm.raw  /home/file1
Add the content "virt-edit" at the second line,save&exit

4. save & exit step 2 at the same time.
5. exit guestfish and enter again,
# guestfish -a RHEL-Server-6.7-32-hvm.raw -i
><fs> cat /home/file1
guestfish
virt-

You can see some content are lost.
p.s.:
There are also other possible errors, like the file is crash and deleted, or there are garbage characters, etc.

Actual results:


Expected results:


Additional info:
1. On RHEL7.2(libguestfs-1.28.1-55.el7.x86_64) , there is the same problem.

Comment 1 Richard W.M. Jones 2016-01-04 15:19:41 UTC
We already have a warning section, see eg:
http://libguestfs.org/guestfish.1.html#warning

However it's not very consistent across different
man pages, and it doesn't mention concurrent use of
disk editing tools.

The following patch series aims to fix this:

https://www.redhat.com/archives/libguestfs/2016-January/msg00001.html

This is not RHEL 6 material, so I have moved the BZ to RHEL 7.

Comment 5 Xianghua Chen 2016-06-27 14:36:15 UTC
Verified with the packages:
libguestfs-1.32.5-6.el7.x86_64

Verify steps: 
Check the manpage of guestfish, virt-edit, virt-copy-in, virt-tar-in, guestmount, virt-rescue, virt-sysprep, virt-sparsify, etc.

There is a warning section like :
Using "guestfish" in write mode on live virtual machines, or  concurrently with other disk editing tools, can be dangerous, potentially causing disk corruption.  The virtual machine must be shut down before you use this command, and disk images must not be  edited concurrently.



So verified.

Comment 7 errata-xmlrpc 2016-11-03 17:57:44 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/RHSA-2016-2576.html


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