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 (VMs), databases, and networks.

...

The core of infrastructure provisioning is defining the resources you need for your project, such as virtual machinesVMs, 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 We leverage Terraform scripts for cloud resource provisioning at IT-Conductor. Specifically, we've crafted a VM-centric Terraform script, which not only provisions virtual machines but also handles the generation and utilization of necessary resources for these VMs. This versatile script has the ability to connect already existing resources like networknetworks, subnetsubnets, keys, and security groups or generate them in on the fly for provisioning the VM.

The script takes json accepts a JSON configuration file , containing that houses resource information , as its input. Following is the simple sample Below is an example of a simple configuration file designed for provisioning azure an 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_existingsignifies if that the resource already exists, if . If this value is true its , it is used by the script to connect to the VM being provisioned otherwise . Otherwise, this resource also gets created from the script itself. Also, the keys are stored in ITC as data files and downloaded to gateway the IT-Conductor Gateway temporarily during the provisioning of the VM.

Explore the following scenarios illustrating resource provisioning during migrations:

...