Reputation: 1391
I'm new to Terraform, but how to say run it on a regular server? Is it possible? I am talking - regular on premises machine
EDIT: Years later I come back to this question: Let me reform it. Can Terraform be used to provision a datacenter server, which is not on a hypervisor.
Upvotes: 60
Views: 63323
Reputation: 43
There is an open-source Terraform Redfish Provider currently being developed by Dell EMC that allows for provisioning, deployment and update of x86 servers out-of-band (via BMC such as for e.g. iDRAC) using standard Redfish REST APIs. For more details on Redfish, please refer to DMTF Redfish specification here. At present, it currently supports following provider resources and data sources:
Resources:
resource_redfish_bios
resource_redfish_power
resource_redfish_storage_volume
resource_simple_update
resource_redfish_virtual_media
Data Sources:
data_source_redfish_bios
data_source_redfish_storage
data_source_redfish_virtual_media
data_source_redfish_firmware_inventory
Upvotes: 4
Reputation: 74064
Terraform operates by calling into the APIs of various service providers and systems. Thus in principle Terraform can manage anything that has an API, and in practice it has existing support for a few different on-premises-capable systems, including:
If the compute resources in your existing datacenter infrastructure are already managed with one of these systems, or if you are willing to install them, then Terraform can be used to manage at least parts of these systems. (For full details, see the documentation for each provider linked above.)
Terraform's plugin architecture allows support for other systems to be developed, so other API-driven datacenter management systems such as The Foreman could be supported by Terraform, and indeed third parties have developed integrations with others that are distributed outside of the "official set" that HashiCorp hosts.
Upvotes: 60
Reputation: 389
By default, Terraform does not support bare metal provisioning services for on-prem equipment. However, the Open Source project; Digital Rebar Provision (DRP), has a Terraform Provider that allows the Terraform DSL to operate in conjunction with DRP. The Provider enables full support of bare metal provisioning by use of the Terraform DSL which drives the API of DRP to enable provisioning of bare metal.
The Digital Rebar Provision Terraform Provider is written and supported by RackN. You will need to install the DRP service on-prem, and configure it to enable provisioning workflows that are appropriate for your needs. Once this is done, the Terraform Provider then enables "ready state" infrastructure access to request Machines from the "terraform ready" pool of servers. The servers are then driven through the requested Workflow to configure it according to the operators needs.
On "destroy", the machine is cleaned, and returned back to the "terraform ready" pool of servers again. You can find "quickstart" information on getting DRP up and running by visiting the RackN hosted Portal.
As has been pointed out by @Martin Atkins; terraform drives other infrastructure or cloud resources via APIs. This is true also for Digital Rebar Provision. Terraform itself does not know how to interact with bare metal infrastructure. Use of a control or orchestration engine that understands how to address physical systems is required. In this solution - Terraform drives the Digital Rebar Provision service via the DSL, thus enabling provisioning activities of physical server systems on-prem.
For full disclosure - I work for RackN - which fosters and supports the Digital Rebar Provision service and capability.
Upvotes: 18
Reputation: 452
The question is vaguely understandable but,
If it means that you want to write Infrastructure-as-Code
for your personal on premises servers the answer is NO. Refer to Martin Atkins' answer.
If it means that you want to ssh into your on premises servers and execute terraform routines (plan, apply, destroy etc.), the answer is YES.
Download the suitable binary into your server operating system from here.
Upvotes: 1