GitHub user DaanHoogland added a comment to the discussion: removing secondary 
storage: Cannot delete image store with active templates backup

@sbrueseke at the moment the following checks are done:

```
        // Verify that there are no live snapshot, template, volume on the image
        // store to be deleted
        List<SnapshotDataStoreVO> snapshots = 
_snapshotStoreDao.listByStoreId(storeId, DataStoreRole.Image);
        if (snapshots != null && snapshots.size() > 0) {
            throw new InvalidParameterValueException("Cannot delete image store 
with active snapshots backup!");
        }
        List<VolumeDataStoreVO> volumes = 
_volumeStoreDao.listByStoreId(storeId);
        if (volumes != null && volumes.size() > 0) {
            throw new InvalidParameterValueException("Cannot delete image store 
with active volumes backup!");
        }

        // search if there are user templates stored on this image store, 
excluding system, builtin templates
        List<TemplateJoinVO> templates = 
_templateViewDao.listActiveTemplates(storeId);
        if (templates != null && templates.size() > 0) {
            throw new InvalidParameterValueException("Cannot delete image store 
with active templates backup!");
        }
```
so no, you can not delete an secstror if it contains templates (or ISOs) or 
Volume - or snapshot backups. 

I think what you need is an API call (or extra parameter) to remove a item from 
a specific store.

I think at the moment a snapshot can only be deleted from a zone, not form a 
specific store: 
https://cloudstack.apache.org/api/apidocs-4.20/apis/deleteSnapshot.html

GitHub link: 
https://github.com/apache/cloudstack/discussions/10622#discussioncomment-12637941

----
This is an automatically sent email for users@cloudstack.apache.org.
To unsubscribe, please send an email to: users-unsubscr...@cloudstack.apache.org

Reply via email to