apache / cloudstack

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

Unable to delete Secondary Storage #9737

Open top-secrett opened 4 weeks ago

top-secrett commented 4 weeks ago
ISSUE TYPE
CLOUDSTACK VERSION
4.19.1.0
OS / ENVIRONMENT

Oracle Linux 8

SUMMARY

I added second secstore to one zone, and some images and templates were copied to it automatically. Now I want to delete it and an error occurs. There is no any mechanism in Cloudstack for removing templates from specific secstore or forcibly deleting a secstore. Of course I can modify some records in DB like in https://github.com/apache/cloudstack/issues/8540 https://github.com/apache/cloudstack/issues/7347 but it's not a solution

image Templates on this secstore image Some of them are downloaded, some are not. image image

top-secrett commented 3 weeks ago

Now the error looks like this image

DaanHoogland commented 3 weeks ago

@top-secrett , clearing the secondary storage for removal should definately be easier. This is probably going to give similar issues with ISOs as well and maybe volumes as well. the respective data links need to be cleared to be able to remove the secstore...

What did you do to get to this second phase (I imagine removing templates from the zone)?

top-secrett commented 3 weeks ago

@DaanHoogland the only thing I did pdate snapshots SET status="Destroyed" where id=576; to remove stucked snapshots in db

DaanHoogland commented 3 weeks ago

@top-secrett you also need to look at snapshot_store_ref. These direct DB operations are a bit dangerous. also you need to set removed = now() maintaining secstores is not well supported, we really need to look at that.