importVm (shared/local storage adoption): ROOT volume always gets deviceId 1, not 0
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 86/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- java
- Área
- infrastructure
Línea de trabajo
Comience en server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java e inspeccione el método de importación KVM compartido/local, especialmente el deviceId que se pasa a importKVMSharedDisk e importKVMLocalDisk. Compare las rutas de importación externa/VMware y staged, y después verifique que un volumen ROOT importado informe deviceid 0 mientras el comportamiento de importación existente permanezca sin cambios.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Java
- Estrellas
- 3.1k
- Forks
- 1.4k
- Merge medio
- 6 d 20 h
- PR fusionados (30 d)
- 27
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/cloudstack
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
apache/cloudstack#14222 ·
-
create-kubernetes-binaries-iso.sh builds the ISO without setting a volume ID on EL8 based os's Abiertobug component:kubernetes
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
apache/cloudstack#14180 ·
-
bug component:projects component:UI
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
apache/cloudstack#14070 · 5 comentarios ·
-
component:backup
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
apache/cloudstack#14013 ·
-
KVM agent fails to connect to Ceph RBD storage pool after upgrading Ceph client to Tentacle 20.2.4 Abiertobug component:ceph
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/cloudstack#13989 · 3 comentarios ·
Todos los issues de apache/cloudstack
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
checkstyle/test-configs#263 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
Cannot differ own consent and managed consents in My Consents view and detailed consent view. Abierto1.0.0-alpha2 Type/Improvement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
wso2/dpdp-accelerator#272 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
apache/rocketmq-dashboard#4860 · 1 comentario ·