Repository navigation
NPE migrating volume to non-created storage pool #11505
Copy link
Copy link
Closed
Milestone
Description
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
- Create volume
- Migrate volume to a new storage pool
Reactions are currently unavailable
Activity
harikrishna-patnala commentedon Sep 1, 2025
@BartJM can you please help us in some more detailed steps to reproduce, how you had the situation of a storage pool that is not created on the hypervisor
BartJM commentedon Sep 1, 2025
The situation where a storage pool was not created on the hypervisor occurred after we enabled a storage pool that was not yet in use but had been added to cloudstack and disabled.
Cloudstack did not create this storage pool in libvirt on the hypervisors when it was disabled or after enabling the storage pool.
When running a migration of a volume to the storage pool Cloudstack will attempt to create it but this failes with the error in my original comment.
Would need to check if I can attempt to reproduce in a test environment for better steps, but the steps taken were:
After a restart of the Cloudstack agent the storage pool is created in libvirt without issue and migrating works.
harikrishna-patnala commentedon Sep 2, 2025
@BartJM I think that sort of storagepool has to be set in maintenance mode and not in disable state. Can you please try putting that storagepool in maintenance mode and cancelling the maintenance mode will prepare the storage pool in MS in better way ? Ideally I also feel that storagepool should not be added if it is not ready to use.