Provision hosts through OpenTofu
orcharhino can interact with multiple clouds and virtualization solutions through OpenTofu. You can create hosts and control their power management states through orcharhino.
orcharhino uses OpenTofu to act as a unified interface to provision and manage hosts on several clouds and virtualization platforms. After an initial setup, you can create hosts on different compute resource providers with the same workflow.
- Enable OpenTofu-based host provisioning
-
-
Install the OpenTofu plugin on your orcharhino Server.
-
Connect orcharhino to a supported compute resource target.
-
Define an image from your compute resource target in orcharhino.
-
Create a compute profile to bundle hardware settings.
-
- Customize OpenTofu-based host provisioning
-
-
Depending on your use case, create additional compute profiles.
-
Create a host group as blue print to standardize host deployments.
-
- Provision hosts
-
-
Select a host group.
-
Customize settings to your needs.
-
Provision a host.
-
|
The OpenTofu plugin is a Technology Preview feature only. Technology Preview features are not supported by ATIX AG. ATIX AG does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process. For more information about the support scope of ATIX AG Technology Preview features, see Technical Previews in the ATIX Service Portal. |
Supported OpenTofu targets
orcharhino integrates with several compute resource targets through OpenTofu. It provides a provisioning template for each supported OpenTofu target.
- Hetzner Cloud
-
You can provision cloud instances on Hetzner Cloud, manage their lifecycle, and decommission them.
Install the OpenTofu plugin
Install the OpenTofu plugin on your orcharhino Server to provision and manage hosts through OpenTofu.
-
On your orcharhino Server, install the OpenTofu plugin:
$ orcharhino-installer --enable-foreman-plugin-opentofu
-
In the orcharhino management UI, navigate to Administer > About.
-
On the Plugins tab, verify the installation of the OpenTofu plugin.
-
Connect orcharhino to a OpenTofu-based compute resource. For more information, see Supported opentofu targets.
Connect orcharhino to Hetzner Cloud by using orcharhino management UI
You can use orcharhino with the OpenTofu plugin to provision, manage, and decommission hosts on Hetzner Cloud.
-
In the orcharhino management UI, navigate to Infrastructure > Compute Resources.
-
Click Create Compute Resource.
-
In the Name field, enter a name for the compute resource, for example,
Hetzner Cloud.Append the name of your Hetzner Cloud account if you plan to use multiple accounts simultaneously.
-
From the Provider list, select OpenTofu.
-
Optional: In the Description field, enter a description for your compute resource.
-
Select the Opentofu Template for the selected Provider.
-
In the URL field, enter the hostname/URL to connect to.
-
Specify the Username and Password for the conenction.
For Hetzner Provider only an Authentication-Token must be specified. The Token can be created on the Hetzner Console Web-Interface. It must be entered into the Password field.
The Username and URL fields are still mandatory, so in case of Hetzner Provider, these fields must be filled with a random string. Content of these fields will be ignored.
-
Check Enable caching. Recommended to improve performance.
-
Click Submit.
-
Create a compute profile to bundle hardware settings.
-
Define an image from your compute resource provider in orcharhino to perform image-based host provisioning.
-
Create a host group to bundle all settings in a blue print in orcharhino for reproducible host deployments.
Create a predefined configuration for hosts on Hetzner Cloud by using orcharhino management UI
You can add Hetzner Cloud hardware settings to a compute profile. When you create a host on Hetzner Cloud using this compute profile, these settings are automatically populated.
-
In the orcharhino management UI, navigate to Infrastructure > Compute Profiles.
-
Select your compute profile.
-
Select your Hetzner Cloud compute resource.
-
From the Server Type list, select the server type to use for provisioning.
-
From the Location list, select the geographical location of the Hetzner Cloud datacenter.
The list of available Locations is not dynamically reduced to the set of Locations that allow the selected Server Type. You have to check manually if the selected Server Type is available within the Location. If Location is omitted, then a compatible one is selected automatically.
-
Select Backups if you want to have backups of your hosts enabled on Hetzner Cloud.
-
From the Storage section, if needed, define additional Storage Volumes.
-
From the Image list, select the image to use for provisioning.
-
From the Network list, select the network to use for provisioning.
At the moment, the first network-interface will receive a public IP address. Selecting a managed subnet may therefore result in an error.
-
Click Submit to save the values to your compute profile.
Define an image for hosts on Hetzner Cloud by using orcharhino management UI
Define an image that you use to provision hosts on Hetzner Cloud through orcharhino.
-
In the orcharhino management UI, navigate to Infrastructure > Compute Resources.
-
Select your Hetzner Cloud compute resource.
-
Click Create Image.
-
In the Name field, enter the name of your golden image.
-
From the Operating System list, select the operating system of the image on Hetzner Cloud.
-
From the Architecture list, select the architecture of the image on Hetzner Cloud.
-
In the Username field, enter the user name of your golden image.
-
Select User Data if the host image supports user data.
-
In the Password field, enter the password of the user on your golden image.
-
From the Image list, select the image on Hetzner Cloud.
-
Click Submit to save the values to orcharhino.
Provision a host on Hetzner Cloud by using orcharhino management UI
You can use orcharhino to provision a host on Hetzner Cloud.
-
In the orcharhino management UI, navigate to Hosts > Create Host.
-
In the Name field, enter a name for the host.
-
Optional: Click the Organization tab and change the organization context to match your requirement.
-
Optional: Click the Location tab and change the location context to match your requirement.
-
From the Host Group list, select a host group that you want to assign your host to. That host group will populate the form.
-
From the Deploy on list, select the Hetzner Cloud compute resource.
-
From the Compute Profile list, select a compute profile to automatically populate virtual machine settings.
-
From the Lifecycle Environment list, select the environment.
-
Click the Interfaces tab, and on the interface of the host, click Edit.
-
Verify that the fields are populated with values. Note in particular:
-
orcharhino automatically assigns the public IP address generated by Hetzner for the new host’s first interface.
-
The Name from the Host tab becomes the DNS name.
-
Ensure that orcharhino automatically selects the Managed, Primary, and Provision options for the first interface on the host. If not, select them.
-
-
Click OK to save. To add another interface, click Add Interface. You can select only one interface for Provision and Primary.
For more information about network interfaces, see Configuring network interfaces in Managing Hosts.
-
On the Operating System tab, confirm that all fields automatically contain values.
-
Click Resolve next to Provisioning templates to confirm that the host can identify its provisioning templates.
-
Click the Virtual Machine tab and confirm that these settings are populated with details from the host group and compute profile.
-
From the Server Type List, select the server type on Hetzner Cloud.
-
From the Location List, select the geographical location of the host on Hetzner Cloud.
-
On the Parameters tab, click Add parameter. Add a parameter named
kt_activation_keys, select the string type, and enter the name of the activation key as the value. The activation key has to belong to the same organization as your host. You can also enter a comma-separated list of multiple activation keys. -
Click Submit to provision a host.
Delete a host on Hetzner Cloud
You can delete hosts running on Hetzner Cloud through orcharhino.
|
By default, deleting a host entry associated with a virtual machine does not destroy the virtual machine on the compute resource. To change the default behavior, navigate to Administer > Settings > Provisioning and set Destroy associated VM on host delete to Yes. |
|
OpenTofu Compute Resource does not support the Virtual Machines tab on the compute resource details page. To delete a host created through an OpenTofu compute resource either remove the Host on the backend virtualization/Cloud service or use the following procedure. |
-
Ensure the
destroy_vm_on_host_deletesetting is enabled. -
Navigate to Hosts > All Hosts and delete the host manually.
-
destroy_vm_on_host_deletesetting
Appendix A: OpenTofu settings
The OpenTofu settings define how orcharhino interacts with OpenTofu.
| Setting | Default value | Description |
|---|---|---|
TfState Token Timeout |
|
Allowed duration in seconds for OpenTofu to report back to orcharhino. |
|
The text and illustrations on this page are licensed by ATIX AG under a Creative Commons Attribution Share Alike 4.0 International ("CC BY-SA 4.0") license. This page also contains text from the official Foreman documentation which uses the same license ("CC BY-SA 4.0"). |