-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmk_vm
More file actions
executable file
·48 lines (31 loc) · 1.02 KB
/
mk_vm
File metadata and controls
executable file
·48 lines (31 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
#Command that creates virtual machines, prompted.
#run as sudo
#Just collecting information
echo ""
echo -e "Welcome to the KVM VM creator tool!\n"
read -p "VM name: " vm_name
read -p "Allocated memory (Mb): " vm_mem
read -p "Allocated vcpus: " vm_cpu
read -p "Would you like to run the VM off a SSD of HDD? " drive_speed
#vm_path is dependent on drive_speed variable.
if [[ $drive_speed = "SSD" ]] || [[ $drive_speed = "ssd" ]]; then
vm_path=/home/ssd_store/
elif [[ $drive_speed = "HDD" ]] || [[ $drive_speed = "hdd" ]]; then
vm_path=/mnt/sdb/vm_store/
else
echo "Option not available!"
fi
read -p "Disk size (Gb): " vm_disk
read -p "OS, or press "l" for a list od avilable images: " os_type
if [[ $os_type == "l" ]]; then
#TODO: need to create a system that will show available ISOs
echo $vm_name
echo $vm_mem
echo $vm_cpu
echo $drive_speed
echo $vm_path
#read -p "Disk size: " vm_disk
#read -p "Path to ISO: " vm_iso
#echo "Network default: br0, press f if you'd like to change to default"
#echo "graphics = vnc"