FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms, and a large community has continually developed it for more than thirty years. Its advanced networking, security, and storage features have made FreeBSD the platform of choice for many of the busiest web sites and most pervasive embedded networking and storage devices.
The FreeBSD project has supported 64-bit Arm platforms for some time, ensuring that all core software for the operating system is natively compiled to ensure a “just works” experience for its customers who choose to build and run solutions on FreeBSD. Recently FreeBSD became available, via the Oracle Cloud Infrastructure (OCI) Marketplace, for use on OCI Ampere A1 shapes . In this post, we will show how you can use Terraform to quickly automate the deployment and configuration of FreeBSD on Ampere® Altra® multi core processors on Oracle Cloud Infrastructure In this tutorial, we will use the DevOps tool Terraform, to launch a FreeBSD virtual machine on an OCI Ampere A1 compute platform while passing in some metadata to configure it.
Before we get started:
- Install Terraform on your local system.
- Make sure you have an Oracle OCI “Always Free” Account and credentials for API use
Using the oci-ampere-a1 Terraform moduleThe oci-ampere-a1 Terraform module code supplies the minimal amount of information to quickly have working Ampere A1 shapes on OCI “Always Free”. It has been updated to include the ability to easily select FreeBSD as an option by passing in a parameter. OCI allows grouping shapes into compartments, but to keep things simple in this tutorial, we will create shapes with the tenancy ID as compartment ID, which will create VMs in the root compartment. The following tasks will be performed by the oci-ampere-a1 Terraform module.
- Operating system image id discovery in the user region.
- Dynamically create SSH keys to use when logging into the shape.
- Dynamically find the region, availability zone and image id.
- Create necessary core networking configurations for the tenancy
- Render metadata to pass into the Ampere A1 shape.
- Launch 1 to 4 Ampere A1 shapes with the right metadata and SSH keys.
- Output IP information so that we can connect to the shape.
Configuration with terraform.tfvarsFor the purpose of this tutorial, we will quickly configure Terraform using a terraform.tfvars in the project directory.
The following is an example of what terraform.tfvars should look like: