<commit_before>// Module included in the following assemblies:
//
// * windows_containers/creating_windows_machinesets/creating-windows-machineset-vsphere.adoc

[id="creating-the-vsphere-windows-vm-golden-image_{context}"]
= Creating the vSphere Windows VM golden image

Create a vSphere Windows virtual machine (VM) golden image.

.Prerequisites

* You have created a private/public key pair, which is used to configure key-based authentication in the OpenSSH server. The private key must also be configured in the Windows Machine Config Operator (WMCO) namespace. This is required to allow the WMCO to communicate with the Windows VM. See the "Configuring a secret for the Windows Machine Config Operator" section for more details.

[NOTE]
====
You must use link:https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell[Microsoft PowerShell] commands in several cases when creating your Windows VM. PowerShell commands in this guide are distinguished by the `PS C:\>` prefix.
====

.Procedure

. Create a new VM in the vSphere client using the Windows Server Semi-Annual Channel (SAC): Windows Server 2004 ISO image that includes the link:https://support.microsoft.com/en-us/help/4565351/windows-10-update-kb4565351[Microsoft patch KB4565351]. This patch is required to set the VXLAN UDP port, which is required for clusters installed on vSphere. See the link:https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.hostclient.doc/GUID-FBEED81C-F9D9-4193-BDCC-CC4A60C20A4E.html[VMware documentation] for more information.

. Install and configure VMware Tools version 11.0.6 or greater on the Windows VM. See the link:https://docs.vmware.com/en/VMware-Tools/index.html[VMware Tools documentation] for more information.

. After installing VMware Tools on the Windows VM, verify the following:

.. The `C:\ProgramData\VMware\VMware Tools\tools.conf` file exists with the following entry:
+
[source,ini]
----
exclude-nics=
----
+
If the `tools.conf` file does not exist, create it with the `exclude-nics` option uncommented and set as an empty value.
+
This entry ensures the cloned vNIC generated on the Windows VM by the hybrid-overlay is not ignored.

.. The Windows VM has a valid IP address in vCenter:
+
[source,terminal]
----
C:\> ipconfig
----

.. The VMTools Windows service is running:
+
[source,posh]
----
PS C:\> Get-Service -Name VMTools | Select Status, StartType<commit_msg>Include Windows Server 20H2 image<commit_after>// Module included in the following assemblies:
//
// * windows_containers/creating_windows_machinesets/creating-windows-machineset-vsphere.adoc

[id="creating-the-vsphere-windows-vm-golden-image_{context}"]
= Creating the vSphere Windows VM golden image

Create a vSphere Windows virtual machine (VM) golden image.

.Prerequisites

* You have created a private/public key pair, which is used to configure key-based authentication in the OpenSSH server. The private key must also be configured in the Windows Machine Config Operator (WMCO) namespace. This is required to allow the WMCO to communicate with the Windows VM. See the "Configuring a secret for the Windows Machine Config Operator" section for more details.

[NOTE]
====
You must use link:https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell[Microsoft PowerShell] commands in several cases when creating your Windows VM. PowerShell commands in this guide are distinguished by the `PS C:\>` prefix.
====

.Procedure

. Create a new VM in the vSphere client using the Windows Server Semi-Annual Channel (SAC): Windows Server 2004 or 20H2 ISO image that includes the link:https://support.microsoft.com/en-us/help/4565351/windows-10-update-kb4565351[Microsoft patch KB4565351]. This patch is required to set the VXLAN UDP port, which is required for clusters installed on vSphere. See the link:https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.hostclient.doc/GUID-77AB6625-F968-4983-A230-A020C0A70326.html[VMware documentation] for more information.

. Install and configure VMware Tools version 11.0.6 or greater on the Windows VM. See the link:https://docs.vmware.com/en/VMware-Tools/index.html[VMware Tools documentation] for more information.

. After installing VMware Tools on the Windows VM, verify the following:

.. The `C:\ProgramData\VMware\VMware Tools\tools.conf` file exists with the following entry:
+
[source,ini]
----
exclude-nics=
----
+
If the `tools.conf` file does not exist, create it with the `exclude-nics` option uncommented and set as an empty value.
+
This entry ensures the cloned vNIC generated on the Windows VM by the hybrid-overlay is not ignored.

.. The Windows VM has a valid IP address in vCenter:
+
[source,terminal]
----
C:\> ipconfig
----

.. The VMTools Windows service is running:
+
[source,posh]
----
PS C:\> Get-Service -Name VMTools | Select Status, StartType
{'fraction_non_alphanumeric': 0.0918409184091841, 'fraction_numerical': 0.022755227552275523, 'mean_word_length': 4.4513966480446925, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2649661', 'n_tokens_mistral': 1495, 'n_tokens_neox': 1394, 'n_words': 553}