Skip to content

Create template from snapshot parallel allocating same NFS secondary storage on agent #8899

@rp-

Description

@rp-
ISSUE TYPE
  • Bug Report
COMPONENT NAME
Storage
CLOUDSTACK VERSION
4.19.0

But I assume also 4.18 is affected

CONFIGURATION

I could recreate this with Linstor primary storage and the config option: lin.backup.snapshots disabled
I'm not sure yet which other storage combination could be used to trigger this.

OS / ENVIRONMENT

Ubuntu 22.04 non hyperconverged (2 storage nodes, 3 compute nodes (with agents)) setup.

SUMMARY

If I create 2 templates from snapshot (from different snapshots) at nearly the same time and the copy command is sent to the same agent,
both copy commands use the same storage pool object and the 1. finished will try to unmount
the still used storage pool (from the second copy command).
In the worst case the first copy command is finished while the second didn't even start yet to copy, resulting in the second copy command to write into the local mount directory.

STEPS TO REPRODUCE
Do both at the same time, with a primary storage that copies to secondary storage:
* Create a snapshot from volume1.
* Create a snapshot from volume2.

If the copy commands run on the same agent you would see the secondary storage created twice. e.g.:
2024-04-10 12:03:13,081 INFO  [kvm.storage.LibvirtStorageAdaptor] (agentRequest-Handler-1:null) (logid:1ec7c8ad) Attempting to create storage pool e9e15545-fceb-3d76-be34-37dfaf5af384 (NetworkFilesystem) in libvirt
2024-04-10 12:03:13,089 DEBUG [kvm.storage.LibvirtStorageAdaptor] (agentRequest-Handler-1:null) (logid:1ec7c8ad) Attempting to create storage pool e9e15545-fceb-3d76-be34-37dfaf5af384
2024-04-10 12:03:23,319 INFO  [kvm.storage.LibvirtStorageAdaptor] (agentRequest-Handler-4:null) (logid:1fab4dd4) Attempting to create storage pool e9e15545-fceb-3d76-be34-37dfaf5af384 (NetworkFilesystem) in libvirt
2024-04-10 12:03:43,257 INFO  [kvm.storage.LibvirtStorageAdaptor] (agentRequest-Handler-1:null) (logid:1ec7c8ad) Attempting to remove storage pool e9e15545-fceb-3d76-be34-37dfaf5af384 from libvirt
2024-04-10 12:03:48,862 INFO  [kvm.storage.LibvirtStorageAdaptor] (agentRequest-Handler-4:null) (logid:1fab4dd4) Attempting to remove storage pool e9e15545-fceb-3d76-be34-37dfaf5af384 from libvirt

Attached are management and agent logs.
management.log
agent.log

EXPECTED RESULTS
Either running the copy commands in sequence or having a ref counted storage pool, that doesn't remove itself
while still used.

ACTUAL RESULTS
2 storage pool objects created, pointing to the same mount point.
The first finished would unmount the mount point for the other.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions