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 1229385 - virt-p2v in kernel command line mode should power off the machine after conversion
Summary: virt-p2v in kernel command line mode should power off the machine after conve...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.2
Hardware: x86_64
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard: P2V
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-08 15:02 UTC by Richard W.M. Jones
Modified: 2015-11-19 07:01 UTC (History)
6 users (show)

Fixed In Version: libguestfs-1.28.1-1.38.el7
Doc Type: Bug Fix
Doc Text:
Clone Of: 1229262
Environment:
Last Closed: 2015-11-19 07:01:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2183 0 normal SHIPPED_LIVE libguestfs bug fix and enhancement update 2015-11-19 08:18:42 UTC

Description Richard W.M. Jones 2015-06-08 15:02:31 UTC
Description of problem:

After conversion using the automated kernel command line mode, virt-p2v
really ought to power off the machine.

Version-Release number of selected component (if applicable):

virt-p2v from git, or RHEL 7.1

How reproducible:

100%

Steps to Reproduce:

Please see my reproducer steps here:
https://bugzilla.redhat.com/show_bug.cgi?id=1229262#c2

Actual results:

virt-p2v runs invisibly (or fails invisibly), and there's no obvious
conclusion to the conversion, unless you study the log files on the
conversion server.

Expected results:

virt-p2v should power off the server after completion.

Comment 2 Richard W.M. Jones 2015-06-09 19:24:46 UTC
Upstream fixes:

716244c33718c866edce9e7ee8f21ee612f53337
b45f6a04359b4b64256b7b21a04416fa772c9423

These fixes actually add various commands you can use to
run scripts before and after conversion:

       p2v.pre=COMMAND
       p2v.pre="COMMAND ARG ..."
           Select a pre-conversion command to run.  Any command or script can
           be specified here.  If the command contains spaces, you must quote
           the whole command with double quotes.  The default is not to run
           any command.

       p2v.post=poweroff
       p2v.post=reboot
       p2v.post=COMMAND
       p2v.post="COMMAND ARG ..."
           Select a post-conversion command to run if conversion is
           successful.  This can be any command or script.  If the command
           contains spaces, you must quote the whole command with double
           quotes.

           If virt-p2v is running as root, and the command line was set from
           "/proc/cmdline" (not --cmdline), then the default is to run the
           poweroff(8) command.  Otherwise the default is not to run any
           command.

       p2v.fail=COMMAND
       p2v.fail="COMMAND ARG ..."
           Select a post-conversion command to run if conversion fails.  Any
           command or script can be specified here.  If the command contains
           spaces, you must quote the whole command with double quotes.  The
           default is not to run any command.

I have included the fixes in the latest test ISO at:

http://oirase.annexia.org/virt-p2v/RHEL-7.2-preview/

Comment 4 tingting zheng 2015-06-11 03:29:13 UTC
Tested with:
livecd-p2v-201506091319.iso
virt-v2v-1.28.1-1.38.el7.x86_64
libguestfs-1.28.1-1.38.el7.x86_64

1.Check virt-p2v manual:
# man virt-p2v,the part about p2v.pre,p2v.post have been added.
  p2v.pre=COMMAND
       p2v.pre="COMMAND ARG ..."
           Select a pre-conversion command to run.  Any command or script can be specified here.  If the
           command contains spaces, you must quote the whole command with double quotes.  The default is not to
           run any command.

       p2v.post=poweroff
       p2v.post=reboot
       p2v.post=COMMAND
       p2v.post="COMMAND ARG ..."
           Select a post-conversion command to run if conversion is successful.  This can be any command or
           script.  If the command contains spaces, you must quote the whole command with double quotes.

           If virt-p2v is running as root, and the command line was set from "/proc/cmdline" (not --cmdline),
           then the default is to run the poweroff(8) command.  Otherwise the default is not to run any
           command.

       p2v.fail=COMMAND
       p2v.fail="COMMAND ARG ..."
           Select a post-conversion command to run if conversion fails.  Any command or script can be specified
           here.  If the command contains spaces, you must quote the whole command with double quotes.  The
           default is not to run any command.

2.Use virt-p2v to convert host.
For default(didn't set anything about p2v.post) in kernel command line,it will poweroff after conversion.

If set p2v.fail=reboot or p2v.post=reboot,If the conversion fail or finish,the host will reboot.

Refer to the above comments,move the bug to VERIFIED.

Comment 6 errata-xmlrpc 2015-11-19 07:01:46 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-2183.html


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