Closed xuanyuanaosheng closed 1 year ago
@xuanyuanaosheng which resources do you mean? also please see #7630 , it fixes some of what you describe and might contain clues to what you need.
@xuanyuanaosheng if you want to remove the resources of all the zones you could run the cloudstack-setup-databases
again but this won't delete any resources at the hypervisors.
@rajujith I just want to delete the resources related to one zone.
@DaanHoogland
The resources include the volumes, Primary storage, Secondary storage, Template. and the physical network etc.
In some reason, the hosts and the Storage can not work again, this cause the System VMs can not started and the so I can not delete the resource in this zone.
like:
I can not delete the template using Force delete
so I can not delete the Secondary storage
I can not delete the volumes
so I can not delete the Primary storage
https://github.com/apache/cloudstack/pull/7630
so I can not delete the cluster, pod and zone.
Because there are working zone in cloudstack, So I can not use cloudstack-setup-databases
to init cloudstack.
Please provide a sql scripts to force delete these resources.
@xuanyuanaosheng unfortunately there is no ready to use script delete a specific zone and associated resources to the best of my knowledge.
@rajujith It is so sad to hear about that. I know it is not good to delete a zone this way.
@weizhouapache @DaanHoogland
Is it possible to add a force delete option in the cloudsatck web UI?
Volumes --> Primary storage Template --> Secondary storage Ips --> Physical network
Have any idears?
@xuanyuanaosheng ,
Please specify what action you are taking and what you would expect from it. I have removed zones for the ticket I mentioned without problems but maybe there is a sequence of events, or an extra item in the zone that prevents it for you.
@DaanHoogland
@xuanyuanaosheng it does not sound as the right order to go about it. But as a reparation method you could try and find the right SQLs to delete the remnance. Make sure you backup your DB before trying anything.
You should start at tables like template_store_ref
, volume_store_ref
, snapshot_store_ref
and template_spool_ref
, and work in two directions.
For IPs I think it would not be so hard as the table user_ip_address
has a field for zone. This one is also the table the fix I referred in https://github.com/apache/cloudstack/issues/7715#issuecomment-1619699345 is for.
hope this helps
@DaanHoogland
This situation is indeed strange. Thanks for your reply.
I have done some test on DB level and it works.
Could you please help to look at the issue: https://github.com/apache/cloudstack/issues/7720
I will close this issue
ISSUE TYPE
some zone has been decomission, some resource can not delete because the system vm can not start.
could you please provide a sql scripts to force clear all the related resource of a zone?