Commit b1fb7cf7 authored by Stavros Sachtouris's avatar Stavros Sachtouris

Delete servers even when they have networks

parent 6a2f35f4
......@@ -231,11 +231,13 @@ function_map = {
'get_flavor': snf_get_flavor,
'get_images': snf_get_images,
'get_image': snf_get_image,
'get_floating_ip_pools': empty_list_200,
'get_server_volumes_link': snf_get_server_volumes_link,
'_get_ports': snf_get_server_net_attachments,
'delete': snf_delete_server,
'create_server': snf_create_server,
'run_action': snf_run_action,
'keypair_create': keypair_register
'keypair_create': keypair_register,
# TODO: Implement these when you do networks
'get_floating_ips': empty_list_200, # Helps in server delete
'get_floating_ip_pools': empty_list_200,
}
......@@ -89,7 +89,7 @@ echo
echo "Create a server instance"
echo "Meaning: kamaki server create --name \"OCCI test VM\" \\"
echo " --flavor-id <ID of c2r2048d40drb> --image-id <ID of ${OS_TPL}>"
echo " --flavor-id ${RESOURCE_TPL} --image-id ${OS_TPL}"
CMD="${BASE_CMD} --action create --resource compute "
CMD="${CMD} --attribute occi.core.title=\"OCCI test VM\""
CMD="${CMD} --mixin os_tpl#${OS_TPL} --mixin resource_tpl#${RESOURCE_TPL}"
......@@ -174,16 +174,8 @@ else
eval $ACMD
echo
WAIT=5;
while [ $STATE == 'active' ]
do
echo "Server state is ${STATE}, wait ${WAIT}\" and check again"
sleep $WAIT;
let "WAIT++";
eval $CMD;
STATE=(`awk '/occi.compute.state/{n=split($0,a," = "); print a[2];}' ${VM_INFO}`);
done;
echo "Server state is $STATE"
sleep 10
WAIT=5;
while [ $STATE != 'active' ]
do
......@@ -198,9 +190,9 @@ else
echo "Destroy server instance ${SUFFIX}";
echo "Meaning: kamaki server delete ${SERVER_URL}";
CMD="${BASE_CMD} --action delete --resource ${SUFFIX}";
echo "$CMD";
eval $CMD;
ACMD="${BASE_CMD} --action delete --resource ${SUFFIX}";
echo "$ACMD";
eval $ACMD;
WAIT=5;
while [ $STATE == 'active' ]
......@@ -236,7 +228,7 @@ echo
echo "Create a server instance with PPK"
echo "Meaning: kamaki server create --name \"OCCI test VM\" \\"
echo " --flavor-id ${RESOURCE_TPL} --image-id ${OS_TPL} \\"
echo " -p (`pwd`)/id_rsa.pub,/root/.ssh/authorized_keys,root,root,0600"
echo " -p `pwd`/id_rsa.pub,/root/.ssh/authorized_keys,root,root,0600"
CMD="${BASE_CMD} --action create --resource compute"
CMD="${CMD} --attribute occi.core.title=\"OCCI test VM\""
CMD="${CMD} --mixin os_tpl#${OS_TPL} --mixin resource_tpl#${RESOURCE_TPL}"
......
......@@ -17,7 +17,7 @@ from ooi.wsgi import OCCIMiddleware
from ooi.api.helpers import OpenStackHelper
from soi.config import KEYSTONE_URL
from soi.synnefo import AstakosClient, AUTH_URL
from soi import utils, compute, storage, storage_link
from soi import utils, compute, storage, storage_link, network
from kamaki.clients import ClientError
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment