VMware import (importVm) fails when datacenter/cluster/host name contains a space
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 75/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- java
- Lĩnh vực
- backend, infrastructure
Hướng nghiên cứu
Bắt đầu trong plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtConvertInstanceCommandWrapper.java, đọc buildVpxUrl, getExportOVAUrlFromRemoteInstance và encodeUsername. Tái hiện thao tác import với một khoảng trắng trong tên datacenter, cluster, host, path hoặc VM, rồi kiểm tra cả hai path OVA và VDDK. Hoàn tất khi các URI vpx:// và vi:// được tạo ra phân tích thành công trong khi các dấu phân cách thư mục vẫn được giữ nguyên.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
LibvirtConvertInstanceCommandWrapper builds the vpx:///vi:// connection URIs for virt-v2v by concatenating the vCenter datacenter/cluster/host names without percent-encoding them. A datacenter (or cluster/host) name containing a space — valid in vSphere — produces an invalid URI, and VM import from VMware fails.
Environment
- CloudStack main (
659f675b059c1e5008deb3bb28793eadf377d687) - KVM host,
virt-v2v 2.7.1,libvirt 9.0.0 - Import VM from VMware (UI: Import Instance, or the
importVmAPI withimportsource=vmware), reproduced on both the OVA-conversion path and the VDDK path (-it vddk)
Steps to Reproduce
- Rename a vCenter Datacenter to include a space, e.g.
"QA Lab". - Import a VM from it via the CloudStack UI (Import Instance) or the
importVmAPI. - Conversion fails.
Actual Behavior
Using VPX URL: vpx://Administrator%40vsphere.local@203.0.113.10/QA Lab/cluster-a/203.0.113.20?no_verify=1
virt-v2v: error: could not parse '-ic vpx://...QA Lab/cluster-a/203.0.113.20?no_verify=1'. Original error message was: parse_uri: unable to parse URI
Also seen on the VDDK import path (-it vddk), same unencoded QA Lab segment, surfacing as java.io.IOException: Stream closed instead — a downstream symptom of virt-v2v exiting immediately on the same bad URI, not a separate defect.
The username is correctly percent-encoded (Administrator%40vsphere.local); datacenter/cluster/host are not.
Root Cause
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtConvertInstanceCommandWrapper.java
buildVpxUrl(~L463): appendsdatacenter,cluster,hostraw afterurl.append("/").getExportOVAUrlFromRemoteInstance(~L203): same pattern fordatacenter/path/vmin thevi://URL.encodeUsername(~L298) usesURLEncoder.encode, which encodes space as+— wrong for a URI path/authority (libvirt only decodes%20). Not yet visible as a bug since vCenter usernames rarely have spaces, but worth fixing alongside the above with the same helper.
Suggested Fix
Percent-encode datacenter/cluster/host/path/vm per /-delimited sub-segment (not as one string) — datacenter/cluster names can be folder-nested (e.g. MyFolder/MyDC), and that / must stay literal.
versions
ACS 4.22.1
- Ngôn ngữ chính
- Java
- Star
- 3.1k
- Fork
- 1.4k
- Merge trung bình
- 7 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 28
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/cloudstack
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
apache/cloudstack#14222 ·
-
create-kubernetes-binaries-iso.sh builds the ISO without setting a volume ID on EL8 based os's Đang mởbug component:kubernetes
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
apache/cloudstack#14180 ·
-
bug component:projects component:UI
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
apache/cloudstack#14070 · 5 bình luận ·
-
component:backup
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
apache/cloudstack#14013 ·
-
KVM agent fails to connect to Ceph RBD storage pool after upgrading Ceph client to Tentacle 20.2.4 Đang mởbug component:ceph
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/cloudstack#13989 · 3 bình luận ·
Tất cả issue của apache/cloudstack
Issue tương tự
-
[BUG]茶杯方块在取茶时会引发崩溃 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Cannot differ own consent and managed consents in My Consents view and detailed consent view. Đang mở1.0.0-alpha2 Type/Improvement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
wso2/dpdp-accelerator#272 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
infinispan/infinispan#18150 ·
-
area/frontend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100