Giter Site home page Giter Site logo

terraform-oci-cloudbricks-fss's Introduction

OCI Cloud Bricks: File System Service (FSS)

License: UPL Quality gate

Introduction

The following cloud brick enables you to create batches of File Storage Services starting to 1 to many associated to a specific subnet and mount target within a compartment

Reference Architecture

The following is the reference architecture associated to this brick

Reference Architecture

Prerequisites

  • A pre-existent VCN
  • A pre-existent Mount Target
  • A pre existent Compartment Structure

Sample tfvar file

If wanting to provision FSS on its own

########## SAMPLE TFVAR FILE ##########
########## PROVIDER SPECIFIC VARIABLES ##########
region           = "foo-region-1"
tenancy_ocid     = "ocid1.tenancy.oc1..abcdefg"
user_ocid        = "ocid1.user.oc1..aaaaaaabcdefg"
fingerprint      = "fo:oo:ba:ar:ba:ar"
private_key_path = "/absolute/path/to/api/key/your_api_key.pem"
########## PROVIDER SPECIFIC VARIABLES ##########

########## ARTIFACT SPECIFIC VARIABLES ##########
num_of_fss                           = 3
fss_disk_group_base                  = "test-fss"
export_path_base                     = "/fss"
fss_disk_name_base                   = "fssdisk"
fss_instance_compartment_name        = "MY_FSS_COMPARTMENT"
fss_network_compartment_name         = "MY_NETWORK_COMPARTMENT"
mt_compartment_name                  = "MY_MOUNT_TARGET_COMPARTMENT"
vcn_display_name                     = "MY_VCN"
network_subnet_name                  = "MY_PRIVATE_SUBNET"
fss_mount_target_availability_domain = "abcd:RE-REGION-1-AD-1"
fss_mount_target_name                = "MY_MOUNT_TARGET_NAME"
########## ARTIFACT SPECIFIC VARIABLES ##########
########## SAMPLE TFVAR FILE ##########

If attaching fss to Oracle Linux

########## SAMPLE TFVAR FILE ##########
########## PROVIDER SPECIFIC VARIABLES ##########
region           = "foo-region-1"
tenancy_ocid     = "ocid1.tenancy.oc1..abcdefg"
user_ocid        = "ocid1.user.oc1..aaaaaaabcdefg"
fingerprint      = "fo:oo:ba:ar:ba:ar"
private_key_path = "/absolute/path/to/api/key/your_api_key.pem"
########## PROVIDER SPECIFIC VARIABLES ##########

########## ARTIFACT SPECIFIC VARIABLES ##########
num_of_fss                           = 3
fss_disk_group_base                  = "test-fss"
export_path_base                     = "/fss"
fss_disk_name_base                   = "fssdisk"
fss_instance_compartment_name        = "MY_FSS_COMPARTMENT"
fss_network_compartment_name         = "MY_NETWORK_COMPARTMENT"
mt_compartment_name                  = "MY_MOUNT_TARGET_COMPARTMENT"
vcn_display_name                     = "MY_VCN"
network_subnet_name                  = "MY_PRIVATE_SUBNET"
fss_mount_target_availability_domain = "abcd:RE-REGION-1-AD-1"
fss_mount_target_name                = "MY_MOUNT_TARGET_NAME"

compute_private_ips = ["10.0.0.1"]
os_type             = "linux"
ssh_private_key     = "/path/to/my/ssh/key"
########## ARTIFACT SPECIFIC VARIABLES ##########
########## SAMPLE TFVAR FILE ##########

If attaching fss to Ubuntu

########## SAMPLE TFVAR FILE ##########
########## PROVIDER SPECIFIC VARIABLES ##########
region           = "foo-region-1"
tenancy_ocid     = "ocid1.tenancy.oc1..abcdefg"
user_ocid        = "ocid1.user.oc1..aaaaaaabcdefg"
fingerprint      = "fo:oo:ba:ar:ba:ar"
private_key_path = "/absolute/path/to/api/key/your_api_key.pem"
########## PROVIDER SPECIFIC VARIABLES ##########

########## ARTIFACT SPECIFIC VARIABLES ##########
num_of_fss                           = 3
fss_disk_group_base                  = "test-fss"
export_path_base                     = "/fss"
fss_disk_name_base                   = "fssdisk"
fss_instance_compartment_name        = "MY_FSS_COMPARTMENT"
fss_network_compartment_name         = "MY_NETWORK_COMPARTMENT"
mt_compartment_name                  = "MY_MOUNT_TARGET_COMPARTMENT"
vcn_display_name                     = "MY_VCN"
network_subnet_name                  = "MY_PRIVATE_SUBNET"
fss_mount_target_availability_domain = "abcd:RE-REGION-1-AD-1"
fss_mount_target_name                = "MY_MOUNT_TARGET_NAME"

compute_private_ips = ["10.0.0.1"]
os_type             = "ubuntu"
ssh_private_key     = "/path/to/my/ssh/key"
########## ARTIFACT SPECIFIC VARIABLES ##########
########## SAMPLE TFVAR FILE ##########

If attaching fss to Windows

  • Be aware that you may need to restart Windows instances after mounting FSS for them to show up.
########## SAMPLE TFVAR FILE ##########
########## PROVIDER SPECIFIC VARIABLES ##########
region           = "foo-region-1"
tenancy_ocid     = "ocid1.tenancy.oc1..abcdefg"
user_ocid        = "ocid1.user.oc1..aaaaaaabcdefg"
fingerprint      = "fo:oo:ba:ar:ba:ar"
private_key_path = "/absolute/path/to/api/key/your_api_key.pem"
########## PROVIDER SPECIFIC VARIABLES ##########

########## ARTIFACT SPECIFIC VARIABLES ##########
num_of_fss                           = 3
fss_disk_group_base                  = "test-fss"
export_path_base                     = "/fss"
fss_disk_name_base                   = "fssdisk"
fss_instance_compartment_name        = "MY_FSS_COMPARTMENT"
fss_network_compartment_name         = "MY_NETWORK_COMPARTMENT"
mt_compartment_name                  = "MY_MOUNT_TARGET_COMPARTMENT"
vcn_display_name                     = "MY_VCN"
network_subnet_name                  = "MY_PRIVATE_SUBNET"
fss_mount_target_availability_domain = "abcd:RE-REGION-1-AD-1"
fss_mount_target_name                = "MY_MOUNT_TARGET_NAME"

compute_private_ips = ["10.0.0.1"]
os_type             = "windows"
win_os_password     = "MY_WINDOWS_PASSWORD"
########## ARTIFACT SPECIFIC VARIABLES ##########
########## SAMPLE TFVAR FILE ##########

Variable specific considerations

  • When variable num_of_fss is greater than 1, there is a chance that the following error appears:
Error: 409-Conflict 
 Provider version: 4.40.0, released on 2021-08-18.  
 Service: File Storage System 
 Error Message: Another filesystem is currently being provisioned, try again later 
 OPC request ID: 08cdbcfa22bd1618f7c59b6c784c574d/D0703FEC7507DB939448D64253BBC0F8/AA11BA35A2B6FE2F2B18A25F4BEDF26C 
 Suggestion: The resource is in a conflicted state. Please retry again or contact support for help with service: File Storage System
 
 
   with oci_file_storage_file_system.FileStorage[5],
   on fss.tf line 2, in resource "oci_file_storage_file_system" "FileStorage":
    2: resource "oci_file_storage_file_system" "FileStorage" {
  
  • If this occurs, be sure to handle a retry logic on code that executes this module at least num_of_fss + 1 times

  • Variables fss_disk_group_base, export_path_base and fss_disk_name_base make up the display names and export paths for the FSS. See the example below on how these show up in OCI:

fss_disk_group_base = "test-fss"
export_path_base    = "/fss"
fss_disk_name_base  = "fssdisk"

> export_path: /test-fss/fss01, /test-fss/fss02..
> display_name: test-fss_fssdisk01, test-fss_fssdisk02..
  • Variable compute_private_ips is a list of the IPs of the instances that will be used to mount the FSS.

Sample provider

The following is the base provider definition to be used with this module

terraform {
  required_version = ">= 0.13.5"
}
provider "oci" {
  region       = var.region
  tenancy_ocid = var.tenancy_ocid
  user_ocid        = var.user_ocid
  fingerprint      = var.fingerprint
  private_key_path = var.private_key_path
  disable_auto_retries = "true"
}

provider "oci" {
  alias        = "home"
  region       = data.oci_identity_region_subscriptions.home_region_subscriptions.region_subscriptions[0].region_name
  tenancy_ocid = var.tenancy_ocid  
  user_ocid        = var.user_ocid
  fingerprint      = var.fingerprint
  private_key_path = var.private_key_path
  disable_auto_retries = "true"
}

Variable documentation

Requirements

No requirements.

Providers

Name Version
null 3.1.1
oci 4.77.0

Modules

No modules.

Resources

Name Type
null_resource.install_prereq_linux_os resource
null_resource.install_prereq_ubuntu_os resource
null_resource.install_prereq_windows_os resource
null_resource.mount_disk_linux resource
null_resource.mount_disk_ubuntu resource
null_resource.mount_disk_windows resource
oci_file_storage_export.ExportFileSystemMount resource
oci_file_storage_file_system.FileStorage resource
oci_core_private_ip.MOUNTPRIVATEIP data source
oci_core_subnets.SUBNET data source
oci_core_vcns.VCN data source
oci_file_storage_mount_targets.MOUNTTARGET data source
oci_identity_compartments.COMPARTMENTS data source
oci_identity_compartments.MTCOMPARTMENTS data source
oci_identity_compartments.NWCOMPARTMENTS data source

Inputs

Name Description Type Default Required
compute_private_ips Compute private IPs to logon into machine string "" no
export_path_base Export path for File Storage Service any n/a yes
fingerprint API Key Fingerprint for user_ocid derived from public API Key imported in OCI User config any n/a yes
fss_disk_group_base Describes the group display name to which the disks will be associated with string "" no
fss_disk_name_base User friendly name for File Storage Service any n/a yes
fss_instance_compartment_id Defines the compartment OCID where the infrastructure will be created string "" no
fss_instance_compartment_name Defines the compartment name where the infrastructure will be created string "" no
fss_mount_target_availability_domain Availability domain where the mount target is located at any n/a yes
fss_mount_target_name User friendly name for Mount Target any n/a yes
fss_network_compartment_name Defines the compartment where the Network is currently located any n/a yes
is_winrm_configured_for_image Defines if winrm is being used in this installation bool true no
is_winrm_configured_with_ssl Use the https 5986 port for winrm by default. If that fails with a http response error: 401 - invalid content type, the SSL may not be configured correctly bool true no
label_zs n/a list(any)
[
"0",
""
]
no
mt_compartment_id Mount Target Compartment Location OCID string "" no
mt_compartment_name Mount Target Compartment Location string "" no
network_subnet_name Name of the subnet where the artifact is located any n/a yes
num_of_fss Amount of FSS that will be created any n/a yes
os_type Describes the type of OS currently in place. Valid values are: linux, ubuntu, windows string "" no
private_key_path Private Key Absolute path location where terraform is executed any n/a yes
region Target region where artifacts are going to be created any n/a yes
ssh_private_is_path Determines if key is supposed to be on file or in text bool true no
ssh_private_key Determines what is the private key to connect to machine string "" no
tenancy_ocid OCID of tenancy any n/a yes
user_ocid User OCID in tenancy. Currently hardcoded to user [email protected] any n/a yes
vcn_display_name Display Name associated to VCN any n/a yes
win_os_password Windows Server OS Password string "" no
windows_drive_letters n/a list(any)
[
"Z",
"Y",
"X",
"W",
"V",
"U",
"T",
"S",
"R",
"Q",
"P",
"O",
"N",
"M",
"L",
"K",
"J",
"I",
"H",
"G",
"F",
"E",
"D"
]
no

Outputs

Name Description
FSS FSS Object
display_name Display Name of FSS
export_path_base Export path of FSS
mount_target_private_ip Private IP of Mount Target

Contributing

This project is open source. Please submit your contributions by forking this repository and submitting a pull request! Oracle appreciates any contributions that are made by the open source community.

License

Copyright (c) 2021 Oracle and/or its affiliates.

Licensed under the Universal Permissive License (UPL), Version 1.0.

See LICENSE for more details.

terraform-oci-cloudbricks-fss's People

Contributors

djukickosta avatar dralquinta avatar matt-mcl avatar timclegg avatar ttscoff avatar

Watchers

 avatar  avatar

terraform-oci-cloudbricks-fss's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.