apache / cloudstack

Apache CloudStack is an opensource Infrastructure as a Service (IaaS) cloud computing platform
https://cloudstack.apache.org/
Apache License 2.0
2.09k stars 1.11k forks source link

Linstor primary storages are not created for disabled hosts #8393

Open rajujith opened 10 months ago

rajujith commented 10 months ago
ISSUE TYPE
COMPONENT NAME
primary storage
Linstor
CLOUDSTACK VERSION
4.18.1
CONFIGURATION

Linstor

OS / ENVIRONMENT
SUMMARY

When adding a linstor primary storage it not added for disabled host i.e missing the entries in the table 'storage_pool_host_ref'. Once the host is enabled later the host can't be used to deploy to this primary storage. The issue appears likewise when a host is added when a linstor primary storage is disabled.

STEPS TO REPRODUCE
1. Disable a host in a cluster
2. Add a linstor primary storage 
3. Check the table storage_pool_host_ref or enable the host and try a new instance deployment ( check the logs to confirm) or use tags to force it. 
EXPECTED RESULTS
Disabled host/primary storage needs to be considered while adding host/primary storage.
DaanHoogland commented 10 months ago

@rp- are you aware? can you triage this?

rp- commented 10 months ago

From what I tested this isn't restricted to Linstor, this affects all primary storage driver (or at least, CloudStackPrimary.., Linstor, StorPool, ...)

And I think it is caused by filtering for enabled hosts while attaching the storage pool: List<HostVO> hosts = _resourceMgr.listAllUpAndEnabledHostsInOneZoneByHypervisor(hypervisorType, scope.getScopeId());

I also noticed, that restarting the managment server, will add missing storage_pool_host_ref entries (as long as the hosts are enabled then)

DaanHoogland commented 9 months ago

@rp- @rajujith is there anything to do on this, or do we live with the workaround?

rp- commented 9 months ago

From what I saw, this would need to be fixed for all primary storages. But I'm not sure if we would want to add primary storages while the are disabled? or If there should be some functionality/hook that would add missing storages while enabling the host again...

From my point of view, the workaround is probably good enough for now ;)

DaanHoogland commented 9 months ago

From my point of view, the workaround is probably good enough for now ;)

@rajujith ?

rajujith commented 9 months ago

@DaanHoogland It's good to have a workaround but it breaks the consistency if not fixed, for non-managed primary storages it is added for disabled hosts as well.

DaanHoogland commented 9 months ago

@DaanHoogland It's good to have a workaround but it breaks the consistency if not fixed, for non-managed primary storages it is added for disabled hosts as well.

cc @rp-