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.
-
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.
- Nutanix
-
You can provision virtual machines on Nutanix AHV, manage their lifecycle, and decommission them.
- oVirt/Oracle Linux Virtualization Manager/Red Hat Virtualization
-
You can provision virtual machines on oVirt, Oracle Linux Virtualization Manager, and Red Hat Virtualization, 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.
-
You have an API token for your Hetzner Cloud account. You can create the token on the Hetzner Console web interface.
-
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.
-
From the OpenTofu Provider menu, select
Hetzner Cloud. -
From the OpenTofu Template menu, select
Hetzner Cloud provision default. -
In the URL and Username fields, enter any arbitrary characters.
orcharhino ignores them.
-
In the Password field, enter your Hetzner Cloud token.
-
Check Enable caching to cache API calls to Hetzner Cloud about clusters, network, or storage lists on orcharhino for 60 minutes.
ATIX AG recommends to enable caching 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 locations that allow the selected server type. You must check manually if the selected server type is available within the location. If you do not select a location, orcharhino automatically selects a compatible location.
-
Select Backups if you want to have backups of your hosts enabled on Hetzner Cloud.
-
Optional: From the Storage section, 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.
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 Cloud to the first network interface of the new host.
-
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. |
-
Ensure that the
destroy_vm_on_host_deletesetting is enabled.
-
In the orcharhino management UI, navigate to Hosts > All Hosts.
-
Select your host.
-
From the actions menu, click Delete.
-
Click Delete to delete your host from orcharhino and Hetzner Cloud.
-
destroy_vm_on_host_deletesetting
Connect orcharhino to Nutanix by using orcharhino management UI
You can use orcharhino with the OpenTofu plugin to provision, manage, and decommission hosts on Nutanix.
-
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,
Nutanix.Append the name of your Nutanix 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.
-
From the OpenTofu Provider menu, select
Nutanix. -
From the OpenTofu Template menu, select
Nutanix provision default. -
Check Enable caching to cache API calls to Nutanix about clusters, network, or storage lists on orcharhino for 60 minutes.
ATIX AG recommends to enable caching 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 Nutanix by using orcharhino management UI
You can add Nutanix hardware settings to a compute profile. When you create a host on Nutanix 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 Nutanix compute resource.
-
Click Submit to save the values to your compute profile.
Define an image for hosts on Nutanix by using orcharhino management UI
Define an image that you use to provision hosts on Nutanix through orcharhino.
-
In the orcharhino management UI, navigate to Infrastructure > Compute Resources.
-
Select your Nutanix 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 Nutanix.
-
From the Architecture list, select the architecture of the image on Nutanix.
-
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 Nutanix.
-
Click Submit to save the values to orcharhino.
Provision a host on Nutanix by using orcharhino management UI
You can use orcharhino to provision a host on Nutanix.
-
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 Nutanix 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:
-
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.
-
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 Nutanix
You can delete hosts running on Nutanix 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. |
-
Ensure that the
destroy_vm_on_host_deletesetting is enabled.
-
In the orcharhino management UI, navigate to Hosts > All Hosts.
-
Select your host.
-
From the actions menu, click Delete.
-
Click Delete to delete your host from orcharhino and Nutanix.
-
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"). |