Bug 1277741
Summary: | Error converting VMware vCloud VM (with name containing spaces and parenthesis) via bash script | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Alessandro <alfonsi.alex> |
Component: | libguestfs | Assignee: | Richard W.M. Jones <rjones> |
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | alfonsi.alex, angelo.lisco, dornelas, extras-qa, ggalloro, juwu, juzhou, mbooth, mzhan, ptoscano, rjones, tzheng, virt-bugs, virt-maint |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Other | ||
Whiteboard: | V2V | ||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | 1277738 | Environment: | |
Last Closed: | 2015-11-06 16:11:46 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Alessandro
2015-11-04 00:03:50 UTC
As an additional info. If I run the same command from terminal instead of using the bash script the conversion works just fine. Command from terminal: virt-v2v -ic vpx://DOMAIN%5cUSERNAME@vCenterServerName/DC/Logical%20Folder/Cluster/ESXiHostName/?no_verify=1 -o libvirt -os virtimages "conversion-test-vm (43f00f9c-276b-4bc7-9c2f-66c41824960e)" --password-file /tmp/passwd (In reply to Alessandro from comment #0) > #!/bin/bash > export LIBGUESTFS_BACKEND=direct > > # Declare all VMs to import > VMWAREVMS=("conversion-test-vm (43f00f9c-276b-4bc7-9c2f-66c41824960e)") > > # Iterate through each VMware VM, performing the conversion > for vm in "${VMWAREVMS[@]}" > do > virt-v2v -ic > vpx://DOMAIN%5cUSERNAME@vCenterServerName/DC/Logical%20Folder/Cluster/ > ESXiHostName/?no_verify=1 -o libvirt -os virtimages $vm --password-file > /tmp/passwd > done You need to quote $vm here, otherwise the different words in the variable will be passed as different arguments. Hence: virt-v2v -ic vpx://DOMAIN%5cUSERNAME@vCenterServerName/DC/Logical%20Folder/Cluster/ESXiHostName/?no_verify=1 -o libvirt -os virtimages "$vm" --password-file /tmp/passwd Hi Pino, tried that as well and just ran again to double check. Still same issue: [root@CENTOS7 Scripts]# ./Test.sh VM name is: conversion-test-vm2 (f97c63bc-e711-4281-bb57-627c86e06b18) virt-v2v: error: expecting a libvirt guest name on the command line If reporting bugs, run virt-v2v with debugging enabled and include the complete output: virt-v2v -v -x [...] Test.sh body: #!/bin/bash export LIBGUESTFS_BACKEND=direct # Declare all VMs to import VMWAREVMS=("conversion-test-vm (43f00f9c-276b-4bc7-9c2f-66c41824960e)") # Iterate through each VMware VM, performing the conversion for vm in "${VMWAREVMS[@]}" do virt-v2v -ic vpx://DOMAIN%5cUSERNAME@vCenterServerName/DC/Logical%20Folder/Cluster/ESXiHostName/?no_verify=1 -o libvirt -os virtimages "$vm" --password-file /tmp/passwd done (In reply to Alessandro from comment #3) > Hi Pino, > tried that as well and just ran again to double check. > Still same issue: > [root@CENTOS7 Scripts]# ./Test.sh > VM name is: conversion-test-vm2 (f97c63bc-e711-4281-bb57-627c86e06b18) > virt-v2v: error: expecting a libvirt guest name on the command line > > If reporting bugs, run virt-v2v with debugging enabled and include the > complete output: > > virt-v2v -v -x [...] > > Test.sh body: > #!/bin/bash > export LIBGUESTFS_BACKEND=direct > > # Declare all VMs to import > VMWAREVMS=("conversion-test-vm (43f00f9c-276b-4bc7-9c2f-66c41824960e)") > > # Iterate through each VMware VM, performing the conversion > for vm in "${VMWAREVMS[@]}" > do > virt-v2v -ic > vpx://DOMAIN%5cUSERNAME@vCenterServerName/DC/Logical%20Folder/Cluster/ > ESXiHostName/?no_verify=1 -o libvirt -os virtimages "$vm" --password-file > /tmp/passwd > done Pino, never mind. I have checked the body for hidden escapes and there was a space between "?" and "no_verify=1". Like follows: "? no_verify=1". Problem solved. You can close this case. Thanks! OK, closing then per comment #4 and comment #4. |