Initial commit

This commit is contained in:
Ivaylo Ivanov 2020-03-24 20:10:22 +01:00
commit 2734763189
4 changed files with 84 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
fah.conf
*.ova
*.log

14
README.md Normal file
View File

@ -0,0 +1,14 @@
Folding@Home ovftool deployment script
--------------------------------------
## Introduction
The script is used for deploying the folding@home image supplied by [VMWare](https://flings.vmware.com/vmware-appliance-for-folding-home) on VMWare ESXi (free).
The script is based on the one from [VMWare's GitHub](https://github.com/lamw/vmware-fah-automation).
## Usage
1. In order to use it, you need to have `ovftool` installed.
2. Then, you need to create an `fah.conf` file with the parameters shown in `example.conf`
3. The script will automatically download the ova if not present in the current directory and will deploy it on the remote ESXi host

45
deploy_esxi.sh Executable file
View File

@ -0,0 +1,45 @@
#!/bin/bash
if [ -x "$(command -v ovftool)" ]; then
# Specify the path for ovftool
OVFTOOL_BIN_PATH=$(which ovftool)
# Source the configuration
. fah.conf
FAH_OVA="VMware-Appliance-FaH_${FAH_OVA_VERSION}.ova"
if [ ! -f "${FAH_OVA}" ]; then
# Download OVA if not present
wget "https://download3.vmware.com/software/vmw-tools/VMWare_Folding@Home_Appliance/${FAH_OVA}"
fi
### DO NOT EDIT BEYOND HERE ###
"${OVFTOOL_BIN_PATH}" \
--X:injectOvfEnv \
--powerOn \
--noSSLVerify \
--sourceType=OVA \
--allowExtraConfig \
--diskMode=thin \
--numberOfCpus:*=${FAH_CPU_COUNT} \
--name="${FAH_NAME}" \
--net:"VM Network"="${FAH_NETWORK}" \
--datastore="${FAH_DATASTORE}" \
--prop:guestinfo.ipaddress=${FAH_IP} \
--prop:guestinfo.hostname=${FAH_HOSTNAME} \
--prop:guestinfo.netmask="${FAH_PREFIX}" \
--prop:guestinfo.gateway=${FAH_GW} \
--prop:guestinfo.dns=${FAH_DNS} \
--prop:guestinfo.domain=${FAH_DNS_DOMAIN} \
--prop:guestinfo.ntp=${FAH_NTP} \
--prop:guestinfo.root_password=${FAH_OS_PASSWORD} \
--prop:guestinfo.fah_username=${FAH_USERNAME} \
--prop:guestinfo.fah_passkey=${FAH_PASSKEY} \
--prop:guestinfo.fah_mode=${FAH_MODE} \
--prop:guestinfo.debug=${FAH_DEBUG} \
"${FAH_OVA}" \
"vi://${DEPLOYMENT_TARGET_USERNAME}:${DEPLOYMENT_TARGET_PASSWORD}@${DEPLOYMENT_TARGET_ADDRESS}/"
else
echo 'ERROR: ovftool is not installed.' >&2
exit 1
fi

22
example.conf Normal file
View File

@ -0,0 +1,22 @@
# ESXi settings
DEPLOYMENT_TARGET_ADDRESS="192.168.30.14"
DEPLOYMENT_TARGET_USERNAME="root"
DEPLOYMENT_TARGET_PASSWORD="VMware1!"
FAH_OVA_VERSION="1.0.1"
FAH_NAME="VMWARE-FAH"
FAH_CPU_COUNT="4"
FAH_IP="192.168.30.112"
FAH_HOSTNAME="fah.primp-industries.com"
FAH_PREFIX="24 (255.255.255.0)"
FAH_GW="192.168.30.1"
FAH_DNS="192.168.30.1"
FAH_DNS_DOMAIN="primp-industries.com"
FAH_NTP="pool.ntp.org"
FAH_OS_PASSWORD="VMware1!"
FAH_NETWORK="VM Network"
FAH_DATASTORE="sm-vsanDatastore"
FAH_DEBUG="True"
FAH_USERNAME="lamw"
FAH_PASSKEY="e6cf014f62ba0f60e6cf014f62ba0f60"
FAH_MODE="light"