summaryrefslogtreecommitdiff
path: root/others/vm3/vm.sh
diff options
context:
space:
mode:
Diffstat (limited to 'others/vm3/vm.sh')
-rw-r--r--others/vm3/vm.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/others/vm3/vm.sh b/others/vm3/vm.sh
new file mode 100644
index 0000000..1072569
--- /dev/null
+++ b/others/vm3/vm.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+
+case "$1" in
+ "compute")
+ shift
+ case "$1" in
+ "create")
+ VM_NAME=$2
+ shift 2
+ while [[ $# -gt 0 ]]; do
+ case "$1" in
+ -vcpu)
+ VCPU=$2
+ shift 2
+ ;;
+ -ram)
+ RAM_GB=$(($2*1000))
+ shift 2
+ ;;
+ -disk)
+ DISK_GB=$2
+ shift 2
+ ;;
+ *)
+ echo "Unknown argument: $1"
+ exit 1
+ ;;
+ esac
+ done
+ ;;
+ *)
+ echo "Unknown compute command: $1"
+ exit 1
+ ;;
+ esac
+ ;;
+ *)
+ echo "Unknown command: $1"
+ exit 1
+ ;;
+esac