Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Infrastructure as Code (IaC) is the practice of provisioning and managing infrastructure resources using code. It is an integral component of DevOps methodology, facilitating the seamless orchestration of applications and their underlying infrastructure such as servers, virtual machines, databases, and networks.

...

The core of infrastructure provisioning is defining the resources you need for your project, such as virtual machines, databases, networks, and more. In your IaC code, you describe the desired state of these resources, specifying their attributes, relationships, and configurations.

Dinesh Amatya can you provide high-level instructions on how we provision resources in IT-Conductor that is somehow true for all IaC/migration projects regardless of what we are migrating (if possible)? Also if we can have templates documented as well, that would be great.

We use terraform script to provision resources in cloud. In ITC we have designed/developed VM centric terraform script, meaning our script can provision VM and generate/use required resources for the VM. The script has the ability to connect already existing resources like network, subnet, keys , security groups or generate them in the fly for provisioning the VM.

The script takes json configuration file, containing resource information, as input. Following is the simple sample configuration file for provisioning azure VM.

Code Block
{
  "infrastructure": {
    "region": "westus",
    "resource_group": { 
      "is_existing": "false",
      "name": "itc-rg"
    },
    "vnets": {
      "management": {
        "is_existing": "true",
        "arm_id":"/subscriptions/XXXXXXXXXXXX/resourceGroups/XXXXXXXXX/providers/Microsoft.Network/virtualNetworks/XXXXXXX",
        "address_space": "10.200.0.0/16",
        "subnet_mgmt": {
          "is_existing": "false",
          "name": "single-vm-test-subnet",
          "prefix": "10.200.10.0/24",
          "nsg": {
            "is_existing": "false",
            "name": "nsg-mgmt-single-vm-test",
            "allowed_ips": [
              "0.0.0.0/0"
            ]
          }
        }
      }
    }
  },
  "vms": [
    {
      "name": "vm1",
      "os": {
        "publisher": "suse",
        "offer": "sles-sap-12-sp5",
        "sku": "gen1"
      },
      "size": "STANDARD_B1s",
      "disk_type": "StandardSSD_LRS",
      "authentication": {
        "type": "key",
        "username": "itcuser"
      }
    }
  ],
  "sshkey": {
    "path_to_public_key": "~/.ssh/id_rsa.pub",
    "path_to_private_key": "~/.ssh/id_rsa"
  }
}

In the configuration file all the fields are self explanatory. The field “is_existing” signifies if the resource already exists, if this value is true its used by the script to connect to VM being provisioned otherwise this resource also gets created from the script itself. Also the keys are stored in ITC as data files and downloaded to gateway temporarily during provisioning of the VM.

Explore the following scenarios illustrating resource provisioning during migrations:

...