Deploying Windows Hosts
This usage guide helps you deploy hosts running Microsoft Windows. orcharhino can deploy hosts running Windows 10, Windows 11, Windows Server 2016, Windows Server 2019, and Windows Server 2022.
Prerequisites and Used Tools
You require the following tools and files to create an installation media for windows:
-
local machine running Microsoft Windows with Powershell 5.1 or newer
-
Windows ISO
-
ipxe.lkrn
from boot.ipxe.org/ipxe.lkrn -
WIMan from github.com/UXabre/WIMan
-
VMware Drivers which can be extracted from the VMware Tools
-
properly configured compute resource
-
properly configured compute profile
Extracting VMware Drivers
-
Download the VMware tools and open the
.iso
file in a virtual drive. -
Create a directory, for example
C:\Extract
, where you want to extract the VMware tools into. -
Open a Powershell and change into the virtual drive.
-
Run
.\setup.exe /A /P C:\Extract
with the last parameter being the directory you have extracted the VMware tools into. -
Follow the installation through the GUI and set the installation path to the second path. You find the required drivers in
C:\Extract\VMware\VMware Tools\VMware\Drivers
as defined in the second step.
Creating a Windows Image
-
Clone the
https://github.com/UXabre/WIMan.git
repository to your local machine running Windows. -
Navigate to the local git repository and create a folder under
sources\amd64\
for each operating system. There is already a directory for Windows Server 2016. -
Copy the
.iso
file of the operating system to the corresponding folder. -
Create a directory called
drivers
underwinpe
and copy the VMware drivers into it. -
Open a Powershell with administrator privileges and navigate to the local git repository.
-
Create Windows image using the following command:
.\GenerateWIM.ps1
TFTP Extension
orcharhino requires ipxe.lkrn
to be present in the TFTP directory to boot hosts running Windows.
-
Download this file from boot.ipxe.org/ipxe.lkrn.
-
Copy
ipxe.lkrn
usingscp
from your local machine toroot@orcharhino.example.com:/var/lib/tftpboot/
.
Uploading ISO File
To create an installation media, you must first upload the .iso
file to your orcharhino instance and then create an installation media entry.
-
Copy the directory
{local git repository}\finalized\amd64\{version}
to your orcharhino to/var/www/html/pub/installation_media/windows/{version}
. -
Copy the directory
{local git repository}\winpe\drivers
to your orcharhino to/var/www/html/pub/installation_media/windows/{version}
.You can freely choose the directory structure after
/var/www/html/pub/
.
You can now reach the files over HTTP, for example http://orcharhino.example.com/pub/installation_media/windows/2016/
.
Creating an Installation Medium Entry
Navigate to Hosts > Installation Media and click the Create Medium button.
-
Enter a Name (1).
-
Enter the Path (2) to the installation media on your orcharhino.
The path must start with
http
. Provisioning over HTTPS is not supported. -
Select
Windows
from the Operating System Family drop down menu (3). -
Optional: Select an organization and location context.
-
Click Submit (4) to save your input to orcharhino.
Creating an Operating System Entry
Navigate to Hosts > Operating Systems and click the Create Operating System button.
-
Enter a Name (1).
-
Enter the Major Version (2) for your Windows host. This example uses Windows Server 2016, which makes the major version
2016
. -
Leave the Minor Version field (3) empty.
-
Optional: Add a Description (4).
-
Select the Family (5) of the operating system, that is Windows.
-
Select the Root Password Hash (6), that is Base64-Windows.
-
Select the Architectures (7).
Associate the partition table on the Partition Table tab:
-
Select the Windows Default Partition Table.
If the partition table does not appear in the list, ensure it is associated to the proper organization and location context.
Add the previously created installation media entry for Windows Server 2016 local
in the Installation Media tab:
-
Select the Windows Server 2016 local installation media.
Create the following parameters on the Parameters tab:
-
Add the
wimImageName
parameter of typestring
and valueWindows Server 2016 SERVERSTANDARD
.You can find the proper
ImageName
for each operating system in theimages.ini
file. The file is located at{local git repository}\finalized\amd64\2016\sources\
.
Click the Submit button to save the operating system entry to orcharhino.
Creating an Architecture Entry
Create an architecture with the name x86_64
if it is not already present.
-
Navigate to Hosts > Architectures.
-
Click the Create Architecture button.
-
Enter the name
x86_64
. -
Associate it to the previously created operating system entry.
Associating Provisioning Templates
Associate the provisioning templates to the newly created operating system entry for Windows.
-
Navigate to Hosts > Provisioning Templates.
-
Repeat the following procedure for each template:
-
Select the
Windows default finish
template and navigate to the Association tab. -
Select the newly created operating system entry for Windows and associate it with the provisioning template.
If a template does not appear in the list of provisioning template, ensure it is associated to the proper organization and location context.
-
Creating a Host Group
Navigate to Configure > Host Groups and click the Create Host Group button.
Enter a name and set the deploy on and compute profile options.
-
Select the Architecture (1).
-
Select the previously created Operating System (2).
-
Choose All Media from the Media Selection menu (3).
-
Select the previously created Media (4).
-
Select the
Windows Default Partition Table
Partition Table (5). -
In the PXE loader (6) drop down menu, select the
PXELinux BIOS
item. -
Optional: Set a Root Password (7). If empty, each host must receive a root password ahead of provisioning.
-
Click Submit (8) to create a host group. Settings on other tabs are optional.
Deploying Windows Hosts
-
Navigate to Hosts > Create Hosts and click Create Host.
-
Select the previously created host group for Windows
-
Adjust other settings as necessary.
-
Click Submit.
You can now deploy virtual machines running Windows both boot disk based as well as network based. You can use static IP addresses when deploying hosts using boot disk.
Additionally, you can deploy image based hosts on VMware for which you need to create an image using the VMware tools and the Windows user data template.
Optional Host Parameters
You can optionally set the following parameters when provisioning hosts:
Variable | Default Value | Note |
---|---|---|
ansible_become |
boolean set to false |
|
ansible_become_method |
string set to |
|
ansible_connection |
string set to |
|
ansible_port |
Ports to access hosts through Ansible ( |
|
ansible_ssh_pass |
Password to access hosts through Ansible |
|
ansible_user |
User account to access hosts through Ansible; defaults to |
|
ansible_winrm_enable_http |
If you use ansible_port |
|
ansible_winrm_enable_unencrypted |
If you use ansible_port |
|
ansible_winrm_server_cert_validation |
Set this to ignore if you use Ansible with self-signed certificates. |
|
ansible_winrm_transport |
You can use the following auth_methods to connect to the host using Ansible: basic, ntlm, kerberos, and credssp. |
|
computerDomain |
Domain if domain join is required |
|
computerOU |
Organization Unit if domain join is executed; defaults to the default OU of the connected AD if empty; must use |
|
create_ansible_user |
Create the |
|
domainAdminAccount |
Administrator user account for joining a domain; must use pre-Windows 2000 login ( |
|
domainAdminAccountPasswd |
Administrator account password for joining a domain; non alphanumeric characters are known to cause issues |
|
EnableFirewall |
Enable the firewall? |
|
foremanDebug |
false |
Save log files on the host after deployment |
hide_server_manager |
Show server manager when logging in to Windows Server? |
|
http-proxy |
Global HTTP proxy if required |
|
http-proxy-port |
global HTTP proxy port; is required if HTTP proxy is set |
|
inputLocale |
de-DE |
Keyboard layout after booting the host; popular alternatives are |
localAdminAccountDisabled |
false |
Disabling the default local administrator account? |
machinePassword |
Password for unsafe domain join |
|
network_location |
private |
Network profile association; required if there is no domain join, else there are issues with |
noupdates |
New hosts will try to patch during the installation. If you do not want to patch hosts, set this parameter to false. |
|
ntpServer |
NTP server; required if the host cannot access the internet or the DNS or DHCP server does not provide NTP |
|
ping |
Create a firewall rule to allow ICMP? |
|
remote_desktop |
Create a firewall rule to allow remote_desktop? |
|
systemLocale |
en-US |
Language of the host |
systemTimeZone |
GMT Standard Time |
Time zone of the host |
systemUILanguage |
en-US |
System UI language |
win_puppet_source |
Path to the Puppet |
|
windowsLicenseKey |
Windows license key |
|
windowsLicenseOwner |
Windows license key owner |