Skip to content

Wrong local primary storage is added on host maintenance/restart #10616

Open
@akrasnov-drv

Description

@akrasnov-drv

problem

I enabled local storage for guest VMs.
When I place a host to maintenance, or if I just restart a host (without maintenance), CloudStack creates additional local storage instances with names hostname-local-random
In virsh I see just 1 pool corresponding to local storage but in primary storage in UI I see several.
If I try to start a VM on such a host, CS fails to deploy VM because it does not find local storage.
Another rather strange thing, is that if I put to maintenance wrong storage (intending to remove it), I see in virsh pool name changes to the one specified in disabled (still single local pool but with another name).
It happens also for empty pools and hosts without any VM.

versions

CloudStack 4.20.0.0
Ubuntu 22.04.5 LTS
QEMU 1:6.2+dfsg-2ubuntu6.24
libvirt 8.0.0-1ubuntu7.10
local storage for guests is enabled

The steps to reproduce the bug

1.Enable local storage for guests
2.Add host(s)
3.Ensure local primary storage was created for each host
4.Place host to maintenance / restart
5. After host is back check that there are 2 or more primary storage IDs are in primary storage list for the same host
6. Check that there is only 1 virsh pool corresponding to 1 of primary storage instances
7. Disable some of non-existing pools and see that virsh pool was renamed
...

What to do about it?

To workaround this, after restart/maintenance I have to disable all existing local storage for a host, then enable 1 really existing, and then remove all others.
Cloudstack should not keep/add non-existing local storage. At least it should not affect VM deployment (CS should try to use the proper one)
Adding local.storage.uuid to agent config did not help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions