Browse Source

Modified launch script. (#32)

chmod ~/.ssh/id_microstack so that we don't get errors.

Reordered the way we setup security groups so that everything is overall faster.
configure-hook
Pete Vander Giessen 3 years ago
committed by GitHub
parent
commit
92fc5c1ec5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      src/launch/launch.sh

10
src/launch/launch.sh

@ -14,8 +14,12 @@ if [[ ! $(microstack.openstack keypair list | grep "| microstack |") ]]; then
mkdir -p $HOME/.ssh
chmod 700 $HOME/.ssh
microstack.openstack keypair create microstack >> $HOME/.ssh/id_microstack
chmod 600 $HOME/.ssh/id_microstack
fi
echo "Launching instance ..."
microstack.openstack server create --flavor m1.tiny --image cirros --nic net-id=test --key-name microstack $SERVER
echo "Checking security groups ..."
SECGROUP_ID=`microstack.openstack security group list --project admin -f value -c ID`
if [[ ! $(microstack.openstack security group rule list | grep icmp | grep $SECGROUP_ID) ]]; then
@ -28,17 +32,13 @@ if [[ ! $(microstack.openstack security group rule list | grep tcp | grep $SECGR
microstack.openstack security group rule create $SECGROUP_ID --proto tcp --dst-port 22
fi
echo "Launching instance ..."
microstack.openstack server create --flavor m1.tiny --image cirros --nic net-id=test --key-name microstack $SERVER
echo "Allocating floating ip ..."
ALLOCATED_FIP=`microstack.openstack floating ip create -f value -c floating_ip_address external`
microstack.openstack server add floating ip $SERVER $ALLOCATED_FIP
echo "Waiting for server to launch."
echo "Waiting for server to become ACTIVE."
while :; do
if [[ $(microstack.openstack server list | grep $SERVER | grep ACTIVE) ]]; then
echo "Launch complete!"
microstack.openstack server list
echo "Access your server with 'ssh -i $HOME/.ssh/id_microstack cirros@$ALLOCATED_FIP'"
break

Loading…
Cancel
Save