From c086bcdc7f6bab7758604a5c7a563816005e0d7f Mon Sep 17 00:00:00 2001 From: phil Date: Fri, 26 Jan 2024 00:08:14 +0100 Subject: [PATCH] mkvm : gere memoire VM --- scripts/mkvm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/mkvm b/scripts/mkvm index fc8a017..7b19bf7 100755 --- a/scripts/mkvm +++ b/scripts/mkvm @@ -1,6 +1,6 @@ #!/bin/bash -mkvmrelease="v1.3.2" +mkvmrelease="v1.3.3" ovarelease="2023c" ovafogrelease="2024a" @@ -10,10 +10,18 @@ ovafilefog="$HOME/Téléchargements/debian-bullseye-gsb-${ovafogrelease}.ova" startmode=0 deletemode=0 +declare -A vmMem +vmMem[r-int]=512 +vmMem[r-ext]=512 +vmMem[s-nas]=512 +vmMem[s-infra]=768 +vmMem[s-backup]=768 +vmMem[s-elk]=3072 + usage () { echo "$0 - version ${mkvmrelease} - Ova version ${ovarelease}" echo "$0 : creation VM et parametrage interfaces" - echo "usage : $0 [-r] [-s] " + echo "usage : $0 [-r] [-s] " echo " option -r : efface VM existante avant creation nouvelle" echo " option -s : start VM apres creation" exit 1 @@ -33,6 +41,10 @@ create_vm () { VBoxManage unregistervm --delete "${nom}" fi vboxmanage import "${nomova}" --vsys 0 --vmname "${nom}" + if [[ -v vmMem["${nom}" ]]; then + mem=vmMem["${nom}"] + VBoxManage modifyvm "${nom}" --memory "${mem}" + fi } setif () {