VMware import (importVm) fails when datacenter/cluster/host name contains a space
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 75/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- java
- Ambito
- backend, infrastructure
Direzione di ricerca
Inizia in plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtConvertInstanceCommandWrapper.java, leggendo buildVpxUrl, getExportOVAUrlFromRemoteInstance e encodeUsername. Riproduci l’importazione con uno spazio nel nome di un datacenter, cluster, host, percorso o VM e analizza entrambi i percorsi OVA e VDDK. È completato quando gli URI vpx:// e vi:// generati vengono analizzati correttamente e i separatori delle cartelle rimangono intatti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Java
- Stelle
- 3.1k
- Fork
- 1.4k
- Merge medio
- 6g 20h
- PR unite (30g)
- 27
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/cloudstack
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
apache/cloudstack#14222 ·
-
create-kubernetes-binaries-iso.sh builds the ISO without setting a volume ID on EL8 based os's Apertabug component:kubernetes
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
apache/cloudstack#14180 ·
-
bug component:projects component:UI
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
apache/cloudstack#14070 · 5 commenti ·
-
component:backup
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
apache/cloudstack#14013 ·
-
KVM agent fails to connect to Ceph RBD storage pool after upgrading Ceph client to Tentacle 20.2.4 Apertabug component:ceph
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/cloudstack#13989 · 3 commenti ·
Tutte le issue di apache/cloudstack
Issue simili
-
bug untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
opensearch-project/ml-commons#5094 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
emitter:client:csharp feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
affects/8.10 affects/8.9 component/clients kind/bug likelihood/mid severity/mid
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 Apertabug frontend maui-pilot
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100