switch from uuid to vm_id

This commit is contained in:
ghe0 2025-07-20 21:35:31 +03:00
parent dff79b3185
commit 8819e9beae
Signed by: ghe0
GPG Key ID: 451028EE56A0FBB4
6 changed files with 20 additions and 20 deletions

@ -23,7 +23,7 @@ process_vm() {
} >> $config
}
detee-cli vm list | grep uuid | awk '{ print $NF}' |
detee-cli vm list | grep vm_id | awk '{ print $NF}' |
while IFS= read -r vm_id; do
process_vm "$vm_id"
done

@ -7,7 +7,7 @@ set -e
export FORMAT=YAML
detee-cli vm deploy --public-ip --location Any --hostname $hostname > vm_info.tmp
vm_uuid=$(grep 'uuid:' vm_info.tmp | awk '{ print $2 }')
vm_vm_id=$(grep 'vm_id:' vm_info.tmp | awk '{ print $2 }')
vm_ip=$(grep 'ip:' vm_info.tmp | awk '{ print $2 }')
key_path=$(grep 'key_path:' vm_info.tmp | awk '{ print $2 }')
ssh_command="ssh -i ${key_path} -p 22 root@${vm_ip}"
@ -26,6 +26,6 @@ echo "To access gitea, visit http://${vm_ip}:3000/"
echo "For testing, use the database type SQLite. Also, don't forget to set the password for the admin account."
echo
echo "To SSH into the VM, run:"
echo " detee-cli vm ssh ${vm_uuid}"
echo " detee-cli vm ssh ${vm_vm_id}"
echo "The VM will be up for 1 hour (using your LPs). Delete it by running:"
echo " detee-cli vm delete ${vm_uuid}"
echo " detee-cli vm delete ${vm_vm_id}"

@ -12,7 +12,7 @@ rm tmp/vms/*inspect.yaml || true
vms=()
# inspect VMs
for vm_config in $(grep -r uuid: tmp/vms/ | awk '{ print $2}'); do
for vm_config in $(grep -r vm_id: tmp/vms/ | awk '{ print $2}'); do
vm_id=$(echo $vm_config | cut -d '/' -f2 | cut -d '.' -f1)
detee-cli vm inspect $vm_id > tmp/vms/${vm_id}_inspect.yaml
vm_name=$(grep 'hostname: ' tmp/vms/${vm_id}_inspect.yaml |

@ -5,15 +5,15 @@
set -e
export FORMAT=YAML
echo GETTING UUIDs
cali_bastion_uuid=$(grep uuid tmp/cali-bastion-install.yaml)
cali_bastion_uuid=${cali_bastion_uuid#uuid: }
vanc_bastion_uuid=$(grep uuid tmp/vanc-bastion-install.yaml)
vanc_bastion_uuid=${vanc_bastion_uuid#uuid: }
cali_protected_uuid=$(grep uuid tmp/cali-protected-install.yaml)
cali_protected_uuid=${cali_protected_uuid#uuid: }
vanc_protected_uuid=$(grep uuid tmp/vanc-protected-install.yaml)
vanc_protected_uuid=${vanc_protected_uuid#uuid: }
echo GETTING VM IDs
cali_bastion_vm_id=$(grep vm_id tmp/cali-bastion-install.yaml)
cali_bastion_vm_id=${cali_bastion_vm_id#vm_id: }
vanc_bastion_vm_id=$(grep vm_id tmp/vanc-bastion-install.yaml)
vanc_bastion_vm_id=${vanc_bastion_vm_id#vm_id: }
cali_protected_vm_id=$(grep vm_id tmp/cali-protected-install.yaml)
cali_protected_vm_id=${cali_protected_vm_id#vm_id: }
vanc_protected_vm_id=$(grep vm_id tmp/vanc-protected-install.yaml)
vanc_protected_vm_id=${vanc_protected_vm_id#vm_id: }
echo BUILDING SSH COMMANDS
key_path=$(grep 'key_path:' tmp/cali-bastion-install.yaml | awk '{ print $2 }')
@ -31,10 +31,10 @@ ssh_vanc_protected="ssh -i ${key_path} \
root@$(grep ip tmp/vanc-protected-install.yaml | awk '{ print $2 }')"
echo INSPECTING VMs
detee-cli vm inspect $cali_bastion_uuid > tmp/cali-bastion-inspect.yaml
detee-cli vm inspect $vanc_bastion_uuid > tmp/vanc-bastion-inspect.yaml
detee-cli vm inspect $cali_protected_uuid > tmp/cali-protected-inspect.yaml
detee-cli vm inspect $vanc_protected_uuid > tmp/vanc-protected-inspect.yaml
detee-cli vm inspect $cali_bastion_vm_id > tmp/cali-bastion-inspect.yaml
detee-cli vm inspect $vanc_bastion_vm_id > tmp/vanc-bastion-inspect.yaml
detee-cli vm inspect $cali_protected_vm_id > tmp/cali-protected-inspect.yaml
detee-cli vm inspect $vanc_protected_vm_id > tmp/vanc-protected-inspect.yaml
echo GETTING WIREGUARD IP AND PORTS
cali_wg_ip=$(grep 'ip: ' tmp/cali-bastion-install.yaml)

@ -4,7 +4,7 @@ hostname: vanc-bastion
hours: 5
price: 1000
location:
city: "Montréal"
country: "CA"
ipv4: !PublishPorts [ 1337 ]
public_ipv6: false
vcpus: 2

@ -4,7 +4,7 @@ hostname: vanc-protected
hours: 5
price: 1000
location:
city: "Montréal"
country: "CA"
ipv4: !PublishPorts [ ]
public_ipv6: false
vcpus: 2