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 1261242 - virt-v2v should prevent using '-of' option appears twice on the command line
Summary: virt-v2v should prevent using '-of' option appears twice on the command line
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
medium
medium
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard: V2V
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-09 02:58 UTC by zhoujunqin
Modified: 2016-11-03 17:54 UTC (History)
5 users (show)

Fixed In Version: libguestfs-1.28.1-1.53.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 17:54:57 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 zhoujunqin 2015-09-09 02:58:17 UTC
Description of problem:
virt-v2v should prevent using '-of' option appears twice on the command line

Version-Release number of selected component (if applicable):
libvirt-1.2.17-8.el7.x86_64
libguestfs-1.28.1-1.52.el7.x86_64
virt-v2v-1.28.1-1.52.el7.x86_64
qemu-kvm-rhev-2.3.0-22.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1. Convert a esx guest to local kvm with wrong '-of' option:

# export LIBGUESTFS_BACKEND=direct;virt-v2v  -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 esx5.5-rhel5.11-i386 -of taesratat -o null
[   0.0] Opening the source -i libvirt -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 esx5.5-rhel5.11-i386
Enter root's password for 10.66.4.103: 
Enter host password for user 'root':
[  13.0] Creating an overlay to protect the source from being modified
[  14.0] Opening the overlay
[  24.0] Initializing the target -o null
virt-v2v: error: output format should be 'raw' or 'qcow2'.

Use the '-of <format>' option to select a different output format for the 
converted guest.

Other output formats are not supported at the moment, although might be 
considered in future.

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]

2. Convert a esx guest to local kvm with several wrong '-of' options and last one is right '-of' options:

# virt-v2v  -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 esx5.5-rhel5.11-i386 -of taesratat -of aaa -of raw  -o null
[   0.0] Opening the source -i libvirt -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 esx5.5-rhel5.11-i386
Enter root's password for 10.66.4.103: 
Enter host password for user 'root':
[  13.0] Creating an overlay to protect the source from being modified
[  13.0] Opening the overlay
[  24.0] Initializing the target -o null
[  24.0] Inspecting the overlay
[  61.0] Checking for sufficient free disk space in the guest
[  61.0] Estimating space required on target for each disk
[  61.0] Converting Red Hat Enterprise Linux Server release 5.11 (Tikanga) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 166.0] Mapping filesystem data to avoid copying unused and blank areas
[ 172.0] Closing the overlay
[ 172.0] Checking if the guest needs BIOS or UEFI to boot
[ 172.0] Copying disk 1/1 to /var/tmp/null.Zh3TQS/sda (raw)
    (100.00/100%)
[ 411.0] Creating output metadata
[ 411.0] Finishing off


Actual results:
Step 1: virt-v2v command failed for detecting '-of taesratat' is a invalid option.
Step2: virt-v2v command finished with no error for just detecting the last '-of raw' option is a valid one the same time ignore several wrong '-of' options in front of it.

Expected results:
virt-v2v should prevent using '-of' option appears twice on the command line

Additional info:

Comment 2 zhoujunqin 2015-09-15 10:01:50 UTC
Try to verify this bug with new build:
libvirt-1.2.17-8.el7.x86_64
qemu-kvm-rhev-2.3.0-22.el7.x86_64
libguestfs-1.28.1-1.55.el7.x86_64
virt-v2v-1.28.1-1.55.el7.x86_64


Steps:
1. Convert a esx guest to local kvm with several '-of' option:

# virt-v2v  -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 esx5.5-rhel5.11-i386 -of taesratat -of aaa -of raw  -o null 
virt-v2v: error: -of option used more than once on the command line

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]

Result: virt-v2v will report a good error, not letting user use more than twice '-of' option.

2. Test other options:

2.1 '-ic'
# virt-v2v  -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 esx5.5-rhel5.11-i386 -of raw 
virt-v2v: error: -ic option used more than once on the command line

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]

2.2 '-on'
# virt-v2v  -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 esx5.5-rhel5.11-i386 -of raw -on test1 -on test2
virt-v2v: error: -on option used more than once on the command line

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]

2.3 '--password-file'
# virt-v2v  -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 esx5.5-rhel5.11-i386 -of raw -on test1 --password-file /tmp/passwd2 --password-file /tmp/passwd2
virt-v2v: error: --password-file option used more than once on the command 
line

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]

Also tested other options: -if, -oc, -os,--vdsm-vm-uuid, --vdsm-ovf-output, --vmtype options, they are also forbidding user used more than once on the command line.

Comment 3 mxie@redhat.com 2016-02-26 08:14:18 UTC
Test this bug with new build:
libvirt-1.3.1-1.el7.x86_64
qemu-kvm-rhev-2.3.0-31.el7.x86_64
libguestfs-1.32.2-6.el7.x86_64
virt-v2v-1.32.2-6.el7.x86_64


Steps:
1. Convert a esx guest to local kvm with several '-of' option:

# virt-v2v  -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 esx5.5-rhel5.11-i386 -of taesratat -of aaa -of raw  -o null 
virt-v2v: error: -of option used more than once on the command line

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]

Result: virt-v2v will report a good error, not letting user use more than twice '-of' option.

2. Test other options:

2.1 '-ic'
# virt-v2v  -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 esx5.5-rhel5.11-i386 -of raw 
virt-v2v: error: -ic option used more than once on the command line

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]

2.2 '-on'
# virt-v2v  -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 esx5.5-rhel5.11-i386 -of raw -on test1 -on test2
virt-v2v: error: -on option used more than once on the command line

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]

2.3 '--password-file'
# virt-v2v  -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 esx5.5-rhel5.11-i386 -of raw -on test1 --password-file /tmp/passwd2 --password-file /tmp/passwd2
virt-v2v: error: --password-file option used more than once on the command 
line

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]

Also tested other options: -if, -oc, -os,--vdsm-vm-uuid, --vdsm-ovf-output, --vmtype options, they are also forbidding user used more than once on the command line.

Comment 5 errata-xmlrpc 2016-11-03 17:54:57 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.