[KVM] StringIndexOutOfBoundsException in IscsiAdmStorageAdaptor.disconnectPhysicalDiskByPath makes the first Stop VM fail when a disk path contains "-iscsi-" (e.g. a SharedMountPoint pool mount directory)

Ouverte
#14,664 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@HawkForge y travaille déjà.

Depuis le 12/11/2026.

  • #14686 par @HawkForge — ouverte

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
57/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
java

Piste de recherche

Start with IscsiAdmStorageAdaptor.disconnectPhysicalDiskByPath at the reported exception line, then trace how KVMStoragePoolManager calls it during LibvirtComputingResource.cleanupDisk. Reproduce with an attached volume on a SharedMountPoint iSCSI pool and inspect the disk path passed to the method. Done when the first Stop attempt handles that path without throwing and the regression is covered by a focused test.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

problem

Stopping a VM that has a volume from a SharedMountPoint (iSCSI-backed) pool attached fails the first time with:

java.lang.StringIndexOutOfBoundsException: Range [21, -1) out of bounds for length 58
  at com.cloud.hypervisor.kvm.storage.IscsiAdmStorageAdaptor.disconnectPhysicalDiskByPath(IscsiAdmStorageAdaptor.java:362)
  at com.cloud.hypervisor.kvm.storage.KVMStoragePoolManager.disconnectPhysicalDiskByPath(KVMStoragePoolManager.java:213)
  at com.cloud.hypervisor.kvm.resource.LibvirtComputingResource.cleanupDisk(LibvirtComputingResource.java:3971)
  at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtStopCommandWrapper.execute(LibvirtStopCommandWrapper.java:98)

The exception is deterministic (same message every time, reproduced 4 times). The second Stop attempt succeeds. If the volume is detached first, the Stop succeeds on the first attempt. The index pair (start 21, end -1) looks like an indexOf(...) returning -1 and being used as the end of a substring, which would mean the disk path format does not match what the parser expects. We have not confirmed this.

versions
  • Apache CloudStack 4.22.1.1
  • Hypervisor: KVM
  • Primary storage: pool of type SharedMountPoint, backed by iSCSI LUNs
The steps to reproduce the bug
  1. Create a VM with a data volume on a SharedMountPoint (iSCSI-backed) pool and attach it.
  2. Stop the VM. The stop fails with the exception above.
  3. Stop the VM again. It stops normally.
  4. Start the VM, detach the volume, stop the VM. It stops on the first attempt.
What to do about it?

Validate the path in disconnectPhysicalDiskByPath before calling substring, and return false (or log and skip) for paths that are not iSCSI device paths instead of throwing. It would also help to understand why the second Stop works.

Langage dominant
Java
Étoiles
3.1k
Forks
1.4k
Merge moyen
7 j 16 h
PR mergées (30 j)
15

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de apache/cloudstack

Toutes les issues de apache/cloudstack

Issues similaires

Plus d'issues Java

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.