You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "nxsbi (via GitHub)" <gi...@apache.org> on 2024/01/19 23:02:40 UTC

[I] Unable to delete old Secondary Storage [cloudstack]

nxsbi opened a new issue, #8540:
URL: https://github.com/apache/cloudstack/issues/8540

   <!--
   Verify first that your issue/request is not already reported on GitHub.
   Also test if the latest release and main branch are affected too.
   Always add information AFTER of these HTML comments, but no need to delete the comments.
   -->
   
   ##### ISSUE TYPE
   <!-- Pick one below and delete the rest -->
    * Bug Report
   
   ##### COMPONENT NAME
   <!--
   Categorize the issue, e.g. API, VR, VPN, UI, etc.
   -->
   ~~~
   UI
   ~~~
   
   ##### CLOUDSTACK VERSION
   <!--
   New line separated list of affected versions, commit ID for issues on main branch.
   -->
   
   ~~~
   4.17.0
   ~~~
   
   ##### CONFIGURATION
   <!--
   Information about the configuration if relevant, e.g. basic network, advanced networking, etc.  N/A otherwise
   -->
   NA
   
   ##### OS / ENVIRONMENT
   <!--
   Information about the environment if relevant, N/A otherwise
   -->
   
   CentOS 7
   ##### SUMMARY
   <!-- Explain the problem/feature briefly -->
   
   I need to retire an old Secondary Storage. I used the "migrate data from image store" option to move everything off. However, I am unable to delete the secondary storage.
   
   ##### STEPS TO REPRODUCE
   <!--
   For bugs, show exactly how to reproduce the problem, using a minimal test-case. Use Screenshots if accurate.
   
   For new features, show how the feature would be used.
   -->
   
   <!-- Paste example playbooks or commands between quotes below -->
   ~~~
   
   In log and on screen I see error - Cannot delete image store with active snapshots backup!
   
   
   I was able to find a similar issue - https://github.com/apache/cloudstack/issues/4613 - but seems it was not resolved. 
   I may be facing similar issue so checked the templates. 
   
   I also see that there are Template present in the old secondary storage. However, I do not see any way to delete the template from the old sec stor only without deleting from entire zone. 
   
   
   What is the correct way to ensure all necessary items are moved/deleted and I am able to delete secondary storage?
   
   
   ~~~
   
   <!-- You can also paste gist.github.com links for larger files -->
   
   ##### EXPECTED RESULTS
   <!-- What did you expect to happen when running the steps above? -->
   
   ~~~
   On Secondary Storage Complete move, all components including templates should be moved and should be able to delete secondary storage.
   
   ~~~
   
   ##### ACTUAL RESULTS
   <!-- What actually happened? -->
   
   <!-- Paste verbatim command output between quotes below -->
   ~~~
   
   Getting error Cannot delete image store with active snapshots backup!
   
   ![image](https://github.com/apache/cloudstack/assets/71042351/5d9b464d-8143-4829-a498-8149fe0a978e)
   
   ~~~
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Unable to delete old Secondary Storage [cloudstack]

Posted by "nxsbi (via GitHub)" <gi...@apache.org>.
nxsbi closed issue #8540: Unable to delete old Secondary Storage
URL: https://github.com/apache/cloudstack/issues/8540


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Unable to delete old Secondary Storage [cloudstack]

Posted by "nxsbi (via GitHub)" <gi...@apache.org>.
nxsbi commented on issue #8540:
URL: https://github.com/apache/cloudstack/issues/8540#issuecomment-1902903059

   Thanks @DaanHoogland. 
   I was able to query the snapshot and snapshot_store_ref and found the offending backups. Turned out these were backups from 2022. However, this may indicate potential bug - because in the snapshot table, those snapshots showed as Destroyed, but in the snapshot_store_ref table, they were "Ready".  So these were not visible from the front end UI at all. 
   
   Now I see another issue 
   
   ![image](https://github.com/apache/cloudstack/assets/71042351/6d7d45f4-eee5-41bc-9089-ae94925c7e68)
   
   I queried the template_store_ref using query below and found that there are 2 entries (updates from 2022)  with state as 'DOWNLOAD_ERROR' 
   - Note I have 3 Secondary Storage at this time - 1 will be retired. 
   
   Whats the right way to clear this issue? 
   
   select * from template_store_ref
    where download_state <> 'DOWNLOADED'
    and store_id = 1 -- this resulted in template id 238 and 253
   
   
   ![image](https://github.com/apache/cloudstack/assets/71042351/cc3be137-e193-42cb-abd7-bf8499705c2c)
   
    
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Unable to delete old Secondary Storage [cloudstack]

Posted by "nxsbi (via GitHub)" <gi...@apache.org>.
nxsbi commented on issue #8540:
URL: https://github.com/apache/cloudstack/issues/8540#issuecomment-1902936646

   Found the solution - I was on the right track here and I found this issue as well https://github.com/apache/cloudstack/issues/7347
   
   My thought is that the code was seeing the "Allocated" status and so not moving forward. I manipulated the metadata with code below and was able to delete the Secondary Storage after this. 
   ```
   
   update template_store_ref
   set DOWNLOAD_state = 'DOWNLOADED',
   state ='Destroyed',
   destroyed = 1
   where template_id in ( 238, 253)
   and store_id = 1;
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Unable to delete old Secondary Storage [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on issue #8540:
URL: https://github.com/apache/cloudstack/issues/8540#issuecomment-1903355798

   nice to see you found a way @nxsbi . Feel free to start a new issue if you have the culprit. I think in this case it the VM may have been deleted and the cleanup not have been complete?
   I think you are right that another bug may been at the root cause of your issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Unable to delete old Secondary Storage [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on issue #8540:
URL: https://github.com/apache/cloudstack/issues/8540#issuecomment-1902695045

   @nxsbi , I think the templates are not the problem, if these are on another secstor as well. Can you check the snapshot with uuid 5d9b464d-8143-4829-a498-8149fe0a978e. If that is on the store it is a valid reason to not allow deleting the store. delting it should allow you to delete the store afterwards.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org