All Projects → clayshek → ans-pve-win-templ

clayshek / ans-pve-win-templ

Licence: other
Ansible playbook to create Proxmox Windows VM templates

Programming Languages

Smarty
1635 projects
powershell
5483 projects

Projects that are alternatives of or similar to ans-pve-win-templ

cv4pve-api-php
Proxmox VE Client API for PHP
Stars: ✭ 45 (-8.16%)
Mutual labels:  proxmox, proxmox-ve, pve
cv4pve-api-dotnet
Proxmox VE Client API .Net C#
Stars: ✭ 25 (-48.98%)
Mutual labels:  proxmox, proxmox-ve, pve
ansible role proxmox
Ansible role to provision containers in Proxmox VE virtualization
Stars: ✭ 42 (-14.29%)
Mutual labels:  proxmox, proxmox-ve
cv4pve-pepper
Launching SPICE remote-viewer for Proxmox VE
Stars: ✭ 48 (-2.04%)
Mutual labels:  proxmox, proxmox-ve
proxmox toolbox
A toolbox to get the firsts configurations of Proxmox VE / BS done in no time
Stars: ✭ 158 (+222.45%)
Mutual labels:  proxmox, pve
proxmox-tools
📦 A collection of stuff that I and others wrote for Proxmox 📦
Stars: ✭ 112 (+128.57%)
Mutual labels:  proxmox, proxmox-ve
dab templates
DAB Templates for Proxmox
Stars: ✭ 21 (-57.14%)
Mutual labels:  proxmox, proxmox-ve
freenas-proxmox
ZFS over iSCSI to FreeNAS API's from Proxmox VE
Stars: ✭ 129 (+163.27%)
Mutual labels:  proxmox, proxmox-ve
cv4pve-metrics
Metrics for Proxmox VE, Grafana with dasboard, InfluxDb
Stars: ✭ 38 (-22.45%)
Mutual labels:  proxmox, proxmox-ve
pve-common
Proxmox Project's Common Perl Code
Stars: ✭ 33 (-32.65%)
Mutual labels:  proxmox, proxmox-ve
Proxmox-prepare
Preparing Proxmox VE after installation
Stars: ✭ 15 (-69.39%)
Mutual labels:  proxmox, proxmox-ve
proxmox-ve
Proxmox VE Vagrant Base Box
Stars: ✭ 70 (+42.86%)
Mutual labels:  proxmox, proxmox-ve
ProxmoxVE PHP API
ProxmoxVE PHP API
Stars: ✭ 78 (+59.18%)
Mutual labels:  proxmox, pve
cv4pve-botgram
Telegram Bot for Proxmox VE
Stars: ✭ 26 (-46.94%)
Mutual labels:  proxmox, proxmox-ve
pve exporter
Prometheus exporter for Proxmox VE.
Stars: ✭ 31 (-36.73%)
Mutual labels:  proxmox, proxmox-ve
dns-server-setup
Ansible playbook to easily deploy new, fully configured, DNS servers.
Stars: ✭ 48 (-2.04%)
Mutual labels:  ansible-playbook
anstead
Ansible playbook for Laravel
Stars: ✭ 14 (-71.43%)
Mutual labels:  ansible-playbook
LXD-Cloud
Lightweight server management using LXD and Ansible
Stars: ✭ 19 (-61.22%)
Mutual labels:  ansible-playbook
manjaro-playbook
Manjaro/Arch Linux Ansible provision playbook
Stars: ✭ 25 (-48.98%)
Mutual labels:  ansible-playbook
chatroom
💬chat
Stars: ✭ 56 (+14.29%)
Mutual labels:  ansible-playbook

ans-pve-win-templ

Summary

Ansible playbook to create Windows templates for Proxmox (PVE) based lab environment (somewhat customized for mine, but easy enough to tweak), prepped for further Ansible automation. Tested with Proxmox v6.0.1 & Ansible v2.8.1.

Goals:

  • Create a base Windows Server 2019 template image for Proxmox VE
  • Start with only a base ISO from Microsoft (no other components like MDT necessary)
  • Apply necessary VirtIO drivers (to run on Proxmox/KVM) during Windows Setup
  • Pre-configure Windows image for Ansible to allow for further downstream configuration
  • Apply latest Windows Updates as of image build
  • Allow for minor customization to image via variables passed to either AutoUnattend.xml file, or to qemu provisioner (ex: name, resource specs, admin password, time zone, Windows image version, etc)
  • Sysprep and templatize the image

Usage

  • Modify variables in vars.yml as appropriate
  • Populate proxmox hosts in inventory.yml with the PVE hosts on which to create a template VM. If using shared storage, this only needs to be one host.
  • For secure vars (passwords) in both inventory.yml & vars.yml, as alternative to clear text, use Ansible Vault or pass variables on command line to ansible-playbook.

ansible-playbook -i inventory.yml --ask-vault-pass provision-template.yml

Requirements

  • Windows Server ISO (eval is fine) available to Proxmox node(s). Update 'os_iso_location' in vars.yml to reflect the location of the PVE storage and ISO file name.
  • Additional VirtIO drivers added (/drivers/virtio folder) if necessary. Repo includes VirtIO SCSI, NIC (NetKVM), Balloon drivers and qemu guest agent.
  • Genisoimage installed on Proxmox host (present by default)

Why Not Packer? (And Other Misc Notes)

  • Packer would be ideal solution for this, using the Proxmox builder, which works great for an OS that can be supplied a kickstart config over http, but for Windows, to use the Unattend.xml automated setup capability, there are two issues:

    • Proxmox does not support floppy drives, so using a 2nd ISO / CDROM image is required (also used for VirtIO drivers)
    • The Packer Proxmox builder does not support (at time of writing) adding more than one ISO. Related Github issue.
  • Unable to use Packer, next looked to use Proxmox_KVM Ansible module. However found multiple issues with this, including:

    • Bug related to Proxmox v6 version numbering scheme, which caused outright module failure. The issue & fix are in this pull request, but at time of writing, still open & unmerged. Editing the proxmox_kvm.py as described in PR is a workaround
    • Multiple issues with the module's clone operation, incl: changes OSType back to Linux, does not allow disk resizing, does not allow modifying RAM or CPU resources, does not allow addition of another disk or CDROM, does not allow changes to network interface. Some of these are described in this issue, and this pull request.
    • Issues above, plus a few other minor ones, made using proxmox_kvm module an unattractive option; generally seems like both Packer builder and Ansible module aren't fully developed.
  • Ultimately found solution by using qm command line tool from Ansible command module.

  • There are a couple of 'Start-Sleep' calls in the AutoUnattend.xml file. The method is a bit kludgy, but has been the only reliable method I've found to allow for 2 Windows Updates passes with reboots, and also ensure that the final phase for Sysprep is not interrupted.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].