2021-01-27 21:32:16 +01:00
# Packer.Images [](https://ci.spamasaurus.com/djpbessems/Packer.Images)
2021-01-23 15:59:06 +01:00
2021-02-04 12:09:29 +01:00
This OVA appliance allows deploying a Windows Server fully automated; either as a domain member or stand-alone server.
The included `.ovf` file has the following XML contents (simplified for clarity) to facilitate the different `DeploymentOption` s:
```xml
<Envelope [...] >
[...]
<DeploymentOptionSection>
<Info> Deployment Type</Info>
<Configuration ovf:id= "domainmember" >
<Label> Domain member</Label>
<Description> Windows Server joined to an Active Directory domain</Description>
</Configuration>
<Configuration ovf:id= "standalone" >
<Label> Stand-alone</Label>
<Description> Stand-alone Windows Server</Description>
</Configuration>
</DeploymentOptionSection>
<VirtualSystem ovf:id= "[...]" >
[...]
<ProductSection>
[...]
<Category> 1) Operating System</Category>
<Property ovf:configuration= "domainmember standalone" ovf:key= "guestinfo.hostname" [...] >
<Label> Hostname*</Label>
</Property>
<Property ovf:configuration= "standalone" ovf:key= "guestinfo.administratorpw" [...] >
<Label> Local administrator password*</Label>
</Property>
[...]
<Category> 3) Active Directory membership</Category>
<Property ovf:configuration= "domainmember" ovf:key= "addsconfig.domainname" [...] >
<Label> Domain name*</Label>
</Property>
<Property ovf:configuration= "domainmember" ovf:key= "addsconfig.username" [...] >
<Label> Domain account username*</Label>
</Property>
<Property ovf:configuration= "domainmember" ovf:key= "addsconfig.password" [...] >
<Label> Domain account password*</Label>
</Property>
</ProductSection>
</VirtualSystem>
</Envelope>
```
When **provisioning** the appliance through the vCenter 'Deploy OVF template...' wizard, or through vApp-compatible *Infrastructure as code* tooling (e.g. HashiCorp Terraform), it is possible to provide all relevant configuration through vApp properties.
<table>
<tr>
<td><em>vSphere 'Deploy OVF template...' wizard</em></td> <td> <a href="https://registry.terraform.io/providers/hashicorp/vsphere/latest/docs/resources/virtual_machine#deploying -vm-from-an-ovfova-template">HashiCorp Terraform vSphere provider</a> </td>
</tr>
<tr>
<td><img src=".assets/vAppConfigurations-Server2019-example.png" alt="vApp properties" width="400" /><br/><img src=".assets/vAppProperties-Server2019-example.png" alt="vApp properties" width="400" /></td>
<td>
```hcl
vapp {
properties = {
# "deployment.type" = "domainmember"
2021-02-10 10:04:04 +01:00
"guestinfo.hostname" = "SRV01"
2021-02-04 12:09:29 +01:00
# "guestinfo.administratorpw" = var.vm_adminpassword
# "guestinfo.ntpserver" = "0.pool.ntp.org,1.pool.ntp.org,2.pool.ntp.org"
"guestinfo.ipaddress" = "10.0.0.42"
"guestinfo.prefixlength" = "24"
"guestinfo.dnsserver" = "10.0.0.21"
"guestinfo.gateway" = "10.0.0.1"
"addsconfig.domainname" = "contoso.com"
2021-02-10 10:04:04 +01:00
"addsconfig.username" = "CONTOSO\\domainjoin"
2021-02-04 12:09:29 +01:00
"addsconfig.password" = var . adds_password
}
}
```
</td>
</tr>
</table>
On first boot, the appliance will start **configuring** itself without any further user-input, by performing the following steps:
- Change hostname
- Configure network
- Join Active Directory domain ** -OR-** Set password for local administrator
- Iterate through any payload scripts