importVm (shared/local storage adoption): ROOT volume always gets deviceId 1, not 0
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 86/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- java
- Ambito
- infrastructure
Direzione di ricerca
Iniziare da server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java e ispezionare il metodo di importazione KVM condiviso/locale, in particolare il deviceId passato a importKVMSharedDisk e importKVMLocalDisk. Confrontare i percorsi di importazione external/VMware e staged, quindi verificare che un volume ROOT importato riporti deviceid 0, mentre il comportamento di importazione esistente rimanga invariato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
When adopting an existing disk with importVm importsource=shared or importsource=local, the ROOT
volume ends up with deviceid=1 instead of 0. This happens no matter which storage backend is used —
I saw it with RBD, Linstor, and plain qcow2 on NFS, all the same way.
It doesn't stop the VM from working. It boots fine, the disk is correct, everything else is normal. But
deviceid=1 for a ROOT volume is unexpected, and any code (or person reading listVolumes output) that
assumes ROOT = device 0 will get confused here.
Where it comes from
server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java, in the method that handles
the shared/local KVM import:
long deviceId = 1L;
if (ImportSource.SHARED == importSource) {
diskProfileStoragePoolList.add(importKVMSharedDisk(userVm, diskOffering, Volume.Type.ROOT,
template, deviceId, poolId, diskPath, diskProfile));
} else if (ImportSource.LOCAL == importSource) {
diskProfileStoragePoolList.add(importKVMLocalDisk(userVm, diskOffering, Volume.Type.ROOT,
template, deviceId, hostId, diskPath, diskProfile));
}
deviceId = 1L is passed straight into the ROOT volume's own import call.
Compare this to the other two import paths in the same file (external/VMware import and staged import).
Both of those do it the right way: ROOT is imported with deviceId=null (which defaults to 0), and only
the loop that comes after, for data disks, starts counting at deviceId = 1L.
In the shared/local path there is no data-disk loop at all right now (data disks aren't imported this
way yet), so it looks like the 1L that was meant for "first disk after ROOT" ended up being used for
ROOT itself by mistake.
History
This is not new. git log -S "importKVMSharedDisk" traces it back to the original "KVM Ingestion -
Import Instance" PR (#7976), so it's been there since shared/local KVM import was first added.
Suggested fix
Pass null (or 0) as the deviceId for the ROOT volume in importKVMSharedDisk /
importKVMLocalDisk, the same way the external/VMware import path already does it.
Reproduce
importVm importsource=shared hypervisor=KVM storageid=<pool> diskpath=<existing file> networkid=<net> ...
Then check listVolumes for the resulting VM — ROOT shows deviceid: 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
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/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
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
objectionary/eo-graphs#74 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100