capo fails to clean up after failed VM creation
Created by: garloff
When creating a cluster (create_cluster.sh testcluster aka kubectl apply testcluster-config.yaml) and capo fails to the control node VM(s), e.g. due to being out of quota or a having a wrongly specified flavor name, it does not succeed in cleaning up the cluster again with delete_cluster.sh testcluster (aka kubectl delete cluster testcluster). Parsing the capo logs, one can see that the security group can not be deleted due to being in use. Further analysis shows that the port that has been allocated for the control node is not removed again, thus the sec group does not get deleted nor the subnet nor the network nor the router.
This is likely a capo bug that should be analyzed and reported upstream.
Identifying the port manually (openstack port list --fixed-ip subnet=$SUBNETIDOFCLUSTER
) and deleting it does bring capo back into track and it cleans up the rest.
If the upstream capo fixing turns out to be a lengthy process, we might do a bit of work to recognize the issue when it occurs and delete this port from the delete_cluster.sh script.