User Tools

Site Tools


guide:cloud:advanced

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
guide:cloud:advanced [2025/10/21 15:00]
sfebruary [Single, generic, VM project]
guide:cloud:advanced [2025/10/22 10:21] (current)
sfebruary [Single, generic, VM project]
Line 144: Line 144:
 ==== Single, generic, VM project ==== ==== Single, generic, VM project ====
  
-Now that we have some base resources defined, we can proceed to creating an OpenStack instance via the IAC approach. Begin by [[https://docs.gitlab.com/user/project/#create-a-blank-project|creating a blank project in GitLab]]. +Now that we have some base resources defined, we can proceed to creating an OpenStack instance via the IAC approach. To illustrate the concept, we can again draw on a [[https://github.com/sfebruary/terraform-module-openstack-instance|pre-defined module for an instance]]. NB! This particular example assumes that an SSH key-pair already exists as a resource within your OpenStack project space, as well as a Security Group that allows SSH access to your instances, so be sure to create those first as they will be referenced below. 
 + 
 +Begin by [[https://docs.gitlab.com/user/project/#create-a-blank-project|creating a new, blank project in GitLab]]. 
  
 Next, we want to create a few files: Next, we want to create a few files:
Line 187: Line 189:
   # general instance settings   # general instance settings
   image_name           = "Rocky 9"   image_name           = "Rocky 9"
-  flavor_name          = "C4.medium"+  flavor_name          = "C4.small"
   shortname            = "instance-project"   shortname            = "instance-project"
   volume_name          = "SSD-volume-128"   volume_name          = "SSD-volume-128"
Line 203: Line 205:
   ssh_security_group_name  = "ssh-secgroup"   ssh_security_group_name  = "ssh-secgroup"
   key_pair_name            = "instance-keypair"   key_pair_name            = "instance-keypair"
 +  
 +**variables.tf**:
 +
 +  variable "public_network_name" {
 +    type        = string
 +    description = "The name of the public network"
 +    default     = null
 +  }
 +  variable "private_network_name" {
 +    type        = string
 +    description = "The name of the private network"
 +    default     = null
 +  }
 +  variable "private_subnet_name" {
 +    type        = string
 +    description = "The name of the private subnet"
 +    default     = null
 +  }
 +  variable "server_private_port_name" {
 +    type        = string
 +    description = "The name of the private network port for the instance"
 +    default     = null
 +  }
 +  variable "server_private_ip" {
 +    type        = string
 +    description = "The fixed IP address of the instance on the private network"
 +    default     = null 
 +  }
 +  variable "image_name" {
 +    type        = string
 +    description = "The image to be used for the instance"
 +    default     = null
 +  }
 +  variable "admin_username" {
 +    type        = string
 +    description = "The admin username to be used for the instance"
 +    default     = null
 +  }
 +  variable "shortname" {
 +    type        = string
 +    description = "The shortname to assign to the instance"
 +    default     = null
 +  }
 +  variable "flavor_name" {
 +    type        = string
 +    description = "The flavor for the instance"
 +    default     = null
 +  }
 +  variable "volume_name" {
 +    type        = string
 +    description = "The volume name to assign to the device"
 +    default     = null
 +  }
 +  variable "volume_size" {
 +    type        = string
 +    description = "The volume size to assign to the device"
 +    default     = null
 +  }
 +  variable "volume_type" {
 +    type        = string
 +    description = "The volume type to assign to the device"
 +    default     = null
 +  }
 +  variable "volume_device_path" {
 +    type        = string
 +    description = "The path to the device associated with the volume"
 +    default     = null
 +  }
 +  variable "enable_online_resize" {
 +    type        = bool
 +    description = "Enable volume to be resized on the fly or not"
 +    default     = null
 +  }
 +  variable "key_pair_name" {
 +    type        = string
 +    description = "The name of the pre-defined key-pair to use for logging in to the nodes"
 +    default     = null
 +  }
 +  variable "ssh_security_group_name" {
 +    type        = string
 +    description = "The name of the security group to allow ssh access"
 +    default     = null
 +  }
 +  
 +Finally, proceed to initialise Terraform, plan and apply as we did above in the case of the base project.
 +
 +NB! In order to assign a publicly reachable IP address (i.e. a floating IP) to the above instance, you may either modify the above to include this to be done via code, or this may be done/managed via the Horizon dashboard too.
/app/dokuwiki/data/attic/guide/cloud/advanced.1761051642.txt.gz · Last modified: 2025/10/21 15:00 by sfebruary