From be3dde6ce14698c5818f21f65037a4beef1199cf Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 21 Dec 2024 15:11:19 +0800 Subject: betavm3 --- others/vm3/vm.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 others/vm3/vm.sh (limited to 'others/vm3/vm.sh') 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 -- cgit v1.2.3-70-g09d2