Add VM metadata and naming
This commit is contained in:
parent
5b1de19cf5
commit
e4039ca7e9
3 changed files with 435 additions and 2 deletions
7
run.sh
7
run.sh
|
|
@ -20,8 +20,9 @@ BR_DEV="br-fc"
|
|||
BR_IP="172.16.0.1"
|
||||
CIDR="24"
|
||||
|
||||
VM_ID="$(date +%s)-$$"
|
||||
VM_TAG="${VM_ID##*-}"
|
||||
VM_ID="$(head -c 32 /dev/urandom | xxd -p -c 256)"
|
||||
VM_TAG="${VM_ID:0:8}"
|
||||
VM_NAME="$(./namegen)"
|
||||
VM_DIR="$STATE/vm-$VM_ID"
|
||||
mkdir -p "$VM_DIR"
|
||||
|
||||
|
|
@ -153,7 +154,9 @@ log "starting virtual machine"
|
|||
|
||||
cat > "$VM_DIR/info" <<EOF
|
||||
vm_id=$VM_ID
|
||||
name=$VM_NAME
|
||||
pid=$FC_PID
|
||||
created_at=$(date -Iseconds)
|
||||
guest_ip=$GUEST_IP
|
||||
tap=$TAP_DEV
|
||||
api_sock=$API_SOCK
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue