Compare commits

...

3 Commits

Author SHA1 Message Date
tteckster b1451e795e
Update CHANGELOG.MD 2023-04-02 11:28:39 -04:00
tteckster 49263e9874
Update haos-vm.sh
Include a choice within the "Advanced" settings to configure the CPU model between kvm64 (default) or host.
2023-04-02 11:26:00 -04:00
tteckster a2b5ce070d
Update haos-vm.sh
tweak
2023-04-02 08:48:09 -04:00
2 changed files with 29 additions and 3 deletions

View File

@ -2,12 +2,19 @@
# Change Log
All notable changes to this project will be documented in this file.
## 2023-04-02
### Changed
- **Home Assistant OS VM**
- Include a choice within the "Advanced" settings to configure the CPU model between kvm64 (default) or host.
## 2023-03-31
### Changed
- **Home Assistant OS VM**
- Include a choice within the "Advanced" settings to configure the disk cache.
- Include a choice within the "Advanced" settings to configure the disk cache between none (default) or Write Through.
## 2023-03-27

View File

@ -116,7 +116,7 @@ function ssh_check() {
fi
}
exit-script() {
function exit-script() {
clear
echo -e "⚠ User exited script \n"
exit
@ -129,6 +129,7 @@ function default_settings() {
MACHINE=""
DISK_CACHE=""
HN="haos$stable"
CPU_TYPE=""
CORE_COUNT="2"
RAM_SIZE="4096"
BRG="vmbr0"
@ -141,6 +142,7 @@ function default_settings() {
echo -e "${DGN}Using Machine Type: ${BGN}i440fx${CL}"
echo -e "${DGN}Using Disk Cache: ${BGN}Default${CL}"
echo -e "${DGN}Using Hostname: ${BGN}${HN}${CL}"
echo -e "${DGN}Using CPU Model: ${BGN}Default${CL}"
echo -e "${DGN}Allocated Cores: ${BGN}${CORE_COUNT}${CL}"
echo -e "${DGN}Allocated RAM: ${BGN}${RAM_SIZE}${CL}"
echo -e "${DGN}Using Bridge: ${BGN}${BRG}${CL}"
@ -150,6 +152,7 @@ function default_settings() {
echo -e "${DGN}Start VM when completed: ${BGN}yes${CL}"
echo -e "${BL}Creating a HAOS VM using the above default settings${CL}"
}
function advanced_settings() {
if BRANCH=$(whiptail --title "HAOS VERSION" --radiolist "Choose Version" --cancel-button Exit-Script 10 58 3 \
"$stable" "Stable " ON \
@ -225,6 +228,21 @@ function advanced_settings() {
exit-script
fi
if CPU_TYPE1=$(whiptail --title "CPU MODEL" --radiolist "Choose" --cancel-button Exit-Script 10 58 2 \
"0" "KVM64 (Default)" ON \
"1" "Host" OFF \
3>&1 1>&2 2>&3); then
if [ $CPU_TYPE1 = "1" ]; then
echo -e "${DGN}Using CPU Model: ${BGN}Host${CL}"
CPU_TYPE=" -cpu host"
else
echo -e "${DGN}Using CPU Model: ${BGN}Default${CL}"
CPU_TYPE=""
fi
else
exit-script
fi
if CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 2 --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
if [ -z $CORE_COUNT ]; then
CORE_COUNT="2"
@ -329,6 +347,7 @@ arch_check
pve_check
ssh_check
start_script
msg_info "Validating Storage"
while read -r line; do
TAG=$(echo $line | awk '{print $1}')
@ -394,7 +413,7 @@ for i in {0,1}; do
done
msg_ok "Extracted KVM Disk Image"
msg_info "Creating HAOS VM"
qm create $VMID -agent 1${MACHINE} -tablet 0 -localtime 1 -bios ovmf -cores $CORE_COUNT -memory $RAM_SIZE \
qm create $VMID -agent 1${MACHINE} -tablet 0 -localtime 1 -bios ovmf${CPU_TYPE} -cores $CORE_COUNT -memory $RAM_SIZE \
-name $HN -net0 virtio,bridge=$BRG,macaddr=$MAC$VLAN$MTU -onboot 1 -ostype l26 -scsihw virtio-scsi-pci
pvesm alloc $STORAGE $VMID $DISK0 4M 1>&/dev/null
qm importdisk $VMID ${FILE%.*} $STORAGE ${DISK_IMPORT:-} 1>&/dev/null