mirror of
https://github.com/Noratrieb/vmlab.git
synced 2026-01-16 01:25:09 +01:00
try things
This commit is contained in:
parent
9e5ec91834
commit
f6c4997f01
4 changed files with 33 additions and 0 deletions
26
create-vms.sh
Normal file
26
create-vms.sh
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
set -eu
|
||||
|
||||
NAME="$1"
|
||||
|
||||
mkdir -p tmp
|
||||
mkdir -p vm-state
|
||||
|
||||
IMG=debian-12-genericcloud-amd64.qcow2
|
||||
|
||||
if ! [ -f "tmp/$IMG" ]; then
|
||||
curl -L -o "tmp/$IMG" https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-amd64.qcow2
|
||||
fi
|
||||
|
||||
DISK="vm-state/$NAME.qcow2"
|
||||
cp "tmp/$IMG" "$DISK"
|
||||
|
||||
virt-install -n "$NAME" \
|
||||
--os-variant=debian12 \
|
||||
--ram=2048 --vcpus=2 \
|
||||
--import --disk "path=$DISK,bus=virtio" \
|
||||
--network network=default,model=virtio \
|
||||
--graphics=none --rng /dev/urandom \
|
||||
--cloud-init=user-data=user-data
|
||||
#--noautoconsole
|
||||
Loading…
Add table
Add a link
Reference in a new issue