Get the App
SLTechnology News&Howtos  ›  Database  › 

Openstack restore tenant quota

Shulou Source: shulou.com Published: 2022-06-01 22:13:18 09月12日 Update

The day before yesterday, I finally installed the main components of OpenStack. I wanted to create an instance to try the effect. Creating an instance with the minimum configuration failed. Then I debugged left and right. I kept testing to create an instance. I accidentally reached the tenant quota of 10 instances. The system refused to create it again. However, I still can't delete instance from dashboard interface. I have been stuck in deleting state. I am worried to death. The problem of instance creation failure has not been solved yet. This zombie instance problem appears again. I can't delete and debug the new instance.

After some Baidu, Google, finally found a way to delete zombie instances, because my instance was not successfully created, so there is actually no instance data on the compute node, but there are corresponding records in the database, according to the online method, deleted the database entries of related instances. The details are as follows:

Log in to mysql, try nova database, find out the instance id to delete, and then delete

delete from instances where id = '12';

Direct deletion will trigger foreign key restriction errors. You need to temporarily close foreign key checking first.

set foreign_key_checks=0;

delete from instances where id = '12';

Restore foreign key check

set foreign_key_checks=0;

So far, although the instance database data has been deleted, the instance occupancy displayed by the tenant quota still exists, because the relevant database entries during quota check still exist, and the relevant quota limit values need to be updated; after several searches, the relevant quota database entry quota_usages is found. For details, see http://blog.csdn.net/hackerain/article/details/8223125;

View quota_uses resource usage: (example only enables a minimal instance)

Update related resource entries

update quota_usages set in_use=0 where resource = "instances";

update quota_usages set in_use=0 where resource = "ram";

update quota_usages set in_use=0 where resource = "cores";

Open dashboard again, resource quota has been restored, you can continue to create instances.

Tags: Instance data database quota entry resource check tenant minimum zombie situation method problem update limit success careless just actual effect Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno MariaDB NVidia MySQL Apple