VM RAM & cores configuration

This commit is contained in:
Sonny 2017-07-09 19:55:08 +02:00
parent f00f9babee
commit 00f4e5ca4e
2 changed files with 23 additions and 8 deletions

View file

@ -14,6 +14,13 @@ create_script() {
exit 1
fi
# VM configuration
read -p "Enter the VM name and press [ENTER]: " NAME
read -p "Enter the port number and press [ENTER]: " PORT
read -p "Enter qemu script's name and press [ENTER]: " FILE
read -p "Enter the amount of RAM [1G/4G]: " RAM
read -p "Enter the number of cores the guest can use [1/4]: " CORES
read -p "Boot disk needed? [y/n]: " ANSWER
if [ "$ANSWER" == "y" ] ;then
read -e -p "Enter the Boot disk path and press [ENTER]: " BOOT_DISK
@ -21,12 +28,6 @@ create_script() {
echo "Okay, dropping boot disk"
fi
read -p "Enter the VM name and press [ENTER]: " NAME
read -p "Enter the port number and press [ENTER]: " PORT
read -p "Enter qemu script's name and press [ENTER]: " FILE
# Creation of script
touch "$HOME/.bin/qemu/$FILE"
chmod +x "$HOME/.bin/qemu/$FILE"
@ -35,9 +36,10 @@ create_script() {
echo -e '#!/bin/bash \n' \
'qemu-system-x86_64 -enable-kvm --daemonize \' '\n' \
'\t -cpu host \' '\n' \
'\t -smp '$CORES' \' '\n' \
'\t -drive format=raw,file='$DISK',if=virtio \' '\n' \
'\t -boot d -cdrom '$BOOT_DISK' \' '\n' \
'\t -m 4G \' '\n' \
'\t -m '$RAM' \' '\n' \
'\t -name '$NAME' \' '\n' \
'\t -vga qxl \' '\n' \
'\t -spice port='$PORT',disable-ticketing \' '\n' \
@ -49,8 +51,9 @@ create_script() {
echo -e '#!/bin/bash \n' \
'qemu-system-x86_64 -enable-kvm --daemonize \' '\n' \
'\t -cpu host \' '\n' \
'\t -smp '$CORES' \' '\n' \
'\t -drive format=raw,file='$DISK',if=virtio \' '\n' \
'\t -m 4G \' '\n' \
'\t -m '$RAM' \' '\n' \
'\t -name '$NAME' \' '\n' \
'\t -vga qxl \' '\n' \
'\t -spice port='$PORT',disable-ticketing \' '\n' \