install-vm.sh¶
Creates a VM on Proxmox using a module's JSON configuration. This is a library script meant to be sourced by module install scripts.
Usage¶
Source this file in module install scripts:
What it does¶
- Sources
copy-update-json.shto copy the module JSON to config - Sources
common-install-routines.shto load config functions - Validates the JSON configuration
- Copies the JSON to the target Proxmox node
- Calls
Create-TAPPaaS-VM.shon the node to create the VM - Cleans up the temporary JSON file on the node
Exported variables after sourcing¶
VMNAME- VM name from configurationVMID- VM ID from configurationNODE- Proxmox node where VM is createdZONE0NAME- Primary network zone
Example module install.sh¶
#!/bin/envbash
set -euo pipefail
# Create the VM
. /home/tappaas/bin/install-vm.sh
# Get additional config values
IMAGE_TYPE="$(get_config_value 'imageType' 'clone')"
# Run post-install steps
/home/tappaas/bin/update-os.sh "${VMNAME}" "${VMID}" "${NODE}"
See Also¶
- update-os.sh - Update VM operating system
- common-install-routines.sh - Shared library functions