From fa89dcbf7fa48f8e068c802d335e1250f66b2d42 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 23 Jan 2021 15:48:30 -0700 Subject: [PATCH] create device etc --- eqx-cluster-create | 17 ---------- eqx-create-device | 66 +++++++++++++++++++++++++++++++++++++++ eqx-delete-project-forced | 8 +++-- eqx-get-project-names | 2 +- 4 files changed, 73 insertions(+), 20 deletions(-) delete mode 100755 eqx-cluster-create create mode 100755 eqx-create-device diff --git a/eqx-cluster-create b/eqx-cluster-create deleted file mode 100755 index d6497e1..0000000 --- a/eqx-cluster-create +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# eqx-cluster-create -# -# Create a cluster of bare metal on Equinix -# -# Usage: -# eqx-cluster-create -# Example: -# eqx-cluster-create -# - -set -x - -# - -EQXRANDHOST=`dd bs=12 count=1 if=/dev/random 2>/dev/null | base64 | tr [:upper:] [:lower:] | tr -dc [:alpha:]` - diff --git a/eqx-create-device b/eqx-create-device new file mode 100755 index 0000000..8af427a --- /dev/null +++ b/eqx-create-device @@ -0,0 +1,66 @@ + +# eqx-cluster-create +# +# Create a cluster of bare metal on Equinix. +# Generates random project name if none is given. +# Using existing names will cause issues! +# +# Usage: +# eqx-cluster-create [project name] +# Example: +# eqx-cluster-create foocluster +# eqx-cluster-create +# +# XXX check name isn't in use. + +#set -x + +# Set static variables here +EQXSPOTMAX="0.18" +EQXFACILITY="da11" +EQXOS="debian_10" +EQXPLAN="c3.small.x86" +EQXTAGS="cluster" + +# Probably leave these variables alone +EQXPROJECT="$1" +if [[ $1 == "" ]] + then EQXPROJECT=`eqx-create-project` + else eqx-create-project "$EQXPROJECT" +fi + +EQXHOSTNAME=`dd bs=12 count=1 if=/dev/random 2>/dev/null | base64 | tr [:upper:] [:lower:] | tr -dc [:alpha:]` +EQXPROJECTID=`eqx-get-project-uuid $EQXPROJECT` + +echo "Spot Max: $EQXSPOTMAX" +echo "Project: $EQXPROJECT" +echo "ProjectID: $EQXPROJECTID" +echo "Facility: $EQXFACILITY" +echo "Plan: $EQXPLAN" +echo "Hostname: $EQXHOSTNAME" +echo "OS: $EQXOS" +echo "Tag: $EQXTAGS" + +#cat >> tmpfoo <