Skip to content
Snippets Groups Projects
Commit 71b44cc1 authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

Delete servers if exceed limit

parent 4738e994
No related branches found
No related tags found
1 merge request!37Feat maintain five instances running concurrently
......@@ -141,6 +141,11 @@ deploy_knightly:
openstack server add floating ip $NEW_INSTANCE_ID $CAMPUS_IP
openstack server add floating ip $NEW_INSTANCE_ID $CHEAHA_IP
fi
- |
SERVER_TO_BE_DELETE=($(openstack server list --name ood-knightly --sort-column Image --sort-descending -f value -c ID | sed -n $(($NUM_SERVER_TO_KEEP+1))',$p'))
for svr in $SERVER_TO_BE_DELETE; do
openstack server delete ${svr}
done
only:
- schedules
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment