Skip to content

NPE migrating volume to non-created storage pool #11505

Description

@BartJM

problem

When migrating a volume to a storage pool that is not created on the hypervisor it will cause a NullPointerException.

2025-08-25 10:44:18,239 DEBUG [kvm.storage.LibvirtStorageAdaptor] (agentRequest-Handler-7:null) (logid:3570ae3f) Attempting to create storage pool 2fe96505-06a5-3ae7-a97b-483da5425fd1
2025-08-25 10:44:18,242 WARN  [cloud.agent.Agent] (agentRequest-Handler-7:null) (logid:3570ae3f) Caught: 
java.lang.NullPointerException
        at com.cloud.hypervisor.kvm.storage.LibvirtStorageAdaptor.createRBDStoragePool(LibvirtStorageAdaptor.java:422)
        at com.cloud.hypervisor.kvm.storage.LibvirtStorageAdaptor.createStoragePool(LibvirtStorageAdaptor.java:774)
        at com.cloud.hypervisor.kvm.storage.KVMStoragePoolManager.createStoragePool(KVMStoragePoolManager.java:365)
        at com.cloud.hypervisor.kvm.storage.KVMStoragePoolManager.createStoragePool(KVMStoragePoolManager.java:352)
        at com.cloud.hypervisor.kvm.storage.KVMStorageProcessor.copyVolumeFromImageCacheToPrimary(KVMStorageProcessor.java:509)
        at com.cloud.storage.resource.StorageSubsystemCommandHandlerBase.execute(StorageSubsystemCommandHandlerBase.java:110)
        at com.cloud.storage.resource.StorageSubsystemCommandHandlerBase.handleStorageCommands(StorageSubsystemCommandHandlerBase.java:64)
        at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtStorageSubSystemCommandWrapper.execute(LibvirtStorageSubSystemCommandWrapper.java:36)
        at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtStorageSubSystemCommandWrapper.execute(LibvirtStorageSubSystemCommandWrapper.java:30)
        at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtRequestWrapper.execute(LibvirtRequestWrapper.java:78)
        at com.cloud.hypervisor.kvm.resource.LibvirtComputingResource.executeRequest(LibvirtComputingResource.java:1934)
        at com.cloud.agent.Agent.processRequest(Agent.java:683)
        at com.cloud.agent.Agent$AgentRequestHandler.doTask(Agent.java:1106)
        at com.cloud.utils.nio.Task.call(Task.java:83)
        at com.cloud.utils.nio.Task.call(Task.java:29)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)

Cause seems to be in com.cloud.hypervisor.kvm.storage.KVMStorageProcessor.copyVolumeFromImageCacheToPrimary(KVMStorageProcessor.java:509) where the userinfo is set to null.

versions

KVM
CS 4.19.3

The steps to reproduce the bug

  1. Create volume
  2. Migrate volume to a new storage pool

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions