Giter Site home page Giter Site logo

terraform-oci-cloudbricks-windows-iscsi-disks's Introduction

OCI Cloud Bricks: iSCSI Disks (Windows)

License: UPL Quality gate

Introduction

The following brick enables the creation of several Disks to later be attached to a combinatory of Computes in Windows OS Flavor.

Reference Architecture

The following is the reference architecture associated to this brick

Reference Architecture

Prerequisites

  • Pre-baked Artifact and Network Compartments

Sample tfvars file

########## 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 ######################################
######################################## DISK SPECIFIC VARIABLES ######################################
compute_availability_domain_list     = ["aBCD:RE-REGION-1-AD-1"]
disk_label_map                       = { "D" : "DATA", "E" : "STUFF" }
amount_of_disks                      = "2"
disk_size_in_gb                      = "50"
iscsi_disk_instance_compartment_name = "MY_ARTIFACT_COMPARTMENT"
volume_display_name                  = "diskbasename"
backup_policy_level                  = "bronze"

compute_display_name                 = "windows_machine"
windows_compute_id                   = "ocid1.instance.oc1.re-region-1.foobar"
os_password                          = "windows_machine_password"
windows_compute_private_ip           = "1.2.3.4"
######################################## DISK SPECIFIC VARIABLES ######################################
########## SAMPLE TFVAR FILE ##########

Variable specific considerations

  • Variable compute_availability_domain_list has to contain the exact AD where the windows compute is. This is because you can not attach a disk that it's on a different AD to that machine. Make sure that this is as instructed, if not code will fail to succeed.

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"
}

Requirements

No requirements.

Providers

Name Version
null n/a
oci n/a

Modules

No modules.

Resources

Name Type
null_resource.init_and_format resource
null_resource.init_disk_services resource
null_resource.present_disk resource
null_resource.set_execution_policy resource
null_resource.wait_for_cloudinit resource
oci_core_volume.ISCSIDisk resource
oci_core_volume_attachment.ISCSIDiskAttachment resource
oci_core_volume_backup_policy_assignment.backup_policy_assignment_ISCSI_Disk resource
oci_core_volume_backup_policies.BACKUPPOLICYISCSI data source
oci_identity_compartments.COMPARTMENTS data source

Inputs

Name Description Type Default Required
amount_of_disks Amount of equally sized disks any n/a yes
attach_disks Atach disk to a Linux instance bool true no
attachment_type Atacchment type can be iscsi or paravirtualized string "iscsi" no
backup_policy_level Backup policy level for ISCSI disks any n/a yes
compute_availability_domain_list Defines the availability domain list where OCI artifact will be created. This is a numeric value greater than 0 list(any) n/a yes
compute_display_name Name of the compute where the disk will be attached to any n/a yes
disk_label_map Mapping of Disk Letter plus it's mapping map(any) n/a yes
disk_size_in_gb Size in GB for Product Disk any n/a yes
filesystem_format Describes Filesystem format for the Disk string "NTFS" no
fingerprint API Key Fingerprint for user_ocid derived from public API Key imported in OCI User config any n/a yes
format_disk_ps1 Describes format_disk.ps1 powershell script placeholder variable string "format_disk.ps1" no
is_winrm_configured_for_image Defines if winrm is being used in this installation string "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 string "true" no
iscsi_disk_instance_compartment_name Defines the compartment name where the infrastructure will be created any n/a yes
iswin2008 Describes if the instance is Windows 2008 or not bool false no
os_password Defines Windows opc password any n/a yes
os_user Defines default admin user for instance string "opc" no
partition_style Describes Partition Style for the Disk string "MBR" 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
setup_ps1 Describes setup.ps1 powershell script placeholder variable string "setup.ps1" no
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 any n/a yes
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
userdata Describes userdata placeholder variable string "userdata" no
volume_display_name Disk display name. any n/a yes
vpus_per_gb n/a number 10 no
windows_compute_id OCI Id for instance to attach the disk any null no
windows_compute_private_ip Compute private IP to logon into machine any n/a yes

Outputs

Name Description
core_volumens n/a
core_volumens_attachment n/a
volumen_ids n/a

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-windows-iscsi-disks's People

Contributors

timclegg avatar ttscoff avatar dralquinta avatar matt-mcl avatar

Stargazers

Vinicius Henrique Silva Bastos avatar

Watchers

 avatar  avatar

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.