Description of problem:
currently, a project that has an instance (or instances) can be deleted without even a warning message in the Horizon by a user with an administrative permissions. An active project (meaning a project that has instances running) should have the protection from deletion. If the administrator would like to delete it he should delete the instances first.
Version-Release number of selected component (if applicable):
openstack-nova-cert-2013.2.2-2.el6ost.noarch
python-novaclient-2.15.0-2.el6ost.noarch
openstack-nova-common-2013.2.2-2.el6ost.noarch
openstack-nova-api-2013.2.2-2.el6ost.noarch
openstack-nova-compute-2013.2.2-2.el6ost.noarch
openstack-nova-conductor-2013.2.2-2.el6ost.noarch
openstack-nova-novncproxy-2013.2.2-2.el6ost.noarch
openstack-nova-scheduler-2013.2.2-2.el6ost.noarch
python-nova-2013.2.2-2.el6ost.noarch
openstack-nova-console-2013.2.2-2.el6ost.noarch
openstack-nova-network-2013.2.2-2.el6ost.noarch
How reproducible:
100%
Steps to Reproduce:
1. Create an new project.
2. Launch one (or more) instances.
3. Try to delete the project with the admin.
Actual results:
The instances are still running, but they are accessible only through the admin -> intances tab.
Expected results:
The administrator shouldn't be able to delete the project as long as there are instances running.
Hi Folks:
After discussing this with one of the Keystone core developers, it seems that the preferred approach would be something like the following:
1. Horizon warns on project delete for projects with active instances, but allows it (upon confirm)
2. Keystone notification driver sends notification out to the Queue regarding the project delete
3. Nova listens for these notifications and acts upon them in a configurable manner, doing one of the following:
- deleting all instances in the project
- migrating instances on the deleted project to another project
- nothing
It seems to make sense to do the bulk of the processing within Nova. Attempting to have Horizon delete a non-trivial number of VMs as part of project delete could take a considerable amount of time (imagine deleting a project with thousands of VMs!).