You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
eqx/eqx-create-cluster

49 lines
1.1 KiB

4 years ago
#!/bin/bash
# eqx-create-cluster
#
# Create a cluster of devices.
# Will generate random project name, if none given.
#
# Usage:
# eqx-create-cluster [name]
# Example:
# eqx-create-cluster foocluster
# eqx-create-cluster
#
# Number of devices (servers) to create
4 years ago
EQXNODENUM=1
4 years ago
EQXRAND=`dd bs=12 count=1 if=/dev/random 2>/dev/null | base64 | tr [:upper:] [:lower:] | tr -dc [:alpha:]`
EQXPROJECT="$1"
if [[ $1 == "" ]]
then EQXPROJECT=$EQXRAND
fi
echo "Project Name: $EQXPROJECT"
echo "Devices to Create: $EQXNODENUM"
i=0
while [ $i -lt $EQXNODENUM ]
do eqx-create-device "$EQXPROJECT"
let i=$i+1
done
sleep 1
4 years ago
echo
4 years ago
echo "To connect a bare metal console, run:"
4 years ago
# XXX test ed25519 keys
# XXX Set data center
4 years ago
EQXDEVICEID=`eqx-get-project-devices-id $EQXPROJECT | head -1`
echo "ssh -p 22 -i ~/.ssh/id_rsa-eqx $EQXDEVICEID@sos.da11.platformequinix.com"
4 years ago
eqx-get-project-ssh-config "$EQXPROJECT"
eqx-get-project-clusterssh-config "$EQXPROJECT"
4 years ago
echo
echo "To connect to installer, after about 4 minutes, run:"
echo "ssh -p 22 -i ~/.ssh/id_rsa-eqx debian@[IP above]"
echo