diff --git a/README.md b/README.md index c29c8aca20e8ca16a84ddd1527c95e459ab9afda..2173d84b3d3c98b62dbcf4e0b437118c9975324d 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,3 @@ # Scripts for creating infrastructure -There is possibility to create infrastructure in [GUI][https://ostrava.openstack.cloud.e-infra.cz/]. - manual at [e-INFRA CZ guide][https://docs.e-infra.cz/compute/openstack/getting-started/creating-first-infrastructure/] or you can use custom script writed in [teraform][3]/[bash][4] - - - - - -[3] https://code.it4i.cz/dvo0012/infrastructure-by-script/-/tree/main/openstack-infrastructure-as-code-automation/clouds/g2/ostrava/general/commandline -[4] https://code.it4i.cz/dvo0012/infrastructure-by-script/-/tree/main/openstack-infrastructure-as-code-automation/clouds/g2/ostrava/general/terraform \ No newline at end of file +There is possibility to create infrastructure in ([GUI][https://ostrava.openstack.cloud.e-infra.cz/]). - manual at ([e-INFRA CZ guide][https://docs.e-infra.cz/compute/openstack/getting-started/creating-first-infrastructure/]) or you can use custom script writed in ([teraform][https://code.it4i.cz/dvo0012/infrastructure-by-script/-/tree/main/openstack-infrastructure-as-code-automation/clouds/g2/ostrava/general/commandline])/([bash][https://code.it4i.cz/dvo0012/infrastructure-by-script/-/tree/main/openstack-infrastructure-as-code-automation/clouds/g2/ostrava/general/terraform]) diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/README.md b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/README.md deleted file mode 100644 index e7cfda329751c1daa1215ee886d0aeb6ee515838..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# General IaaS infrastructure demo - -Assuming you are added into a group project and you can log in via [MetaCentrum OpenStack cloud dashboard](https://cloud.metacentrum.cz/) using one of supported federations (e-INFRA CZ, EGI CHeck-in, ...). - -We recommend to build custom cloud infrastructure with Terraform or openstack client rather than using [MetaCentrum OpenStack cloud Horizon UI dashboard](https://dashboard.cloud.muni.cz). - -Below demos show in detail how to do so. - -## [Terraform `general` demo](./terraform) - -Terraform demo shows how to automate building highly scalable IaaS infrastructure. - -## [OpenStack client `general` demo](./commandline) - -OpenStack shell script demo shows how to automate small IaaS infrastructure which does not need additional scalability. diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/commandline/README.md b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/commandline/README.md deleted file mode 100644 index 3d375d7eb55b5ad071213270188327223ce1bed4..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/commandline/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# Build OpenStack infrastructure from command-line using openstack client - -## Pre-requisites - * Linux/Mac/WSL2 terminal - * BASH shell - * installed openstack client ([how?](https://docs.fuga.cloud/how-to-use-the-openstack-cli-tools-on-linux)) - * MetaCentrum OpenStack cloud [group project granted](https://docs.e-infra.cz/compute/openstack/technical-reference/brno-site/get-access/#group-project). - * downloaded application credentials from OpenStack Horizon dashboard ([how?](https://docs.cloud.muni.cz/cloud/cli/#getting-credentials)) and store as text file `project_openrc.sh.inc`. - -## How to use the script -```sh -# in bash shell -source project_openrc.sh.inc -EXTRA_VOLUME_SIZE_GB=10 ./cmdline-demo.sh basic-infrastructure-1 -``` -See [linked reference execution](./cmdline-demo.sh.log). - -## Infrastructure schema -How does the basic infrastructure looks like? -* single VM (ubuntu-jammy) - * VM firewall opening port 22 - * VM SSH keypair generated locally and pubkey uploaded to cloud - * attached additional volume (size 10GB) -* private subnet and network -* router to external internet -* public floating ip address - - diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/commandline/cmdline-demo.sh b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/commandline/cmdline-demo.sh deleted file mode 100755 index e791e0d4dc0a5f9b05275aff81ecdbee2f9d59f7..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/commandline/cmdline-demo.sh +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/env bash -# general group project command-line demo -# Usage: cmdline-demo.sh [ostack-entities-prefix/profile-name] -# - -SCRIPT_DIR=$(dirname $(readlink -f $0)) -############################################################################# -# variables -############################################################################# -ENTITIES_PREFIX="${1:-"${USER}_$(hostname)"}" -EXTERNAL_NETWORK_NAME="public-muni-147-251-124-GROUP" -KEYPAIR_NAME="${ENTITIES_PREFIX}-demo-keypair" -NETWORK_NAME="${ENTITIES_PREFIX}-demo-network" -SUBNET_NAME="${ENTITIES_PREFIX}-demo-subnet" -SUBNET_CIDR="${SUBNET_CIDR:-"192.168.0.0/24"}" -SERVER_NAME="${ENTITIES_PREFIX}-demo-server" -FLAVOR_NAME="${FLAVOR_NAME:-"standard.small"}" -IMAGE_NAME="${IMAGE_NAME:-"ubuntu-jammy-x86_64"}" -VM_LOGIN="${VM_LOGIN:-"ubuntu"}" -ROUTER_NAME="${ENTITIES_PREFIX}-demo-router" -FIP_FILE="${ENTITIES_PREFIX}-demo-fip.txt" -SECGROUP_NAME="${ENTITIES_PREFIX}-demo-secgroup" -SSH_KEYPAIR_DIR="${HOME}/.ssh/generated-keypair" -EXTRA_VOLUME_SIZE_GB=${EXTRA_VOLUME_SIZE_GB:-"10"} -EXTRA_VOLUME_NAME="${ENTITIES_PREFIX}-demo-volume" -EXTRA_VOLUME_TYPE="${EXTRA_VOLUME_TYPE:-"ceph-standard"}" -SERVER_CREATE_ADDITIONAL_ARGS="${SERVER_CREATE_ADDITIONAL_ARGS:-""}" -SERVER_EPHEMERAL_DISK_SIZE="${SERVER_EPHEMERAL_DISK_SIZE:-"0"}" -############################################################################# -# functions -############################################################################# -source ${SCRIPT_DIR}/../../../../common/lib.sh.inc - -############################################################################# -# main steps -############################################################################# -log "Using commandline tools:" -report_tools || myexit 1 - -log "Using OpenStack cloud:" -openstack version show | grep identity || myexit 1 -log "In project $(is_personal_project)" - -# delete objects (from previous run) -log "Delete previously created objects in profile ${ENTITIES_PREFIX} (so we start from the nothing)" -delete_objects_group_project - -log "List currently allocated objects (profile ${ENTITIES_PREFIX})" -list_objects - -log_keypress "Create (generate) locally SSH keypair, upload public SSH key to cloud" -mkdir -p ${SSH_KEYPAIR_DIR} -chmod 700 ${SSH_KEYPAIR_DIR} -ssh-keygen -t rsa -b 4096 -f "${SSH_KEYPAIR_DIR}/id_rsa.${KEYPAIR_NAME}" -openstack keypair create --type ssh --public-key "${SSH_KEYPAIR_DIR}/id_rsa.${KEYPAIR_NAME}.pub" "${KEYPAIR_NAME}" -ls -la ${SSH_KEYPAIR_DIR}/id_rsa.${KEYPAIR_NAME}* - -log_keypress "Create cloud security groups (custom VM firewall) to allow outgoing traffic and incomming SSH traffic on port 22" -openstack security group create --description "${ENTITIES_PREFIX} demo default security group" "${SECGROUP_NAME}" -openstack security group rule create --ingress --proto tcp --remote-ip 0.0.0.0/0 --dst-port 22 "${SECGROUP_NAME}" -openstack security group rule create --egress --proto tcp --remote-ip 0.0.0.0/0 --dst-port 1:65535 "${SECGROUP_NAME}" - -log_keypress "Create cloud private network and subnet, so far isolated (CIDR:${SUBNET_CIDR})" -openstack network create "${NETWORK_NAME}" -NETWORK_ID=$(openstack network show "${NETWORK_NAME}" -f value -c id) -openstack subnet create "${SUBNET_NAME}" --network "${NETWORK_ID}" --subnet-range "${SUBNET_CIDR}" - -if [ "${EXTRA_VOLUME_SIZE_GB}" -gt 0 ]; then - log_keypress "Create cloud VM extra volume \"${EXTRA_VOLUME_NAME}\" with following configuration:\n" \ - " size: ${EXTRA_VOLUME_SIZE_GB} GB, volume type: ${EXTRA_VOLUME_TYPE}" - openstack volume create --type "${EXTRA_VOLUME_TYPE}" --size "${EXTRA_VOLUME_SIZE_GB}" ${EXTRA_VOLUME_NAME} -fi - -if [ -n "${SERVER_EPHEMERAL_DISK_SIZE}" -a "${SERVER_EPHEMERAL_DISK_SIZE}" -gt "0" ]; then - SERVER_CREATE_ADDITIONAL_ARGS="${SERVER_CREATE_ADDITIONAL_ARGS} --ephemeral=size=${SERVER_EPHEMERAL_DISK_SIZE}" -fi -log_keypress "Create cloud VM instance \"${SERVER_NAME}\" with following configuration:\n" \ - " flavor: ${FLAVOR_NAME}, image/os: ${IMAGE_NAME}, network: ${NETWORK_NAME}\n" \ - " keypair: ${KEYPAIR_NAME}, sec-group/firewall: ${SECGROUP_NAME})" \ - " additional arguments: ${SERVER_CREATE_ADDITIONAL_ARGS}" -openstack server create --flavor "${FLAVOR_NAME}" --image "${IMAGE_NAME}" \ - --network "${NETWORK_ID}" --key-name "${KEYPAIR_NAME}" \ - --security-group "${SECGROUP_NAME}" ${SERVER_CREATE_ADDITIONAL_ARGS} "${SERVER_NAME}" -SERVER_ID=$(openstack server show "${SERVER_NAME}" -f value -c id) - -log "Wait for VM instance \"${SERVER_NAME}\" being ACTIVE" -vm_wait_for_status "${SERVER_NAME}" "ACTIVE" - -if [ "${EXTRA_VOLUME_SIZE_GB}" -gt 0 ]; then - log_keypress "Attach extra volume \"${EXTRA_VOLUME_NAME}\" (${EXTRA_VOLUME_SIZE_GB} GB) to VM \"${SERVER_NAME}\"" - openstack server add volume ${SERVER_NAME} ${EXTRA_VOLUME_NAME} --device /dev/sdb -fi - -log "Route VM from internal software defined networking outside" -log_keypress " 1] Create route, associate router with external provider network and internal subnet (${SUBNET_CIDR})" -openstack router create "${ROUTER_NAME}" -openstack router set "${ROUTER_NAME}" --external-gateway "${EXTERNAL_NETWORK_NAME}" -openstack router add subnet "${ROUTER_NAME}" "${SUBNET_NAME}" - -log_keypress " 2] Allocate single FIP (floating ip) from external provider network" -FIP=$(openstack floating ip create "${EXTERNAL_NETWORK_NAME}" -f value -c name) -echo "${FIP}" > "${FIP_FILE}" -echo "Obtained public FIP ${FIP}" - -log_keypress " 3] Assign selected FIP with created VM" -openstack server add floating ip "${SERVER_NAME}" "${FIP}" - -log "Test access to the VM server instance" -log_keypress " 1] TCP ping (ncat -z ${FIP} 22)" -test_vm_access "${FIP}" -log_keypress " 2] SSH command (ssh -i ${SSH_KEYPAIR_DIR}/id_rsa.${KEYPAIR_NAME} ${VM_LOGIN}@${FIP})" -ssh-keygen -R ${FIP} &>/dev/null -ssh -i "${SSH_KEYPAIR_DIR}/id_rsa.${KEYPAIR_NAME}" "${VM_LOGIN}@${FIP}" 'echo "";uname -a;uptime' - -log_keypress "Object summary in profile ${ENTITIES_PREFIX}" -list_objects - -log_keypress "Teardown of the objects " \ - "(Interrupt with CTRL-C if you want to keep the created infrastructure and skip its destruction)" -delete_objects_group_project diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/README.md b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/README.md deleted file mode 100644 index 36ef29301e6583ba2b763e63167bd6d68f74b568..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# Terraform demonstration - -This Terraform module creates up to two kind of VMs: - - public facing small bastion VM - - private VM farm - -Cloud-init add following: - - Add ssh keys, disable SSH password auth - - Create partition and filesystemand mount extra data from extra volume - -## Infrastructure schema - -### Two tier infrastructure: public bastion and private VM farm - - - -### Single tier infrastructure: public VM farm - - - -## Create Infrastructure - -1. Clone the repository. -1. Load you OpenStack application credentials to environment variables `source project_openrc.sh.inc` -1. Override any infrastructure variables in [main.tf](main.tf) file if needed. Full set of variables can be found in [modules/2tier_public_bastion_private_vm_farm/variables.tf](modules/2tier_public_bastion_private_vm_farm/variables.tf) or [modules/1tier-public-vm-farm/variables.tf](modules/1tier-public-vm-farm/variables.tf). -1. In the [terraform root directory](/clouds/g1/brno/general/terraform) run following commands to initiate and validate environment - * `terraform init` - * `terraform validate` -1. In the [same directory](/clouds/g1/brno/general/terraform) run commands to deploy cloud infrastructure - * `terraform plan --out plan` - * `terraform apply plan` -1. Once you need to change the infrastructure, first modify the infrastructure declaration and repeat above steps to deploy changes. -1. Similarly for resource teardown, once you want to clean-up cloud resources issue `terraform destroy`. - - -Detailed terminal transcript can be found in [terminal-transcript.log](./terminal-transcript.log). - - -## Access to the VM nodes - -In single tier infrastructure you access directly the individual VM nodes via SSH on public IP addresses. -Two tier infrastructure requires the access following way: -1. Establish the connection with bastion -```sh -sshuttle -r ubuntu@<bastion-ip> -``` -1. Connect directly to VM nodes via SSH on private IP addresses: -```sh -ssh ubuntu@<vm-node-ip-from-10.10.10.0/24> -``` diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/main.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/main.tf deleted file mode 100644 index a92b3e605ca9f94c588cbb11c2ccd4c4ca4d96a0..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/main.tf +++ /dev/null @@ -1,21 +0,0 @@ -terraform { - backend "local" {} -} - -module "toplevel" { - # two tier infrastructure (2tier_public_bastion_private_vm_farm module): - # * single public facing tiny bastion VM - # * <nodes_count> private HPC VM farm - source = "./modules/2tier_public_bastion_private_vm_farm" - # single tier infrastructure (1tier_public_vm_farm monule) - # * <nodes_count> public HPC VM farm - #source = "./modules/1tier_public_vm_farm" - - infra_name = "general-tf-demo" - - nodes_count = 2 - nodes_extra_volume_size = 20 # in GB - - #nodes_flavor = "standard.medium" - #nodes_image = "ubuntu-jammy-x86_64" -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/instances.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/instances.tf deleted file mode 120000 index 1b0affe75dec19d734fca77cad9c11ace98c3ed8..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/instances.tf +++ /dev/null @@ -1 +0,0 @@ -../common/instances.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/keypair.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/keypair.tf deleted file mode 120000 index 77516d3e7806eb2637f74b83653fecbf63d490f9..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/keypair.tf +++ /dev/null @@ -1 +0,0 @@ -../common/keypair.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/networks.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/networks.tf deleted file mode 120000 index 09f02c14eabbdd83d5441fd2f735cb7cd9437258..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/networks.tf +++ /dev/null @@ -1 +0,0 @@ -../common/networks.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/nodes-cloudinit.txt b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/nodes-cloudinit.txt deleted file mode 120000 index cd96cf14a086f7a1ee2a9190b9f9379311d148f4..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/nodes-cloudinit.txt +++ /dev/null @@ -1 +0,0 @@ -../common/nodes-cloudinit.txt \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/nodes-networks.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/nodes-networks.tf deleted file mode 100644 index b97a8d6ef5bf6dc81f42bf42e2663024cbc5a980..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/nodes-networks.tf +++ /dev/null @@ -1,11 +0,0 @@ -# Floating IPs -resource "openstack_networking_floatingip_v2" "nodes_fips" { - count = var.nodes_count - pool = var.public_external_network -} - -resource "openstack_compute_floatingip_associate_v2" "nodes_fips_associations" { - count = var.nodes_count - floating_ip = element(openstack_networking_floatingip_v2.nodes_fips.*.address, count.index) - instance_id = element(openstack_compute_instance_v2.nodes.*.id, count.index) -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/providers.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/providers.tf deleted file mode 120000 index 4b272fc455489e11a6b6570233567d2f234a0878..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/providers.tf +++ /dev/null @@ -1 +0,0 @@ -../common/providers.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/secgroup_rules.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/secgroup_rules.tf deleted file mode 120000 index b8efc8637cfbf34b857abcdadca20bc45f0b7430..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/secgroup_rules.tf +++ /dev/null @@ -1 +0,0 @@ -../common/secgroup_rules.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/variables.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/variables.tf deleted file mode 100644 index c7238f086813874ba08687790e68c1681d854391..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/variables.tf +++ /dev/null @@ -1,81 +0,0 @@ -variable "infra_name" { - description = "Infrastructure (profile) name. Used as a name prefix. Must match [a-zA-Z0-9-]+ regexp." - default = "general-tf-demo" -} - -variable "ssh_public_key" { - default = "~/.ssh/id_rsa.pub" -} - - -######################### -# master nodes settings # -######################### - -variable "nodes_count" { - default = 1 -} - -variable "nodes_name" { - description = "Name of the nodes. Must match [a-zA-Z0-9-]+ regexp." - default = "server" -} - -variable "bastion_name" { - description = "Name of the bastion VM. Must match [a-zA-Z0-9-]+ regexp." - default = "bastion-server" -} - -variable "bastion_flavor" { - default = "standard.small" -} - -variable "nodes_flavor" { - default = "standard.large" -} - - -variable "int_network" { - description = "Internal network address, use CIDR notation" - default = "10.10.10.0/24" -} - -variable "public_external_network" { - description = "Cloud public external network pool" - default = "public-cesnet-195-113-167-GROUP" -} - - -variable "bastion_image" { - description = "Bastion OS: Image name" - default = "ubuntu-jammy-x86_64" -} - -variable "nodes_image" { - description = "nodes OS: Image name" - default = "ubuntu-jammy-x86_64" -} - -variable "bastion_ssh_user_name" { - default = "ubuntu" -} - -variable "nodes_ssh_user_name" { - default = "ubuntu" -} - - -variable "nodes_volume_size" { - description = "The size of the volume to create (in gigabytes) for root filesystem. " - default = "10" -} - -variable "nodes_extra_volume_size" { - description = "The size of the volume to create (in gigabytes) for extra data." - default = "10" -} - -variable "nodes_extra_volume_type" { - description = "The type of extra volume." - default = "ceph-standard" -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/volumes.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/volumes.tf deleted file mode 120000 index cfca71e1a757c5785a365745fc26c3c1c3c038bd..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/1tier_public_vm_farm/volumes.tf +++ /dev/null @@ -1 +0,0 @@ -../common/volumes.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/bastion-cloudinit.txt b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/bastion-cloudinit.txt deleted file mode 100644 index 13818fd8f5f2c90a7cf36e7e272c4e75c72edaeb..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/bastion-cloudinit.txt +++ /dev/null @@ -1,7 +0,0 @@ -users: - - default - - name: ubuntu - shell: /bin/bash - ssh_authorized_keys: - - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC5fFLKPzxna7fq6kh1CHaIQFnpqXybqLqGs4ZpTDbIrEn7xjCsdyxMm9dcptyS0t6BzXO56BlJyYsR1GWo4rp3g8rMmb9u6/oHmMwgn7G/GLgsaAAO5XHW0A3UEJl3JHfCQLHkN1APQ4dy7gNTG24ahH/pcyr4rV0SsjPUCqFqkSMDZxRgfllNGftxWVHR2fYfPALLrGdhR/SjNSIs3pwBIUXaSfF3aBLsjeGBj4y5YsiR9yI3y2gUmpURROofTvtE7Fp8OIgmWCVqRe70CKDbl17HFbz3FIqYwZLAQHILcp1M45zV8koSOjW5+3C/ZJYzBKOnw/a/1Cw3uHFDrZfRqKLMP/gagnoEPRHjfmUsJ3UJO0eXDCXmnH7F48xBI76CgxYl039/SMmJ2mR0KqAHGnwqVmJI3yBGyK+Z4iEwk+JVDLEB14RHiMp2/I/tYpDWFE1IOigFFNLdfaZrVFY1/fD+yGGyFUO1Wo+CKb8tpndLB4H3Yj2MLRDP/aNpLC4M7Aru7hWnUF81aE/VUAqR6CP2vsHzlAOmH08pOlP9FVITinmJqzBL15l+W7q0Rhh4WBRO4ixlrtRJDNL2wm0vf+GiJnXligFtZ7Cw8bk/LcAe37WqcTl0xLKDyPSw4SvWOC2aE6BVuJjPAhoUUcBaNzoBa7lf4eb+FS4tquTZlQ== freznicek@LenovoThinkCentreE73 -ssh_pwauth: false diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/bastion-instance.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/bastion-instance.tf deleted file mode 100644 index 4aad5371fd76a15e0567960432230daa9980482e..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/bastion-instance.tf +++ /dev/null @@ -1,13 +0,0 @@ -resource "openstack_compute_instance_v2" "bastion" { - name = "${var.infra_name}-${var.bastion_name}" - image_name = var.bastion_image - flavor_name = var.bastion_flavor - key_pair = openstack_compute_keypair_v2.pubkey.name - security_groups = [openstack_networking_secgroup_v2.secgroup_default.name] - user_data = "#cloud-config\nhostname: ${var.infra_name}-${var.bastion_name}.local\n${file("${path.module}/bastion-cloudinit.txt")}" - - network { - uuid = openstack_networking_network_v2.network_default.id - port = openstack_networking_port_v2.bastion_port.id - } -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/bastion-networks.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/bastion-networks.tf deleted file mode 100644 index c7962e107fc13a10755d1ef22494f94e05fbf205..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/bastion-networks.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Floating IPs (only for bastion node) -resource "openstack_networking_floatingip_v2" "bastion_fip" { - pool = var.public_external_network -} - -resource "openstack_compute_floatingip_associate_v2" "bastion_fip_associate" { - floating_ip = openstack_networking_floatingip_v2.bastion_fip.address - instance_id = openstack_compute_instance_v2.bastion.id -} - -# Ports -resource "openstack_networking_port_v2" "bastion_port" { - name = "${var.infra_name}-${var.bastion_name}-port" - network_id = openstack_networking_network_v2.network_default.id - admin_state_up = "true" - security_group_ids = [openstack_networking_secgroup_v2.secgroup_default.id] - fixed_ip { - subnet_id = openstack_networking_subnet_v2.subnet_default.id - } -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/instances.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/instances.tf deleted file mode 120000 index 1b0affe75dec19d734fca77cad9c11ace98c3ed8..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/instances.tf +++ /dev/null @@ -1 +0,0 @@ -../common/instances.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/keypair.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/keypair.tf deleted file mode 120000 index 77516d3e7806eb2637f74b83653fecbf63d490f9..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/keypair.tf +++ /dev/null @@ -1 +0,0 @@ -../common/keypair.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/networks.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/networks.tf deleted file mode 120000 index 09f02c14eabbdd83d5441fd2f735cb7cd9437258..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/networks.tf +++ /dev/null @@ -1 +0,0 @@ -../common/networks.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/nodes-cloudinit.txt b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/nodes-cloudinit.txt deleted file mode 120000 index cd96cf14a086f7a1ee2a9190b9f9379311d148f4..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/nodes-cloudinit.txt +++ /dev/null @@ -1 +0,0 @@ -../common/nodes-cloudinit.txt \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/providers.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/providers.tf deleted file mode 120000 index 4b272fc455489e11a6b6570233567d2f234a0878..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/providers.tf +++ /dev/null @@ -1 +0,0 @@ -../common/providers.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/secgroup_rules.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/secgroup_rules.tf deleted file mode 120000 index b8efc8637cfbf34b857abcdadca20bc45f0b7430..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/secgroup_rules.tf +++ /dev/null @@ -1 +0,0 @@ -../common/secgroup_rules.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/variables.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/variables.tf deleted file mode 100644 index c7238f086813874ba08687790e68c1681d854391..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/variables.tf +++ /dev/null @@ -1,81 +0,0 @@ -variable "infra_name" { - description = "Infrastructure (profile) name. Used as a name prefix. Must match [a-zA-Z0-9-]+ regexp." - default = "general-tf-demo" -} - -variable "ssh_public_key" { - default = "~/.ssh/id_rsa.pub" -} - - -######################### -# master nodes settings # -######################### - -variable "nodes_count" { - default = 1 -} - -variable "nodes_name" { - description = "Name of the nodes. Must match [a-zA-Z0-9-]+ regexp." - default = "server" -} - -variable "bastion_name" { - description = "Name of the bastion VM. Must match [a-zA-Z0-9-]+ regexp." - default = "bastion-server" -} - -variable "bastion_flavor" { - default = "standard.small" -} - -variable "nodes_flavor" { - default = "standard.large" -} - - -variable "int_network" { - description = "Internal network address, use CIDR notation" - default = "10.10.10.0/24" -} - -variable "public_external_network" { - description = "Cloud public external network pool" - default = "public-cesnet-195-113-167-GROUP" -} - - -variable "bastion_image" { - description = "Bastion OS: Image name" - default = "ubuntu-jammy-x86_64" -} - -variable "nodes_image" { - description = "nodes OS: Image name" - default = "ubuntu-jammy-x86_64" -} - -variable "bastion_ssh_user_name" { - default = "ubuntu" -} - -variable "nodes_ssh_user_name" { - default = "ubuntu" -} - - -variable "nodes_volume_size" { - description = "The size of the volume to create (in gigabytes) for root filesystem. " - default = "10" -} - -variable "nodes_extra_volume_size" { - description = "The size of the volume to create (in gigabytes) for extra data." - default = "10" -} - -variable "nodes_extra_volume_type" { - description = "The type of extra volume." - default = "ceph-standard" -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/volumes.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/volumes.tf deleted file mode 120000 index cfca71e1a757c5785a365745fc26c3c1c3c038bd..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/2tier_public_bastion_private_vm_farm/volumes.tf +++ /dev/null @@ -1 +0,0 @@ -../common/volumes.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/common/instances.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/common/instances.tf deleted file mode 100644 index 82aa9fe251287cd0f36b4f56944e4f8768d51c55..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/common/instances.tf +++ /dev/null @@ -1,31 +0,0 @@ -#################### -# Define instances # -#################### - -data "openstack_images_image_v2" "nodes_image" { - name = var.nodes_image -} - -resource "openstack_compute_instance_v2" "nodes" { - count = var.nodes_count - name = "${var.infra_name}-${var.nodes_name}-${count.index+1}" - image_name = var.nodes_image - flavor_name = var.nodes_flavor - key_pair = openstack_compute_keypair_v2.pubkey.name - security_groups = [openstack_networking_secgroup_v2.secgroup_default.name] - user_data = "#cloud-config\nhostname: ${var.infra_name}-${var.nodes_name}-${count.index+1}.local\n${file("${path.module}/nodes-cloudinit.txt")}" - - network { - uuid = openstack_networking_network_v2.network_default.id - port = element(openstack_networking_port_v2.nodes_ports.*.id, count.index) - } - - block_device { - uuid = data.openstack_images_image_v2.nodes_image.id - source_type = "image" - volume_size = var.nodes_volume_size - destination_type = "local" - boot_index = 0 - delete_on_termination = true - } -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/common/keypair.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/common/keypair.tf deleted file mode 100644 index d52e2d66b33fa9e3410d84befbe2314a86c8f544..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/common/keypair.tf +++ /dev/null @@ -1,6 +0,0 @@ - -resource "openstack_compute_keypair_v2" "pubkey" { - name = "${var.infra_name}-keypair" - public_key = file("${var.ssh_public_key}") -} - diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/common/networks.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/common/networks.tf deleted file mode 100644 index 641864a441b6ac575051de8b6cc92338cec3aaaf..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/common/networks.tf +++ /dev/null @@ -1,38 +0,0 @@ -resource "openstack_networking_network_v2" "network_default" { - name = "${var.infra_name}_network" - admin_state_up = "true" -} - -resource "openstack_networking_subnet_v2" "subnet_default" { - name = "${var.infra_name}_subnet" - network_id = openstack_networking_network_v2.network_default.id - cidr = var.int_network - ip_version = 4 - dns_nameservers = ["1.1.1.1", "8.8.8.8"] -} - -data "openstack_networking_network_v2" "external_network" { - name = var.public_external_network -} - -resource "openstack_networking_router_v2" "router_default" { - name = "${var.infra_name}_infra-test" - admin_state_up = "true" - external_network_id = data.openstack_networking_network_v2.external_network.id -} - -resource "openstack_networking_router_interface_v2" "router_default_interface" { - router_id = openstack_networking_router_v2.router_default.id - subnet_id = openstack_networking_subnet_v2.subnet_default.id -} - -resource "openstack_networking_port_v2" "nodes_ports" { - count = var.nodes_count - name = "${var.infra_name}_${var.nodes_name}_port_${count.index+1}" - network_id = openstack_networking_network_v2.network_default.id - admin_state_up = "true" - security_group_ids = [openstack_networking_secgroup_v2.secgroup_default.id] - fixed_ip { - subnet_id = openstack_networking_subnet_v2.subnet_default.id - } -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/common/nodes-cloudinit.txt b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/common/nodes-cloudinit.txt deleted file mode 100644 index 29457ead3618aa7b77dadb1b41f054dd4280442c..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/common/nodes-cloudinit.txt +++ /dev/null @@ -1,21 +0,0 @@ -users: - - default - - name: ubuntu - shell: /bin/bash - ssh_authorized_keys: - - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC5fFLKPzxna7fq6kh1CHaIQFnpqXybqLqGs4ZpTDbIrEn7xjCsdyxMm9dcptyS0t6BzXO56BlJyYsR1GWo4rp3g8rMmb9u6/oHmMwgn7G/GLgsaAAO5XHW0A3UEJl3JHfCQLHkN1APQ4dy7gNTG24ahH/pcyr4rV0SsjPUCqFqkSMDZxRgfllNGftxWVHR2fYfPALLrGdhR/SjNSIs3pwBIUXaSfF3aBLsjeGBj4y5YsiR9yI3y2gUmpURROofTvtE7Fp8OIgmWCVqRe70CKDbl17HFbz3FIqYwZLAQHILcp1M45zV8koSOjW5+3C/ZJYzBKOnw/a/1Cw3uHFDrZfRqKLMP/gagnoEPRHjfmUsJ3UJO0eXDCXmnH7F48xBI76CgxYl039/SMmJ2mR0KqAHGnwqVmJI3yBGyK+Z4iEwk+JVDLEB14RHiMp2/I/tYpDWFE1IOigFFNLdfaZrVFY1/fD+yGGyFUO1Wo+CKb8tpndLB4H3Yj2MLRDP/aNpLC4M7Aru7hWnUF81aE/VUAqR6CP2vsHzlAOmH08pOlP9FVITinmJqzBL15l+W7q0Rhh4WBRO4ixlrtRJDNL2wm0vf+GiJnXligFtZ7Cw8bk/LcAe37WqcTl0xLKDyPSw4SvWOC2aE6BVuJjPAhoUUcBaNzoBa7lf4eb+FS4tquTZlQ== freznicek@LenovoThinkCentreE73 -disk_setup: - /dev/sdb: - table_type: gpt - layout: true - overwrite: true -fs_setup: -- label: extra_data - filesystem: ext4 - device: /dev/sdb1 - cmd: mkfs -t %(filesystem)s -L %(label)s %(device)s -runcmd: - - mkdir -p /mnt/data -mounts: - - ["/dev/sdb1", "/mnt/data"] -ssh_pwauth: false diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/common/providers.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/common/providers.tf deleted file mode 100644 index 411e68d2f037e32cb6c42beed58affa79a819964..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/common/providers.tf +++ /dev/null @@ -1,8 +0,0 @@ -terraform { - required_providers { - openstack = { - source = "terraform-provider-openstack/openstack" - version = "~> 1.51.1" - } - } -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/common/secgroup_rules.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/common/secgroup_rules.tf deleted file mode 100644 index 1d4da810fc06110b5486ed101d67ad46671e40d7..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/common/secgroup_rules.tf +++ /dev/null @@ -1,82 +0,0 @@ -################################## -# Define Network Security Groups # -################################## - - -resource "openstack_networking_secgroup_v2" "secgroup_default" { - name = "${var.infra_name}_security_group" - description = "${var.infra_name} Security group" -} - - -# Allow all internal TCP & UDP - -/* resource "openstack_networking_secgroup_rule_v2" "secgroup_rule_alltcp4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "tcp" - port_range_min = 1 - port_range_max = 65535 - remote_ip_prefix = var.int_network - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} - -resource "openstack_networking_secgroup_rule_v2" "secgroup_rule_alludp4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "udp" - port_range_min = 1 - port_range_max = 65535 - remote_ip_prefix = var.int_network - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} */ - - -# External communication -# HTTP(S) - -resource "openstack_networking_secgroup_rule_v2" "secgroup_rule_https4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "tcp" - port_range_min = 443 - port_range_max = 443 - remote_ip_prefix = "0.0.0.0/0" - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} - -resource "openstack_networking_secgroup_rule_v2" "secgroup_rule_http4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "tcp" - port_range_min = 80 - port_range_max = 80 - remote_ip_prefix = "0.0.0.0/0" - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} - - - -# ICMP - -resource "openstack_networking_secgroup_rule_v2" "secgroup_rule_icmp4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "icmp" - port_range_min = 0 - port_range_max = 0 - remote_ip_prefix = "0.0.0.0/0" - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} - -# SSH - -resource "openstack_networking_secgroup_rule_v2" "secgroup_rule_ssh4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "tcp" - port_range_min = 22 - port_range_max = 22 - remote_ip_prefix = "0.0.0.0/0" - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/common/volumes.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/common/volumes.tf deleted file mode 100644 index d7bc3b03be84a4f8b942327e10d74adb1778a2f8..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/general/terraform/modules/common/volumes.tf +++ /dev/null @@ -1,14 +0,0 @@ -# extra volume -resource "openstack_blockstorage_volume_v3" "nodes_extra_volumes" { - count = var.nodes_count - name = "${var.infra_name}-extra-volume-${count.index+1}" - size = var.nodes_extra_volume_size - volume_type = var.nodes_extra_volume_type -} - -resource "openstack_compute_volume_attach_v2" "nodes_extra_volumes_attachments" { - count = var.nodes_count - instance_id = element(openstack_compute_instance_v2.nodes.*.id, count.index) - volume_id = element(openstack_blockstorage_volume_v3.nodes_extra_volumes.*.id, count.index) - device = "/dev/sdb" -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/README.md b/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/README.md deleted file mode 100644 index e3551583c9ae03528539d77247bb969a8ef6cdaf..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/README.md +++ /dev/null @@ -1,149 +0,0 @@ -# meta-metaseminar-hands-on-2023-04-28 Infrastructure as Code demo - -There are presented two simple approaches: - * [infrastructure using terraform (best practice)](./terraform_group_project) - * [infrastructure using command-line openstack client](./commandline) - - -## Hands-on container - -```sh -docker pull registry.gitlab.ics.muni.cz:443/246254/metaseminar-hands-on-2023-04-28/hands-on-tools:latest -``` - -## Hands-on Horizon - -Using the OpenStack personal project. - -### 1. Generate SSH keypair -You may need to have testing SSH key pair -```sh -# docker run -it --rm registry.gitlab.ics.muni.cz:443/246254/metaseminar-hands-on-2023-04-28/hands-on-tools:latest - -# generate in-container ssh keypair -ssh-keygen -t rsa -b 4096 -cat ~/.ssh/id_rsa.pub -``` - -### 2. [Horizon UI login](https://dashboard.cloud.muni.cz) -### 3. Register new SSH pubkey ([Compute -> Key Pairs](https://dashboard.cloud.muni.cz/project/key_pairs)) -### 4. Create VM ([Compute -> Instances -> Launch instance](https://dashboard.cloud.muni.cz/project/instances/)) -1. Details subpage: Specify Instance name. -1. Source subpage: Select boot source image or existing bootable volume. -1. Flavor subpage: Pick one of available (standard) flavors. -1. Networks subpage: Pick one of the pre-created personal project networks. 147-251-115-pers-proj-net -1. Network ports subpage: skip -1. Security groups subpage: Pick default. -1. Key Pair subpage: Pick created above keypair. -1. Configuration subpage allows to define cloud-init configuration. Skip and Launch instance. - -### 5. VM inspection Compute -> Instances -> Pick instance - -* Overview - * Name & ID - * Spec i.e. flavor - * Security Groups, verify existing ingress rules - * Volumes attached -* Interfaces - * selected network -* (Console) Log - * inspect cloud-init modifications - -### 6. Associating FIP public IPv4 address - -### 7. Associating public IPv6 address - -### 8. Generating Application Credentials ([Identity -> Application Credentials](https://dashboard.cloud.muni.cz/identity/application_credentials/)) - - -## Hands-on command-line client in group project - -```sh -# docker run -it --rm registry.gitlab.ics.muni.cz:443/246254/metaseminar-hands-on-2023-04-28/hands-on-tools:latest - -# read-in the openstack credentials -source /tmp/ac/prod-metaseminar-hands-on-2023-04-28-openrc.sh.inc - -# test whether cloud is accessible -openstack version show | grep identity - -cd openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/commandline/ -./cmdline-demo-group-project.sh freznicek-demo # use your own name as custom infrastructure prefix in the single hands-on project -``` - -## Hands-on terraform - -```sh -# docker run -it --rm registry.gitlab.ics.muni.cz:443/246254/metaseminar-hands-on-2023-04-28/hands-on-tools:latest - -# generate in-container ssh keypair, if not done already -[ -e ~/.ssh/id_rsa.pub ] || ssh-keygen -t rsa -b 4096 -cat ~/.ssh/id_rsa.pub -... -# read-in the openstack credentials -source /tmp/ac/prod-metaseminar-hands-on-2023-04-28-openrc.sh.inc - -# test whether cloud is accessible -openstack version show | grep identity - -# enter terraform workspace -cd openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/ - -# change infrastructure prefix -mcedit main.tf # kusername = freznicek - -# initial deploy via terraform -terraform init -terraform validate -terraform plan --out plan -terraform apply plan - -# login to VM -ncat -z <ip-address> 22 -ssh ubuntu@<ip-address> - -# doublecheck in horizon in meta-metaseminar-hands-on-2023-04-28 project -# https://dashboard.cloud.muni.cz - -# scaling 1->3 VMs -# https://gitlab.ics.muni.cz/cloud/g2/openstack-infrastructure-as-code-automation/-/blob/8c66c1502f2cba26cf9dd51e89c118966ba5e6ed/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/main.tf#L25 -mcedit main.tf # nodes_count = 3 -terraform validate -terraform plan --out plan -terraform apply plan - -# doublecheck in horizon in meta-metaseminar-hands-on-2023-04-28 project -# https://dashboard.cloud.muni.cz - -# delete VM via Horizon, and re-deploy via Horizon -# * point out idential internal IP address -terraform validate && terraform plan --out plan && terraform apply plan - -# scaling 3->1 VMs -# https://gitlab.ics.muni.cz/cloud/g2/openstack-infrastructure-as-code-automation/-/blob/8c66c1502f2cba26cf9dd51e89c118966ba5e6ed/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/main.tf#L25 -mcedit main.tf # nodes_count = 1 -terraform validate && terraform plan --out plan && terraform apply plan - -# doublecheck in horizon in meta-metaseminar-hands-on-2023-04-28 project -# https://dashboard.cloud.muni.cz - -# two disks /dev/sd[ab] -ssh ubuntu@<ip-address> 'lsblk' - -# add additional volume (not enough data) -mcedit main.tf # sdc_volume = 1 -terraform validate && terraform plan --out plan && terraform apply plan - -# two disks /dev/sd[abc] -ssh ubuntu@<ip-address> 'lsblk' - -# remove original volume -mcedit main.tf # sdb_volume = 0 -terraform validate && terraform plan --out plan && terraform apply plan - -# two disks /dev/sd[ac] -ssh ubuntu@<ip-address> 'lsblk' - -# destroy whole infrastructure -terraform destroy -``` diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/commandline/README.md b/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/commandline/README.md deleted file mode 100644 index a4aa7195653c58c1e5c64e02cab6c9438623b3b2..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/commandline/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Build OpenStack infrastructure from command-line using openstack client - -## Pre-requisites - * Linux/Mac/WSL2 terminal - * installed openstack client ([how?](https://docs.fuga.cloud/how-to-use-the-openstack-cli-tools-on-linux)) - * downloaded application credentials from OpenStack Horizon dashboard ([how?](https://docs.cloud.muni.cz/cloud/cli/#getting-credentials)) - - -## How to use the script -```sh -./cmdline-demo-group-project.sh "infrastructure-a" -``` - -## Infrastructure schema - - diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/commandline/cmdline-demo-group-project.sh b/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/commandline/cmdline-demo-group-project.sh deleted file mode 100755 index 4e03c21e01a487e7d292e56335ee71a622efa7b6..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/commandline/cmdline-demo-group-project.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/env bash -# MetaCentrum MCC openstack command-line demo - group projecp -# Usage: cmdline-demo-group-project.sh [ostack-entities-prefix] -# - -SCRIPT_DIR=$(dirname $(readlink -f $0)) -############################################################################# -# variables -############################################################################# -ENTITIES_PREFIX="${1:-"${USER}_$(hostname)"}" -EXTERNAL_NETWORK_NAME="public-muni-147-251-124-GROUP" -KEYPAIR_NAME="${ENTITIES_PREFIX}-demo-keypair" -NETWORK_NAME="${ENTITIES_PREFIX}-demo-network" -SUBNET_NAME="${ENTITIES_PREFIX}-demo-subnet" -SUBNET_CIDR="192.168.0.0/24" -SERVER_NAME="${ENTITIES_PREFIX}-demo-server" -FLAVOR_NAME="standard.small" -IMAGE_NAME="ubuntu-jammy-x86_64" -VM_LOGIN="ubuntu" -ROUTER_NAME="${ENTITIES_PREFIX}-demo-router" -FIP_FILE="fip.txt" -SECGROUP_NAME="${ENTITIES_PREFIX}-demo-secgroup" -SSH_KEYPAIR_DIR="${HOME}/.ssh/generated-keypair" - -############################################################################# -# functions -############################################################################# -source ${SCRIPT_DIR}/../../../../common/lib.sh.inc - -############################################################################# -# main steps -############################################################################# - -# test openstack client version -if ! openstack --version; then - log "Install openstack client (yum / apt install python3-openstackclient)" -fi - -# delete objects (from previous run) -log "Delete previously created objects" -delete_objects_group_project - -log "List currently allocated objects" -list_objects - -log_keypress "Create (generate) locally SSH keypair, upload public SSH key to cloud" -mkdir -p ${SSH_KEYPAIR_DIR} -chmod 700 ${SSH_KEYPAIR_DIR} -ssh-keygen -t rsa -b 4096 -f "${SSH_KEYPAIR_DIR}/id_rsa.${KEYPAIR_NAME}" -openstack keypair create --type ssh --public-key "${SSH_KEYPAIR_DIR}/id_rsa.${KEYPAIR_NAME}.pub" "${KEYPAIR_NAME}" -ls -la ${SSH_KEYPAIR_DIR}/id_rsa.${KEYPAIR_NAME}* - -log_keypress "Create cloud security groups (custom VM firewall) to allow outgoing traffic and incomming SSH traffic on port 22" -openstack security group create --description "${ENTITIES_PREFIX} demo default security group" "${SECGROUP_NAME}" -openstack security group rule create --ingress --proto tcp --remote-ip 0.0.0.0/0 --dst-port 22 "${SECGROUP_NAME}" -openstack security group rule create --egress --proto tcp --remote-ip 0.0.0.0/0 --dst-port 1:65535 "${SECGROUP_NAME}" - -log_keypress "Create cloud private network and subnet, so far isolated (CIDR:${SUBNET_CIDR})" -openstack network create "${NETWORK_NAME}" -NETWORK_ID=$(openstack network show "${NETWORK_NAME}" -f value -c id) -openstack subnet create "${SUBNET_NAME}" --network "${NETWORK_ID}" --subnet-range "${SUBNET_CIDR}" - -log_keypress "Create cloud VM instance \"${SERVER_NAME}\" with following configuration:\n" \ - " flavor: ${FLAVOR_NAME}, image/os: ${IMAGE_NAME}, network: ${NETWORK_NAME}\n" \ - " keypair: ${KEYPAIR_NAME}, sec-group/firewall: ${SECGROUP_NAME})" -openstack server create --flavor "${FLAVOR_NAME}" --image "${IMAGE_NAME}" \ - --network "${NETWORK_ID}" --key-name "${KEYPAIR_NAME}" \ - --security-group "${SECGROUP_NAME}" "${SERVER_NAME}" -SERVER_ID=$(openstack server show "${SERVER_NAME}" -f value -c id) - -log "Wait for VM instance \"${SERVER_NAME}\" being ACTIVE" -vm_wait_for_status "${SERVER_NAME}" "ACTIVE" - -log "Route VM from internal software defined networking outside" -log_keypress " 1] Create route, associate router with external provider network and internal subnet (${SUBNET_CIDR})" -openstack router create "${ROUTER_NAME}" -openstack router set "${ROUTER_NAME}" --external-gateway "${EXTERNAL_NETWORK_NAME}" -openstack router add subnet "${ROUTER_NAME}" "${SUBNET_NAME}" - -log_keypress " 2] Allocate single FIP (floating ip) from external provider network" -FIP=$(openstack floating ip create "${EXTERNAL_NETWORK_NAME}" -f value -c name) -echo "${FIP}" > "${FIP_FILE}" -echo "Obtained public FIP ${FIP}" - -log_keypress " 3] Assign selected FIP with created VM" -openstack server add floating ip "${SERVER_NAME}" "${FIP}" - -log "Test access to the VM server instance" -log_keypress " 1] TCP ping (ncat -z ${FIP} 22)" -test_vm_access "${FIP}" -log_keypress " 2] SSH command (ssh -i ${SSH_KEYPAIR_DIR}/id_rsa.${KEYPAIR_NAME} ${VM_LOGIN}@${FIP})" -ssh-keygen -R ${FIP} &>/dev/null -ssh -i "${SSH_KEYPAIR_DIR}/id_rsa.${KEYPAIR_NAME}" "${VM_LOGIN}@${FIP}" 'echo "";uname -a;uptime' - -log_keypress "Object summary:" -list_objects - -log_keypress "Teardown of the objects" -delete_objects_group_project - diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/commandline/obrazek.png b/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/commandline/obrazek.png deleted file mode 100644 index c866407bf731fac84926cb6e8e2c81ac026dc826..0000000000000000000000000000000000000000 Binary files a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/commandline/obrazek.png and /dev/null differ diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/README.md b/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/README.md deleted file mode 100644 index f525e3301bdf29e3d6ad95b9ef84a44d03505441..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# Build and maintain OpenStack infrastructure from command-line using terraform - -This Terraform module creates simple virtual infrastructure cluster in OpenStack. - -## Pre-requisites - * Linux/Mac/WSL2 terminal - * installed terraform ([how?](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli#install-terraform)) - * downloaded application credentials from OpenStack Horizon dashboard ([how?](https://docs.cloud.muni.cz/cloud/cli/#getting-credentials)) - -## Create Infrastructure - -1. Clone the repository. -1. Load you OpenStack application credentials to environment variables `source ~/conf/prod-meta-cloud-new-openstack-all-roles-openrc.sh` -1. Override any variable if needed. Every variable specified in [modules/infra/variables.tf](modules/infra/variables.tf) can be overridden in the [main.tf](main.tf) file in its *module* section. -1. In the root folder run `terraform init`. -1. In the root folder run `terraform validate`. -1. Run `terraform plan -out plan1` to generate terraform plan. -1. Run `terraform apply "plan1"` to apply the plan. - -## Destroy Infrastructure - -To delete all created resources run the following commands: - -```sh -terraform plan -destroy -out plan1 -terraform apply "plan1" -``` - -## SSH to nodes - -### node with associated FIP -Connecting to master is as easy as `ssh ubuntu@<any-master-ip>` - -### other nodes -Establish SSH VPN to first head node using `sshuttle`. - -```sh -sshuttle -r ubuntu@<any-master-ip> 192.168.0.0/24 -``` - -Connection to any other node is then via SSH VPN (sshuttle) on internal network i.e. `ssh ubuntu@<vm-internal-ip-from-192.168.0.0/24>` diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/main.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/main.tf deleted file mode 100644 index 4b7cc4d2fa8f34fa817c57fee822620608556e3e..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/main.tf +++ /dev/null @@ -1,41 +0,0 @@ -terraform { - backend "local" {} -} - -terraform { - required_providers { - openstack = { - source = "terraform-provider-openstack/openstack" - version = "~> 1.47.0" - } - } -} - - -provider "openstack" { - # auth arguments are read from environment variables (sourced opestack RC file) - auth_url = "https://identity.cloud.muni.cz/v3" -} - - -module "demo" { - source = "./modules/infra" - - # Example of variable override - nodes_count = 1 - kusername = "metacentrum-seminar-hands-on" - public_key = "~/.ssh/id_rsa.pub" - - nodes_flavor = "standard.small" - image = "ubuntu-jammy-x86_64" - - int_network = "192.168.0.0/24" - pool = "public-muni-147-251-124-GROUP" - - # attach additional single volumes - sdb_volume = 1 # 0/1 absent/present - sdb_volume_size = 1 # 1GB - sdc_volume = 0 # 0/1 absent/present - sdc_volume_size = 2 # 2GB -} - diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/cloudinit.txt b/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/cloudinit.txt deleted file mode 100644 index b760d4eb67613269833858fb3bec83579c51d0ad..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/cloudinit.txt +++ /dev/null @@ -1,6 +0,0 @@ -users: - - default - - name: ubuntu - shell: /bin/bash - ssh_authorized_keys: - - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDSS8J5AStswCnf2JQboCyue8JzX5T/Tsg68LasOT3XZkAMelVrjYBIZ/0P858WMTMW5Qc+ebSmbm0eOopuaN9FrZW2ZsaDyzPamAuxseoTkRV+7Oz5NOF0WCYspgLsbMcaQ+F+qrKzMJRLwduhL67inIJVYkgeXY6S1N2wZAEgYUE3jbZrhaGNA1kQf2dJoMtnikrtOB+vyZkLgFRfgjmq+ny5rCM277otFxwCHhm2+jrWtM8lPY6kJ6WcZfg2njdYW3Oda479jMUg28t4pjqmBygKl3MQ9MOVlJkde4Ez5LhTynXMkSPhH5PnzQrfkQMU2YozCNQ2KBiGDdB3Cd2Lqsou32zUk1/sKc+aN1+8jtm+iogpgYxAPwyCh8S/brVbDu9BerowNRMa4Nual/7YKdtwPEClFp34dgV7tvXVcnVF/TtAkJAUtd02Fh9iS2iM9IrC0gkDEBUr0HGY5U83zODf356aVGTE6hs65wsURGAT6z/DvWYZtMLWJB8Y3p7qHGV1N1OHSLDHgjzuhAHI54h8zhjQaiPsH3Yx4324D1ndtJX8DeWkKdzCNARnw8sfIUhCkwbgv0v6ZkDy8yP6jsHjBc89NjB9kNw1dZcnaDLNqGctcCy50BOeciBYC598i0hec2MieoN0Z2E7lbWZps/+0korxtIxp7TzcKfiKw== secureduser@securedhost diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/instances.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/instances.tf deleted file mode 100644 index de02a10795eac09ce404c6d5e472d584582bcae3..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/instances.tf +++ /dev/null @@ -1,20 +0,0 @@ - -#################### -# Define instances # -#################### - -resource "openstack_compute_instance_v2" "nodes" { - count = var.nodes_count - name = "${var.kusername}-${var.nodes_name_prefix}-${count.index+1}" - image_name = var.image - flavor_name = var.nodes_flavor - key_pair = openstack_compute_keypair_v2.pubkey.name - security_groups = [openstack_networking_secgroup_v2.secgroup_default.name] - user_data = "#cloud-config\nhostname: ${var.kusername}-${var.nodes_name_prefix}-${count.index+1}.local\n${file("${path.module}/cloudinit.txt")}" - - network { - uuid = openstack_networking_network_v2.network_default.id - port = element(openstack_networking_port_v2.ports.*.id, count.index) - } - -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/main.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/main.tf deleted file mode 100644 index 9de28ef6fc670b7465f1440abf451ad6cccd8436..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/main.tf +++ /dev/null @@ -1,6 +0,0 @@ - -resource "openstack_compute_keypair_v2" "pubkey" { - name = "${var.kusername}-demo" - public_key = file("${var.public_key}") -} - diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/networks.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/networks.tf deleted file mode 100644 index 7f30c979a1755259a152897db21736e13b7630f2..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/networks.tf +++ /dev/null @@ -1,54 +0,0 @@ -############################################################### -# Define networking # -# Security group rules are in separate file secgroup_rules.tf # -############################################################### - -resource "openstack_networking_network_v2" "network_default" { - name = "${var.kusername}_demo" - admin_state_up = "true" -} - -resource "openstack_networking_subnet_v2" "subnet_default" { - name = "${var.kusername}_demo" - network_id = openstack_networking_network_v2.network_default.id - cidr = var.int_network - ip_version = 4 - dns_nameservers = ["1.1.1.1", "8.8.8.8"] -} - -data "openstack_networking_network_v2" "terraform-demo-external-net" { - name = var.pool -} - -resource "openstack_networking_router_v2" "router_default" { - name = "${var.kusername}_demo" - admin_state_up = "true" - external_network_id = data.openstack_networking_network_v2.terraform-demo-external-net.id -} - -resource "openstack_networking_router_interface_v2" "terraform-demo-router-interface-1" { - router_id = openstack_networking_router_v2.router_default.id - subnet_id = openstack_networking_subnet_v2.subnet_default.id -} - -# Floating IPs (only for single (first) node) -resource "openstack_networking_floatingip_v2" "fip" { - pool = var.pool -} - -resource "openstack_compute_floatingip_associate_v2" "res_fip_associate" { - floating_ip = openstack_networking_floatingip_v2.fip.address - instance_id = openstack_compute_instance_v2.nodes[0].id -} - -# Ports -resource "openstack_networking_port_v2" "ports" { - count = var.nodes_count - name = "${var.kusername}_port_${count.index+1}" - network_id = openstack_networking_network_v2.network_default.id - admin_state_up = "true" - security_group_ids = [openstack_networking_secgroup_v2.secgroup_default.id] - fixed_ip { - subnet_id = openstack_networking_subnet_v2.subnet_default.id - } -} \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/output.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/output.tf deleted file mode 100644 index c40645dd8c9d4b82bfeef453f4227d2f740cbd9c..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/output.tf +++ /dev/null @@ -1,7 +0,0 @@ -output "node_instance_ip" { - value = openstack_compute_instance_v2.nodes[*].access_ip_v4 -} - -output "node_fip" { - value = openstack_networking_floatingip_v2.fip.address -} \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/providers.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/providers.tf deleted file mode 100644 index ef4ba65152b61ce99a5dfe96616724d08fad199b..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/providers.tf +++ /dev/null @@ -1,9 +0,0 @@ -terraform { - required_providers { - openstack = { - source = "terraform-provider-openstack/openstack" - version = "~> 1.47.0" - } - } -} - diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/secgroup_rules.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/secgroup_rules.tf deleted file mode 100644 index 3d04ced43df7bd96881f9abcee8200898b232059..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/secgroup_rules.tf +++ /dev/null @@ -1,57 +0,0 @@ -################################## -# Define Network Security Groups # -################################## - - -resource "openstack_networking_secgroup_v2" "secgroup_default" { - name = "${var.kusername}_demo" - description = "Security group for demo" -} - - -# Allow all internal TCP & UDP - -resource "openstack_networking_secgroup_rule_v2" "alltcp4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "tcp" - port_range_min = 1 - port_range_max = 32768 - remote_ip_prefix = var.int_network - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} - -resource "openstack_networking_secgroup_rule_v2" "alludp4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "udp" - port_range_min = 1 - port_range_max = 32768 - remote_ip_prefix = var.int_network - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} - - -# External communication - -# ICMP -resource "openstack_networking_secgroup_rule_v2" "icmp4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "icmp" - port_range_min = 0 - port_range_max = 0 - remote_ip_prefix = "0.0.0.0/0" - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} - -# SSH -resource "openstack_networking_secgroup_rule_v2" "ssh4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "tcp" - port_range_min = 22 - port_range_max = 22 - remote_ip_prefix = "0.0.0.0/0" - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/variables.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/variables.tf deleted file mode 100644 index 24cf6b3f31ee13a13921d09b15a0a5c1f262c37d..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/variables.tf +++ /dev/null @@ -1,68 +0,0 @@ -variable "kusername" { - description = "Name prefix for all resources. Use a-z, 0-9 and the hyphen (-) only." - default = "demo" -} - -variable "public_key" { - default = "~/.ssh/id_rsa.pub" -} - -################## -# nodes settings # -################## -variable "nodes_count" { - default = 3 -} - -variable "nodes_name_prefix" { - description = "Use a-z, 0-9 and the hyphen (-) only." - default = "" -} - -variable "nodes_flavor" { - default = "hpc.8core-32ram-ssd-ephem" -} - - -variable "int_network" { - description = "Internal network address, use CIDR notation" - default = "10.0.0.0/24" -} - -variable "pool" { - description = "FIP pool" - default = "public-cesnet-195-113-167-GROUP" -} - -variable "image" { - description = "Image used for virtual nodes" - default = "88f8e72a-bbf0-4ccc-8ff2-4f3188cd0d18" -} - -variable "ssh_user_name" { - default = "ubuntu" -} - -######################### -# node volumes -######################### - -variable "sdb_volume" { - description = "Number of volumes added to nodes as /dev/sdb (allowed values: 0 to disable attaching volumes, 1 volume to attach)" - default = 0 -} - -variable "sdb_volume_size" { - description = "Size of volume attached to nodes as /dev/sdb (in GB)" - default = 1 -} - -variable "sdc_volume" { - description = "Number of volumes added to nodes as /dev/sdc (allowed values: 0 to disable attaching volumes, 1 volume to attach)" - default = 0 -} - -variable "sdc_volume_size" { - description = "Size of volume attached to nodes as /dev/sdc (in GB)" - default = 1 -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/volumes.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/volumes.tf deleted file mode 100644 index 26596f632fefff241d489ff7b748d125b69d0519..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/meta-metaseminar-hands-on-2023-04-28/terraform_group_project/modules/infra/volumes.tf +++ /dev/null @@ -1,30 +0,0 @@ - -# B volume[s] -resource "openstack_blockstorage_volume_v3" "volumes_b" { - count = var.sdb_volume > 0 ? var.nodes_count : 0 - name = "${var.kusername}-node-volume-b-${count.index+1}" - size = var.sdb_volume_size -} - -resource "openstack_compute_volume_attach_v2" "volumes_b_attachments" { - count = var.sdb_volume > 0 ? var.nodes_count : 0 - instance_id = element(openstack_compute_instance_v2.nodes.*.id, count.index) - volume_id = element(openstack_blockstorage_volume_v3.volumes_b.*.id, count.index) - device = "/dev/sdb" -} - -# C volume[s] -resource "openstack_blockstorage_volume_v3" "volumes_c" { - count = var.sdc_volume > 0 ? var.nodes_count : 0 - name = "${var.kusername}-node-volume-c-${count.index+1}" - size = var.sdc_volume_size -} - -resource "openstack_compute_volume_attach_v2" "volumes_c_attachments" { - count = var.sdc_volume > 0 ? var.nodes_count : 0 - instance_id = element(openstack_compute_instance_v2.nodes.*.id, count.index) - volume_id = element(openstack_blockstorage_volume_v3.volumes_c.*.id, count.index) - device = "/dev/sdc" -} - - diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/README.md b/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/README.md deleted file mode 100644 index 8968c994a39a0912d51b97bdb3ab25f011f0c071..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Terraform Kubernetes Training - -This Terraform module creates up to 2 kind of VMs (each with different flavor) + 1 bastion with floating IP. - -Cloud-init add following: - - Add ssh keys and password settings for ubuntu user - - Install docker with the correct MTU and pull the image - - Install openstack-cli, source OpenStack application credentials, and download the file from swift - -## Create Infrastructure - -1. Clone the repository. -1. Load you OpenStack application credentials to environment variables `source ~/conf/prod-meta-cloud-new-openstack-all-roles-openrc.sh` -1. Override any variable if needed. Every variable specified in [modules/kube_training/variables.tf](modules/kube_training/variables.tf) can be overridden in the [main.tf](main.tf) file in its *module* section. -1. If create infrastructure for kubespray see [this section](#kubespray) -1. In the root folder run `terraform init`. -1. In the root folder run `terraform validate`. -1. Run `terraform plan -out plan1` to generate terraform plan. -1. Run `terraform apply "plan1"` to apply the plan. - -## Kubespray - -If you want to access kube-api via HA floating IP you need create port with attached floating IP after installation kubernetes via kubespray. - -First, you have to apply infrastructure with `kube_fip = true` and `kube_fip_create_port = false` and after kubespray is installed, change to `kube_fip_create_port = true` and `terraform apply` again. Also, you can set `kube_vip` which has to be a free IP address in the given subnet. - -## Destroy Infrastructure - -To delete all created resources run the following commands: - -``` -terraform plan -destroy -out plan1 -terraform apply "plan1" -``` - -## SSH to Workers - -To connect to worker machines just use `sshuttle`. - -``` -sshuttle -r debian@<any-master-ip> 10.0.0.0/24 -x 147.251.62.9/32 -``` diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/main.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/main.tf deleted file mode 100644 index 6d56f4dce095df7f3ef620f9acb3956b43e8b48d..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/main.tf +++ /dev/null @@ -1,26 +0,0 @@ -terraform { - backend "local" {} -} - -terraform { - required_providers { - openstack = { - source = "terraform-provider-openstack/openstack" - version = "~> 1.51.1" - } - } -} - -module "infra_test" { - source = "./modules/infra_test" - - public_key = "~/.ssh/klaris-tp.pub" - - vm_name = "workshop" - nodes_a_count = 29 - nodes_a_flavor = "hpc.8core-16ram" - nodes_b_count = 18 - nodes_b_flavor = "elixir.8core-16ram" - volume_size = 100 - -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/cloudinit-bastion.txt b/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/cloudinit-bastion.txt deleted file mode 100644 index dcd6138f30d15b37a93ed6f617f8fdb80e42191c..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/cloudinit-bastion.txt +++ /dev/null @@ -1,18 +0,0 @@ -users: - - default - - name: ubuntu - lock_passwd: false - shell: /bin/bash - passwd: '$6$rounds=4096$CVEJGzTk/UGHSJRO$5.gdZHaN58QZke5SKT4O6JgkSmWqlSfUvVNUBuzLt0q3HNKXrTRmSwyM1lh3BlzNiLYkC16QMJDZ83RJHpUCp1' - ssh_authorized_keys: - - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM7qrxujICTwg0TF/u/PuDkl7iPkOSUgqXzn758rMP82 brazdil@ics.muni.cz - - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCqqcqHexsYHlulbyGmfSj4Wmdw53fFB9rCGuaqtVOnIWZRudsQOCeJtF6aZ5Xaf5Qo8kli29aMnQJdSlK4oFJ17weLBSDTn1wvLgkvkiMhxyZ1HP/l448dEWt+ndm5T3ZMxFhe5+cLIf9YeRiv29xTkwd6jOSltbRhzbY6QB7Tpn7LlfcA2JOHSR3vs7xh3mNpYdeKdf5VvO9R0StvstUzxr7ydZtwVkl57SGI6m539040yG63U/xSYCHoR7/quLPSkDgaqzu6SrVG1LKsYY5/02C3F0VDhbiILeiacR6vB6qeOYD0UhlBtNLeR87r+HI3Gwovo3argVQ0sv5GFi/WQ4RTxng/EbTOIVbKRBGgwjfjoZ3MheOKfD4DELegsb3WnMzF1aCYdyDV3n1PbrXfw4Eko0M/qIaOHIUaqMxlLfhrDoKcdhuA9NSxCVm4ZwSXDGnSmjG3yuadco1f8+w1R2vTiqTqBIbSBAOurR0y8Eb6frSOZeHyFYQC6L2WgSgJu3QgfOBi5BydmGRhxOylXVWYmsFx5OnzFDVgOTFhLsiM0CYnWgLeqwaxdVJVoHt1OBgLyrMrYT/0GFK9Th/5QrBWwiR3RpqQPP5veNBzMw+pj6h2eIZwopYqvOC7fAtHjnqh7F0pwmEG32YBjM8THYcT16qGNW7gyQNgQRxoUw== berkas1-thinkpad - - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC5fFLKPzxna7fq6kh1CHaIQFnpqXybqLqGs4ZpTDbIrEn7xjCsdyxMm9dcptyS0t6BzXO56BlJyYsR1GWo4rp3g8rMmb9u6/oHmMwgn7G/GLgsaAAO5XHW0A3UEJl3JHfCQLHkN1APQ4dy7gNTG24ahH/pcyr4rV0SsjPUCqFqkSMDZxRgfllNGftxWVHR2fYfPALLrGdhR/SjNSIs3pwBIUXaSfF3aBLsjeGBj4y5YsiR9yI3y2gUmpURROofTvtE7Fp8OIgmWCVqRe70CKDbl17HFbz3FIqYwZLAQHILcp1M45zV8koSOjW5+3C/ZJYzBKOnw/a/1Cw3uHFDrZfRqKLMP/gagnoEPRHjfmUsJ3UJO0eXDCXmnH7F48xBI76CgxYl039/SMmJ2mR0KqAHGnwqVmJI3yBGyK+Z4iEwk+JVDLEB14RHiMp2/I/tYpDWFE1IOigFFNLdfaZrVFY1/fD+yGGyFUO1Wo+CKb8tpndLB4H3Yj2MLRDP/aNpLC4M7Aru7hWnUF81aE/VUAqR6CP2vsHzlAOmH08pOlP9FVITinmJqzBL15l+W7q0Rhh4WBRO4ixlrtRJDNL2wm0vf+GiJnXligFtZ7Cw8bk/LcAe37WqcTl0xLKDyPSw4SvWOC2aE6BVuJjPAhoUUcBaNzoBa7lf4eb+FS4tquTZlQ== freznicek@LenovoThinkCentreE73 - - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILdXyv/LGi5DkOJtPwBqH7EEyXssxgdWqk2CgNx67Clc 506487@mail.muni.cz - - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDBakpaDhVZXXlrqo3mMQFUkvAYBeoU0fLuUHkiPyWPXeR7EhxQ+H2Gv8kMudqAa9Z+EtAcE80OEdtKJvA+oNgUoeHKtusxKshG4ipL2q9CNtNkGDm8kgwwgAPo2H8n/RGD+JMcGnUsuyroO1/Tjcg8uZJBQJaN3/WrYgYKYq9hms1nWLAg2R+STF0RZN2LLN75YbuM78ZbL+gO3fA3Nod6L17hpBFxHaTICU/P3Ho5duD7RST3YWWJ0Zt4utZ1mO6q+SxLc41ZwL/BDEKWSfRLGovqytjlf12ZYOASH3K4XlJPn22nJm/ji/rwvznDd8zMVnd72ZCgV5D4A3m6RM8EGzgxKXNbY11xIQoOWyCGBfxVi6I8mJWimFRozYZh/TuBoYYJuUCbmYkjk9bUpcrVO30oeMbPBCvtNHy8ojJMkISz/eglBXI0j1FrJZPZYd58idlXm6nWkRpG+wx70SwM0nNHQMBQS0SDWkPFxj0cpWkMZGp/OwsINZBTAX7jGbKkZj3UppAAx0zDfFLBG7TOkwDO6BLNM2cRE983Dg1OtwTEVKajqDtpOYHN9RwWezY4DjdDcnRG5IKYTYDR+Jn5viQfpJbbG4BN1fEWjzPbm8NSkXzn94HFHfizoleycmdWBoBhZT5KBKBgV5GCSv7yIEyv3ezbgV04ZhieqfBCLw== dominik.vasek@ics.muni.cz - - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHzqqUEiju2r72oiaQF4zMI/A/vziXSl7IuviEr2z6eh moravcova - - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEnjIVyeUk12qFbPPu5KvuFJ4xOVZZAp9W1q4oornrc+ klaris@klaris-tp - - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDO9ap8pw3BwGTILl58FipGfDKg9Ao+Milwo/5tNzt08DbxQ9wmL9fP6nwRjJgE8vorVJ+86k+/R3lf3IGcktPgi0n3nYfu8UdVacSSw99Hs/HgfcMEnfwmvelHk1uYGFCNpo98Jrre+nWHFunGYFbTHbdM/bZT8hSB9TaKS4OxedX24aPM2L7GbP83sTXBzoLFNqwkX9s0WnYv2DUnVOKgyoUzJENs1uTfDWNQhYLrivPqrvGEbvYQ0iwaMDSM29m6yJ0I5Ibr5gafz2Cc93wqgQXgBuwZADJ7D0IS7iHinniXMTosbc4ORxhpi8LLWRTJibseOeaP4wucqfAeWkB/yuiWM3BDA5QPGklCXtydlCrropswhfdL66WSvAmVQI7iQbBepg2LPBNhr+0tQeCWfoNXtPBXEm38SG//SzFWYgKIl2eudNLNYTftlbA+++EniiA0YT1kCioW1pd/an5dogPtZimCtPIAwvnC8ukz+M9VTlwPHPG9+OLm2AbwwZjtxqluq8cdcnZN+7os+0TcXdp1hFCxQwhowV6SwyHAW5Y/UBcWpfCjRk5Tfki6RTwMmEujCmD6IzrS3N5xPbAEUB0/qYiSIcFcDejjLF41cD7MSBiowtFCtcDKcIw5iGX441DxCnF87RjAHzczVgt/S5hnHyhm7aYrsF4DY89rfw== radkin@ics.muni.cz -ssh_pwauth: true -runcmd: - - passwd -u ubuntu diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/cloudinit.txt b/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/cloudinit.txt deleted file mode 100644 index b4bc6d76f482ba0a970b029f0450f46a35db39b2..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/cloudinit.txt +++ /dev/null @@ -1,69 +0,0 @@ -users: - - default - - name: ubuntu - lock_passwd: false - shell: /bin/bash - passwd: '$6$rounds=4096$CVEJGzTk/UGHSJRO$5.gdZHaN58QZke5SKT4O6JgkSmWqlSfUvVNUBuzLt0q3HNKXrTRmSwyM1lh3BlzNiLYkC16QMJDZ83RJHpUCp1' - ssh_authorized_keys: - - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM7qrxujICTwg0TF/u/PuDkl7iPkOSUgqXzn758rMP82 brazdil@ics.muni.cz - - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCqqcqHexsYHlulbyGmfSj4Wmdw53fFB9rCGuaqtVOnIWZRudsQOCeJtF6aZ5Xaf5Qo8kli29aMnQJdSlK4oFJ17weLBSDTn1wvLgkvkiMhxyZ1HP/l448dEWt+ndm5T3ZMxFhe5+cLIf9YeRiv29xTkwd6jOSltbRhzbY6QB7Tpn7LlfcA2JOHSR3vs7xh3mNpYdeKdf5VvO9R0StvstUzxr7ydZtwVkl57SGI6m539040yG63U/xSYCHoR7/quLPSkDgaqzu6SrVG1LKsYY5/02C3F0VDhbiILeiacR6vB6qeOYD0UhlBtNLeR87r+HI3Gwovo3argVQ0sv5GFi/WQ4RTxng/EbTOIVbKRBGgwjfjoZ3MheOKfD4DELegsb3WnMzF1aCYdyDV3n1PbrXfw4Eko0M/qIaOHIUaqMxlLfhrDoKcdhuA9NSxCVm4ZwSXDGnSmjG3yuadco1f8+w1R2vTiqTqBIbSBAOurR0y8Eb6frSOZeHyFYQC6L2WgSgJu3QgfOBi5BydmGRhxOylXVWYmsFx5OnzFDVgOTFhLsiM0CYnWgLeqwaxdVJVoHt1OBgLyrMrYT/0GFK9Th/5QrBWwiR3RpqQPP5veNBzMw+pj6h2eIZwopYqvOC7fAtHjnqh7F0pwmEG32YBjM8THYcT16qGNW7gyQNgQRxoUw== berkas1-thinkpad - - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC5fFLKPzxna7fq6kh1CHaIQFnpqXybqLqGs4ZpTDbIrEn7xjCsdyxMm9dcptyS0t6BzXO56BlJyYsR1GWo4rp3g8rMmb9u6/oHmMwgn7G/GLgsaAAO5XHW0A3UEJl3JHfCQLHkN1APQ4dy7gNTG24ahH/pcyr4rV0SsjPUCqFqkSMDZxRgfllNGftxWVHR2fYfPALLrGdhR/SjNSIs3pwBIUXaSfF3aBLsjeGBj4y5YsiR9yI3y2gUmpURROofTvtE7Fp8OIgmWCVqRe70CKDbl17HFbz3FIqYwZLAQHILcp1M45zV8koSOjW5+3C/ZJYzBKOnw/a/1Cw3uHFDrZfRqKLMP/gagnoEPRHjfmUsJ3UJO0eXDCXmnH7F48xBI76CgxYl039/SMmJ2mR0KqAHGnwqVmJI3yBGyK+Z4iEwk+JVDLEB14RHiMp2/I/tYpDWFE1IOigFFNLdfaZrVFY1/fD+yGGyFUO1Wo+CKb8tpndLB4H3Yj2MLRDP/aNpLC4M7Aru7hWnUF81aE/VUAqR6CP2vsHzlAOmH08pOlP9FVITinmJqzBL15l+W7q0Rhh4WBRO4ixlrtRJDNL2wm0vf+GiJnXligFtZ7Cw8bk/LcAe37WqcTl0xLKDyPSw4SvWOC2aE6BVuJjPAhoUUcBaNzoBa7lf4eb+FS4tquTZlQ== freznicek@LenovoThinkCentreE73 - - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILdXyv/LGi5DkOJtPwBqH7EEyXssxgdWqk2CgNx67Clc 506487@mail.muni.cz - - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDBakpaDhVZXXlrqo3mMQFUkvAYBeoU0fLuUHkiPyWPXeR7EhxQ+H2Gv8kMudqAa9Z+EtAcE80OEdtKJvA+oNgUoeHKtusxKshG4ipL2q9CNtNkGDm8kgwwgAPo2H8n/RGD+JMcGnUsuyroO1/Tjcg8uZJBQJaN3/WrYgYKYq9hms1nWLAg2R+STF0RZN2LLN75YbuM78ZbL+gO3fA3Nod6L17hpBFxHaTICU/P3Ho5duD7RST3YWWJ0Zt4utZ1mO6q+SxLc41ZwL/BDEKWSfRLGovqytjlf12ZYOASH3K4XlJPn22nJm/ji/rwvznDd8zMVnd72ZCgV5D4A3m6RM8EGzgxKXNbY11xIQoOWyCGBfxVi6I8mJWimFRozYZh/TuBoYYJuUCbmYkjk9bUpcrVO30oeMbPBCvtNHy8ojJMkISz/eglBXI0j1FrJZPZYd58idlXm6nWkRpG+wx70SwM0nNHQMBQS0SDWkPFxj0cpWkMZGp/OwsINZBTAX7jGbKkZj3UppAAx0zDfFLBG7TOkwDO6BLNM2cRE983Dg1OtwTEVKajqDtpOYHN9RwWezY4DjdDcnRG5IKYTYDR+Jn5viQfpJbbG4BN1fEWjzPbm8NSkXzn94HFHfizoleycmdWBoBhZT5KBKBgV5GCSv7yIEyv3ezbgV04ZhieqfBCLw== dominik.vasek@ics.muni.cz - - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHzqqUEiju2r72oiaQF4zMI/A/vziXSl7IuviEr2z6eh moravcova - - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEnjIVyeUk12qFbPPu5KvuFJ4xOVZZAp9W1q4oornrc+ klaris@klaris-tp - - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDO9ap8pw3BwGTILl58FipGfDKg9Ao+Milwo/5tNzt08DbxQ9wmL9fP6nwRjJgE8vorVJ+86k+/R3lf3IGcktPgi0n3nYfu8UdVacSSw99Hs/HgfcMEnfwmvelHk1uYGFCNpo98Jrre+nWHFunGYFbTHbdM/bZT8hSB9TaKS4OxedX24aPM2L7GbP83sTXBzoLFNqwkX9s0WnYv2DUnVOKgyoUzJENs1uTfDWNQhYLrivPqrvGEbvYQ0iwaMDSM29m6yJ0I5Ibr5gafz2Cc93wqgQXgBuwZADJ7D0IS7iHinniXMTosbc4ORxhpi8LLWRTJibseOeaP4wucqfAeWkB/yuiWM3BDA5QPGklCXtydlCrropswhfdL66WSvAmVQI7iQbBepg2LPBNhr+0tQeCWfoNXtPBXEm38SG//SzFWYgKIl2eudNLNYTftlbA+++EniiA0YT1kCioW1pd/an5dogPtZimCtPIAwvnC8ukz+M9VTlwPHPG9+OLm2AbwwZjtxqluq8cdcnZN+7os+0TcXdp1hFCxQwhowV6SwyHAW5Y/UBcWpfCjRk5Tfki6RTwMmEujCmD6IzrS3N5xPbAEUB0/qYiSIcFcDejjLF41cD7MSBiowtFCtcDKcIw5iGX441DxCnF87RjAHzczVgt/S5hnHyhm7aYrsF4DY89rfw== radkin@ics.muni.cz -packages: - - apt-transport-https - - ca-certificates - - curl - - gnupg - - lsb-release - - unattended-upgrades - - python3-pip - - python3-minimal -runcmd: - - /opt/script.sh -write_files: - - path: /etc/docker/daemon.json - permissions: '0644' - content: | - { - "mtu": 1442 - } - - path: /opt/script.sh - permissions: '0755' - content: | - #! /bin/bash - passwd -u ubuntu - python3 -mpip install openstackclient - mkdir -p /etc/apt/keyrings - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null - apt-get update - apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin - systemctl enable docker - systemctl start docker - docker pull urgi/docker_vre_aio - mkdir /home/ubuntu/work_dir - wget -P /home/ubuntu/work_dir https://urgi.versailles.inrae.fr/download/repet/banks/REXdb/Viridiplantae_v3.0_ALL_protein-domains_repet_formated.fsa - source /opt/source.sh - openstack object save --file /home/ubuntu/work_dir/AthaChr4.fa repet-workshop AthaChr4.fa - chown -R ubuntu:ubuntu /home/ubuntu/work_dir - - path: /opt/source.sh - permissions: '0664' - content: | - #!/usr/bin/env bash - - export OS_AUTH_TYPE=v3applicationcredential - export OS_AUTH_URL=https://identity.cloud.muni.cz/v3 - export OS_IDENTITY_API_VERSION=3 - export OS_REGION_NAME="brno1" - export OS_INTERFACE=public - export OS_APPLICATION_CREDENTIAL_ID=xxxxxxxxxxxxxxxxxxxxx - export OS_APPLICATION_CREDENTIAL_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -# - path: /etc/ssh/sshd_config.d/sample.conf -# content: | -# PasswordAuthentication yes -# append: true -ssh_pwauth: true \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/instances.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/instances.tf deleted file mode 100644 index de81861bd3136cd561f8fd4bbcf90e9c91c02bb9..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/instances.tf +++ /dev/null @@ -1,65 +0,0 @@ -#################### -# Define instances # -#################### -resource "openstack_compute_instance_v2" "bastion" { - count = var.bastion_count ? 1 : 0 - name = "${var.vm_name}-bastion" - image_id = var.image - flavor_name = var.bastion_flavor - key_pair = openstack_compute_keypair_v2.pubkey.name - security_groups = [openstack_networking_secgroup_v2.secgroup_default.name] - user_data = "#cloud-config\nhostname: ${var.vm_name}-bastion.local\n${file("${path.module}/cloudinit-bastion.txt")}" - - network { - uuid = openstack_networking_network_v2.network_default.id - port = element(openstack_networking_port_v2.bastion_ports.*.id, count.index) - } -} - -resource "openstack_compute_instance_v2" "nodes_a" { - count = var.nodes_a_count - name = "${var.vm_name}-a-${count.index+1}" - image_id = var.image - flavor_name = var.nodes_a_flavor - key_pair = openstack_compute_keypair_v2.pubkey.name - security_groups = [openstack_networking_secgroup_v2.secgroup_default.name] - user_data = "#cloud-config\nhostname: ${var.vm_name}-${count.index+1}.local\n${file("${path.module}/cloudinit.txt")}" - - network { - uuid = openstack_networking_network_v2.network_default.id - port = element(openstack_networking_port_v2.nodes_a_ports.*.id, count.index) - } - - block_device { - uuid = var.image - source_type = "image" - volume_size = var.volume_size - destination_type = "local" - boot_index = 0 - delete_on_termination = true - } -} - -resource "openstack_compute_instance_v2" "nodes_b" { - count = var.nodes_b_count - name = "${var.vm_name}-b-${count.index+1}" - image_id = var.image - flavor_name = var.nodes_b_flavor - key_pair = openstack_compute_keypair_v2.pubkey.name - security_groups = [openstack_networking_secgroup_v2.secgroup_default.name] - user_data = "#cloud-config\nhostname: ${var.vm_name}-${count.index+1}.local\n${file("${path.module}/cloudinit.txt")}" - - network { - uuid = openstack_networking_network_v2.network_default.id - port = element(openstack_networking_port_v2.nodes_b_ports.*.id, count.index) - } - - block_device { - uuid = var.image - source_type = "image" - volume_size = var.volume_size - destination_type = "local" - boot_index = 0 - delete_on_termination = true - } -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/main.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/main.tf deleted file mode 100644 index c5a260b205e59f287907777933654a68242c070e..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/main.tf +++ /dev/null @@ -1,6 +0,0 @@ - -resource "openstack_compute_keypair_v2" "pubkey" { - name = "${var.vm_name}-infra-test" - public_key = file("${var.public_key}") -} - diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/networks.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/networks.tf deleted file mode 100644 index 24a89f41b03932e1c68f2663d7b57b86a211385a..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/networks.tf +++ /dev/null @@ -1,78 +0,0 @@ -############################################################### -# Define networking # -# Security group rules are in separate file secgroup_rules.tf # -############################################################### - -resource "openstack_networking_network_v2" "network_default" { - name = "${var.vm_name}_infra_test" - admin_state_up = "true" -} - -resource "openstack_networking_subnet_v2" "subnet_default" { - name = "${var.vm_name}_infra_test" - network_id = openstack_networking_network_v2.network_default.id - cidr = var.int_network - ip_version = 4 - dns_nameservers = ["1.1.1.1", "8.8.8.8"] -} - -data "openstack_networking_network_v2" "terraform-demo-external-net" { - name = var.pool -} - -resource "openstack_networking_router_v2" "router_default" { - name = "${var.vm_name}_infra-test" - admin_state_up = "true" - external_network_id = data.openstack_networking_network_v2.terraform-demo-external-net.id -} - -resource "openstack_networking_router_interface_v2" "terraform-demo-router-interface-1" { - router_id = openstack_networking_router_v2.router_default.id - subnet_id = openstack_networking_subnet_v2.subnet_default.id -} - -# Floating IPs (only for bastion node) -resource "openstack_networking_floatingip_v2" "bastion_fip" { - pool = var.pool -} - -resource "openstack_compute_floatingip_associate_v2" "bastion_fip_associate" { - count = var.bastion_count ? 1 : 0 - floating_ip = openstack_networking_floatingip_v2.bastion_fip.address - instance_id = openstack_compute_instance_v2.bastion[0].id -} - -# Ports -resource "openstack_networking_port_v2" "bastion_ports" { - count = var.bastion_count ? 1 : 0 - name = "${var.vm_name}_bastion_port_${count.index+1}" - network_id = openstack_networking_network_v2.network_default.id - admin_state_up = "true" - security_group_ids = [openstack_networking_secgroup_v2.secgroup_default.id] - fixed_ip { - subnet_id = openstack_networking_subnet_v2.subnet_default.id - } -} - -resource "openstack_networking_port_v2" "nodes_a_ports" { - count = var.nodes_a_count - name = "${var.vm_name}_nodes_a_port_${count.index+1}" - network_id = openstack_networking_network_v2.network_default.id - admin_state_up = "true" - security_group_ids = [openstack_networking_secgroup_v2.secgroup_default.id] - fixed_ip { - subnet_id = openstack_networking_subnet_v2.subnet_default.id - } -} - -resource "openstack_networking_port_v2" "nodes_b_ports" { - count = var.nodes_b_count - name = "${var.vm_name}_nodes_b_port_${count.index+1}" - network_id = openstack_networking_network_v2.network_default.id - admin_state_up = "true" - security_group_ids = [openstack_networking_secgroup_v2.secgroup_default.id] - fixed_ip { - subnet_id = openstack_networking_subnet_v2.subnet_default.id - } -} - diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/output.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/output.tf deleted file mode 100644 index 8a8a332b916121e11f92be2a46fbae9ed7c2d27a..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/output.tf +++ /dev/null @@ -1,23 +0,0 @@ -output "bastion_instance_ip" { - value = openstack_compute_instance_v2.bastion[*].access_ip_v4 -} - -output "bastion_floating_ip" { - value = openstack_compute_floatingip_associate_v2.bastion_fip_associate[*].floating_ip -} - -output "nodes_a_instance_ip" { - value = openstack_compute_instance_v2.nodes_a[*].access_ip_v4 -} - -output "nodes_a_name" { - value = openstack_compute_instance_v2.nodes_a[*].name -} - -output "nodes_b_instance_ip" { - value = openstack_compute_instance_v2.nodes_b[*].access_ip_v4 -} - -output "nodes_b_name" { - value = openstack_compute_instance_v2.nodes_b[*].name -} \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/providers.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/providers.tf deleted file mode 100644 index 411e68d2f037e32cb6c42beed58affa79a819964..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/providers.tf +++ /dev/null @@ -1,8 +0,0 @@ -terraform { - required_providers { - openstack = { - source = "terraform-provider-openstack/openstack" - version = "~> 1.51.1" - } - } -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/secgroup_rules.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/secgroup_rules.tf deleted file mode 100644 index 877e39385e65d7f52767b0d810b5d30c6346c792..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/secgroup_rules.tf +++ /dev/null @@ -1,96 +0,0 @@ -################################## -# Define Network Security Groups # -################################## - - -resource "openstack_networking_secgroup_v2" "secgroup_default" { - name = "${var.vm_name}_infra-test" - description = "Security group for Kubernetes demo" -} - - -# Allow all internal TCP & UDP - -/* resource "openstack_networking_secgroup_rule_v2" "alltcp4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "tcp" - port_range_min = 1 - port_range_max = 65535 - remote_ip_prefix = var.int_network - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} - -resource "openstack_networking_secgroup_rule_v2" "alludp4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "udp" - port_range_min = 1 - port_range_max = 65535 - remote_ip_prefix = var.int_network - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} */ - - -# External communication -# HTTP(S) - -resource "openstack_networking_secgroup_rule_v2" "https4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "tcp" - port_range_min = 443 - port_range_max = 443 - remote_ip_prefix = "0.0.0.0/0" - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} - -resource "openstack_networking_secgroup_rule_v2" "http4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "tcp" - port_range_min = 80 - port_range_max = 80 - remote_ip_prefix = "0.0.0.0/0" - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} - - - -# ICMP - -resource "openstack_networking_secgroup_rule_v2" "icmp4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "icmp" - port_range_min = 0 - port_range_max = 0 - remote_ip_prefix = "0.0.0.0/0" - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} - - - -# SSH - -resource "openstack_networking_secgroup_rule_v2" "ssh4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "tcp" - port_range_min = 22 - port_range_max = 22 - remote_ip_prefix = "0.0.0.0/0" - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} - -# LB - -/* resource "openstack_networking_secgroup_rule_v2" "lb4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "tcp" - port_range_min = 6443 - port_range_max = 6443 - remote_ip_prefix = "0.0.0.0/0" - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} */ \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/variables.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/variables.tf deleted file mode 100644 index 8274cfdd3bca0fefc513980add5f28568cf13de5..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/modules/infra_test/variables.tf +++ /dev/null @@ -1,67 +0,0 @@ -variable "vm_name" { - description = "Name prefix for all resources. Use a-z, 0-9 and the hyphen (-) only." - default = "infra-test" -} - -variable "public_key" { - default = "~/.ssh/id_rsa.pub" -} - -######################### -# master nodes settings # -######################### -variable "bastion_count" { - type = bool - default = true -} - -variable "nodes_a_count" { - default = 3 -} - -variable "nodes_b_count" { - default = 3 -} - -variable "nodes_name_prefix" { - description = "Use a-z, 0-9 and the hyphen (-) only." - default = "master" -} - -variable "bastion_flavor" { - default = "elixir.16core-64ram" -} - - -variable "nodes_a_flavor" { - default = "hpc.8core-16ram" -} - -variable "nodes_b_flavor" { - default = "hpc.8core-16ram-ssd-ephem" -} - -variable "int_network" { - description = "Internal network address, use CIDR notation" - default = "10.0.0.0/24" -} - -variable "pool" { - description = "FIP pool" - default = "public-cesnet-195-113-167-GROUP" -} - - -variable "image" { - description = "Image used for both master and worker servers" - default = "88f8e72a-bbf0-4ccc-8ff2-4f3188cd0d18" -} - -variable "ssh_user_name" { - default = "ubuntu" -} - -variable "volume_size" { - description = "The size of the volume to create (in gigabytes). " - default = "50" -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/output.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/output.tf deleted file mode 100644 index 91175aefe3b635db8bc9d9c15444fe250e9b0d1d..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/output.tf +++ /dev/null @@ -1,23 +0,0 @@ -output "b_infra_test_instance_ip_bastion" { - value = module.infra_test.bastion_instance_ip -} - -output "a_infra_test_instance_floating_ip_bastion" { - value = module.infra_test.bastion_floating_ip -} - -output "d_infra_test_instance_ip_a" { - value = module.infra_test.nodes_a_instance_ip -} - -output "c_infra_test_instance_name_a" { - value = module.infra_test.nodes_a_name -} - -output "e_infra_test_instance_name_b" { - value = module.infra_test.nodes_b_name -} - -output "f_infra_test_instance_ip_b" { - value = module.infra_test.nodes_b_instance_ip -} \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/repet_workshop/main.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/repet_workshop/main.tf deleted file mode 100644 index c078674b89f3ed754e812d6c80984ecf933ca1aa..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/repet_workshop/main.tf +++ /dev/null @@ -1,26 +0,0 @@ -terraform { - backend "local" {} -} - -terraform { - required_providers { - openstack = { - source = "terraform-provider-openstack/openstack" - version = "~> 1.51.1" - } - } -} - -module "infra_test" { - source = "./../modules/infra_test" - - public_key = "~/.ssh/klaris-tp.pub" - - vm_name = "repet-workshop" - nodes_a_count = 29 - nodes_a_flavor = "hpc.8core-16ram" - nodes_b_count = 18 - nodes_b_flavor = "elixir.8core-16ram" - volume_size = 100 - -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/repet_workshop/output.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/repet_workshop/output.tf deleted file mode 100644 index a54d6073d737788907d971b269bc3853670998b3..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/repet-workshop/terraform/ost-terraform/repet_workshop/output.tf +++ /dev/null @@ -1,25 +0,0 @@ -output "b_infra_test_instance_ip_bastion" { - value = module.infra_test.bastion_instance_ip -} - -output "a_infra_test_instance_floating_ip_bastion" { - value = module.infra_test.bastion_floating_ip -} - -output "d_infra_test_instance_ip_a" { - value = module.infra_test.nodes_a_instance_ip -} - -output "c_infra_test_instance_name_a" { - value = module.infra_test.nodes_a_name -} - -output "e_infra_test_instance_name_b" { - value = module.infra_test.nodes_b_name -} - -output "f_infra_test_instance_ip_b" { - value = module.infra_test.nodes_b_instance_ip -} - - diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/README.md b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/README.md deleted file mode 100644 index 09bd0c7243e1999eb0fe110ce2918ca3ea182562..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# vo.enes.org IaaS infrastructure demo - -Project `vo.enes.org` in `egi_eu` domain is granted and users may log in to [MetaCentrum OpenStack cloud dashboard](https://cloud.metacentrum.cz/) using EGI Check-in authentication. - -We recommend to build custom cloud infrastructure with Terraform or openstack client rather than using [MetaCentrum OpenStack cloud Horizon UI dashboard](https://dashboard.cloud.muni.cz). - -To use huge amount of block and object storage reserved for the `vo.enes.org` project you need to explicitly use dedicated OpenStack volume type `ceph-extra-ec`. Below demos show in detail how to do so. - -## [Terraform `vo.enes.org` demo](./terraform) - -Terraform `vo.enes.org` demo shows how to automate building highly scalable IaaS infrastructure. - -## [OpenStack client `vo.enes.org` demo](./commandline) - -OpenStack shell script `vo.enes.org` demo shows how to automate small IaaS infrastructure which does not need additional scalability. diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/commandline/README.md b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/commandline/README.md deleted file mode 100644 index 6ad766a273cdb24c3b52c58e2f1575c18eafd3d3..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/commandline/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# Build OpenStack infrastructure from command-line using openstack client - -## Pre-requisites - * Linux/Mac/WSL2 terminal - * BASH shell - * installed openstack client ([how?](https://docs.fuga.cloud/how-to-use-the-openstack-cli-tools-on-linux)) - * MetaCentrum OpenStack cloud [group project granted](https://docs.e-infra.cz/compute/openstack/technical-reference/brno-site/get-access/#group-project). - * downloaded application credentials from OpenStack Horizon dashboard ([how?](https://docs.cloud.muni.cz/cloud/cli/#getting-credentials)) and store as text file `project_openrc.sh.inc`. - -## How to use the script -```sh -# in bash shell -source project_openrc.sh.inc -EXTRA_VOLUME_SIZE_GB=1000 ./cmdline-demo.sh enes-basic-infrastructure-1 -``` -See [linked reference execution](./cmdline-demo.sh.log). - -## Infrastructure schema -How does the basic infrastructure looks like? -* single VM (ubuntu-jammy) - * VM firewall opening port 22 - * VM SSH keypair generated locally and pubkey uploaded to cloud - * attached additional volume from largfe pool (size 1000GB) -* private subnet and network -* router to external internet -* public floating ip address - - diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/commandline/cmdline-demo.sh b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/commandline/cmdline-demo.sh deleted file mode 100755 index bfaa193e0e851e7861b83183749d3a2e29e53b9c..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/commandline/cmdline-demo.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/env bash -# vo.enes.org group project command-line demo -# Usage: cmdline-demo.sh [ostack-entities-prefix/profile-name] -# - -SCRIPT_DIR=$(dirname $(readlink -f $0)) -############################################################################# -# variables -############################################################################# -ENTITIES_PREFIX="${1:-"${USER}_$(hostname)"}" -EXTERNAL_NETWORK_NAME="public-muni-147-251-124-GROUP" -KEYPAIR_NAME="${ENTITIES_PREFIX}-demo-keypair" -NETWORK_NAME="${ENTITIES_PREFIX}-demo-network" -SUBNET_NAME="${ENTITIES_PREFIX}-demo-subnet" -SUBNET_CIDR="${SUBNET_CIDR:-"192.168.0.0/24"}" -SERVER_NAME="${ENTITIES_PREFIX}-demo-server" -FLAVOR_NAME="${FLAVOR_NAME:-"standard.small"}" -IMAGE_NAME="${IMAGE_NAME:-"ubuntu-jammy-x86_64"}" -VM_LOGIN="${VM_LOGIN:-"ubuntu"}" -ROUTER_NAME="${ENTITIES_PREFIX}-demo-router" -FIP_FILE="${ENTITIES_PREFIX}-demo-fip.txt" -SECGROUP_NAME="${ENTITIES_PREFIX}-demo-secgroup" -SSH_KEYPAIR_DIR="${HOME}/.ssh/generated-keypair" -EXTRA_VOLUME_SIZE_GB=${EXTRA_VOLUME_SIZE_GB:-"10"} -EXTRA_VOLUME_NAME="${ENTITIES_PREFIX}-demo-volume" -EXTRA_VOLUME_TYPE="${EXTRA_VOLUME_TYPE:-"ceph-extra-ec"}" - -############################################################################# -# functions -############################################################################# -source ${SCRIPT_DIR}/../../../../common/lib.sh.inc - -############################################################################# -# main steps -############################################################################# -log "Using commandline tools:" -report_tools || myexit 1 - -log "Using OpenStack cloud:" -openstack version show | grep identity || myexit 1 -log "In project $(is_personal_project)" - -# delete objects (from previous run) -log "Delete previously created objects in profile ${ENTITIES_PREFIX} (so we start from the nothing)" -delete_objects_group_project - -log "List currently allocated objects (profile ${ENTITIES_PREFIX})" -list_objects - -log_keypress "Create (generate) locally SSH keypair, upload public SSH key to cloud" -mkdir -p ${SSH_KEYPAIR_DIR} -chmod 700 ${SSH_KEYPAIR_DIR} -ssh-keygen -t rsa -b 4096 -f "${SSH_KEYPAIR_DIR}/id_rsa.${KEYPAIR_NAME}" -openstack keypair create --type ssh --public-key "${SSH_KEYPAIR_DIR}/id_rsa.${KEYPAIR_NAME}.pub" "${KEYPAIR_NAME}" -ls -la ${SSH_KEYPAIR_DIR}/id_rsa.${KEYPAIR_NAME}* - -log_keypress "Create cloud security groups (custom VM firewall) to allow outgoing traffic and incomming SSH traffic on port 22" -openstack security group create --description "${ENTITIES_PREFIX} demo default security group" "${SECGROUP_NAME}" -openstack security group rule create --ingress --proto tcp --remote-ip 0.0.0.0/0 --dst-port 22 "${SECGROUP_NAME}" -openstack security group rule create --egress --proto tcp --remote-ip 0.0.0.0/0 --dst-port 1:65535 "${SECGROUP_NAME}" - -log_keypress "Create cloud private network and subnet, so far isolated (CIDR:${SUBNET_CIDR})" -openstack network create "${NETWORK_NAME}" -NETWORK_ID=$(openstack network show "${NETWORK_NAME}" -f value -c id) -openstack subnet create "${SUBNET_NAME}" --network "${NETWORK_ID}" --subnet-range "${SUBNET_CIDR}" - -if [ "${EXTRA_VOLUME_SIZE_GB}" -gt 0 ]; then - log_keypress "Create cloud VM extra volume \"${EXTRA_VOLUME_NAME}\" with following configuration:\n" \ - " size: ${EXTRA_VOLUME_SIZE_GB} GB, volume type: ${EXTRA_VOLUME_TYPE}" - openstack volume create --type "${EXTRA_VOLUME_TYPE}" --size "${EXTRA_VOLUME_SIZE_GB}" ${EXTRA_VOLUME_NAME} -fi - -log_keypress "Create cloud VM instance \"${SERVER_NAME}\" with following configuration:\n" \ - " flavor: ${FLAVOR_NAME}, image/os: ${IMAGE_NAME}, network: ${NETWORK_NAME}\n" \ - " keypair: ${KEYPAIR_NAME}, sec-group/firewall: ${SECGROUP_NAME})" -openstack server create --flavor "${FLAVOR_NAME}" --image "${IMAGE_NAME}" \ - --network "${NETWORK_ID}" --key-name "${KEYPAIR_NAME}" \ - --security-group "${SECGROUP_NAME}" "${SERVER_NAME}" -SERVER_ID=$(openstack server show "${SERVER_NAME}" -f value -c id) - -log "Wait for VM instance \"${SERVER_NAME}\" being ACTIVE" -vm_wait_for_status "${SERVER_NAME}" "ACTIVE" - -if [ "${EXTRA_VOLUME_SIZE_GB}" -gt 0 ]; then - log_keypress "Attach extra volume \"${EXTRA_VOLUME_NAME}\" (${EXTRA_VOLUME_SIZE_GB} GB) to VM \"${SERVER_NAME}\"" - openstack server add volume ${SERVER_NAME} ${EXTRA_VOLUME_NAME} --device /dev/sdb -fi - -log "Route VM from internal software defined networking outside" -log_keypress " 1] Create route, associate router with external provider network and internal subnet (${SUBNET_CIDR})" -openstack router create "${ROUTER_NAME}" -openstack router set "${ROUTER_NAME}" --external-gateway "${EXTERNAL_NETWORK_NAME}" -openstack router add subnet "${ROUTER_NAME}" "${SUBNET_NAME}" - -log_keypress " 2] Allocate single FIP (floating ip) from external provider network" -FIP=$(openstack floating ip create "${EXTERNAL_NETWORK_NAME}" -f value -c name) -echo "${FIP}" > "${FIP_FILE}" -echo "Obtained public FIP ${FIP}" - -log_keypress " 3] Assign selected FIP with created VM" -openstack server add floating ip "${SERVER_NAME}" "${FIP}" - -log "Test access to the VM server instance" -log_keypress " 1] TCP ping (ncat -z ${FIP} 22)" -test_vm_access "${FIP}" -log_keypress " 2] SSH command (ssh -i ${SSH_KEYPAIR_DIR}/id_rsa.${KEYPAIR_NAME} ${VM_LOGIN}@${FIP})" -ssh-keygen -R ${FIP} &>/dev/null -ssh -i "${SSH_KEYPAIR_DIR}/id_rsa.${KEYPAIR_NAME}" "${VM_LOGIN}@${FIP}" 'echo "";uname -a;uptime' - -log_keypress "Object summary in profile ${ENTITIES_PREFIX}" -list_objects - -log_keypress "Teardown of the objects " \ - "(Interrupt with CTRL-C if you want to keep the created infrastructure and skip its destruction)" -delete_objects_group_project diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/commandline/cmdline-demo.sh.log b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/commandline/cmdline-demo.sh.log deleted file mode 100644 index e1e0a197cb52026fdb1ccf2848a97570c49eb2c6..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/commandline/cmdline-demo.sh.log +++ /dev/null @@ -1,440 +0,0 @@ -# ##################################### -# A. Deploy of the small infrastructure -# ##################################### - -[freznicek@lenovo-t14 commandline 0]$ source ~/conf/prod-egi-freznicek-vo.enes.org-all-roles-openrc.sh.inc -[freznicek@lenovo-t14 commandline 0]$ EXTRA_VOLUME_SIZE_GB=1000 ./cmdline-demo.sh enes-basic-infrastructure-1 - - -Using commandline tools: -openstack --version: - openstack 5.5.0 -bash --version: - GNU bash, verze 5.2.15(1)-release (x86_64-redhat-linux-gnu) -awk -W version: - GNU Awk 5.1.1, API: 3.1 (GNU MPFR 4.1.0-p13, GNU MP 6.2.1) -ssh -V: - OpenSSH_8.8p1, OpenSSL 3.0.8 7 Feb 2023 -which ssh-keygen: - /usr/bin/ssh-keygen -ncat --version: - Ncat: Version 7.93 ( https://nmap.org/ncat ) -grep --version: - grep (GNU grep) 3.7 - - -Using OpenStack cloud: -| brno1 | identity | 3.13 | CURRENT | https://identity.cloud.muni.cz/v3/ | None | None | - - -In project vo.enes.org - - -Delete previously created objects in profile enes-basic-infrastructure-1 (so we start from the nothing) -server volume keypair disconnect-router-from-subnet No Subnet found for enes-basic-infrastructure-1-demo-subnet -router subnet network security-group - - -List currently allocated objects (profile enes-basic-infrastructure-1) - - -Create (generate) locally SSH keypair, upload public SSH key to cloud -... (keypress or wait 2m) -Generating public/private rsa key pair. -/home/freznicek/.ssh/generated-keypair/id_rsa.enes-basic-infrastructure-1-demo-keypair already exists. -Overwrite (y/n)? y -Enter passphrase (empty for no passphrase): -Enter same passphrase again: -Your identification has been saved in /home/freznicek/.ssh/generated-keypair/id_rsa.enes-basic-infrastructure-1-demo-keypair -Your public key has been saved in /home/freznicek/.ssh/generated-keypair/id_rsa.enes-basic-infrastructure-1-demo-keypair.pub -The key fingerprint is: -SHA256:J0ShkvSsXRp8OfxddaVMNEIzBOWqg8Gck4puaGwejso freznicek@lenovo-t14 -The key's randomart image is: -+---[RSA 4096]----+ -| . o..=B.+ =| -| . = + . . * +.| -| o * B . + | -| * O o o . | -| . X S + . | -| . . + + | -|.o. . . o | -|==o . | -|BE. | -+----[SHA256]-----+ -+-------------+------------------------------------------------------------------+ -| Field | Value | -+-------------+------------------------------------------------------------------+ -| created_at | None | -| fingerprint | 95:77:62:76:35:62:10:bc:ce:ba:63:9e:11:cc:8b:7d | -| id | enes-basic-infrastructure-1-demo-keypair | -| is_deleted | None | -| name | enes-basic-infrastructure-1-demo-keypair | -| type | ssh | -| user_id | cbd97591acf3d91e3c32d20558935b4a7196589eb6c46b43879ea38355463ac6 | -+-------------+------------------------------------------------------------------+ --rw-------. 1 freznicek freznicek 3389 22. čen 15.59 /home/freznicek/.ssh/generated-keypair/id_rsa.enes-basic-infrastructure-1-demo-keypair --rw-r--r--. 1 freznicek freznicek 746 22. čen 15.59 /home/freznicek/.ssh/generated-keypair/id_rsa.enes-basic-infrastructure-1-demo-keypair.pub - - -Create cloud security groups (custom VM firewall) to allow outgoing traffic and incomming SSH traffic on port 22 -... (keypress or wait 2m) -+-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ -| Field | Value | -+-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ -| created_at | 2023-06-22T13:59:17Z | -| description | enes-basic-infrastructure-1 demo default security group | -| id | 51f19002-e17c-45f8-b58e-487dfa49850d | -| name | enes-basic-infrastructure-1-demo-secgroup | -| project_id | 786566209a7444f89a561172fa28e117 | -| revision_number | 1 | -| rules | created_at='2023-06-22T13:59:17Z', direction='egress', ethertype='IPv6', id='64c240d5-abc5-416c-a95c-3c6aaa3eea99', updated_at='2023-06-22T13:59:17Z' | -| | created_at='2023-06-22T13:59:17Z', direction='egress', ethertype='IPv4', id='851e4855-ae9d-4eb8-aeef-ce1efef92787', updated_at='2023-06-22T13:59:17Z' | -| stateful | None | -| tags | [] | -| updated_at | 2023-06-22T13:59:17Z | -+-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ -+-------------------------+--------------------------------------+ -| Field | Value | -+-------------------------+--------------------------------------+ -| created_at | 2023-06-22T13:59:19Z | -| description | | -| direction | ingress | -| ether_type | IPv4 | -| id | 900acf50-d045-4ddc-a547-945bbad7d255 | -| name | None | -| port_range_max | 22 | -| port_range_min | 22 | -| project_id | 786566209a7444f89a561172fa28e117 | -| protocol | tcp | -| remote_address_group_id | None | -| remote_group_id | None | -| remote_ip_prefix | 0.0.0.0/0 | -| revision_number | 0 | -| security_group_id | 51f19002-e17c-45f8-b58e-487dfa49850d | -| tags | [] | -| updated_at | 2023-06-22T13:59:19Z | -+-------------------------+--------------------------------------+ -+-------------------------+--------------------------------------+ -| Field | Value | -+-------------------------+--------------------------------------+ -| created_at | 2023-06-22T13:59:21Z | -| description | | -| direction | egress | -| ether_type | IPv4 | -| id | 81861c9f-9700-4aa0-95a1-c8be5cdf0f7e | -| name | None | -| port_range_max | 65535 | -| port_range_min | 1 | -| project_id | 786566209a7444f89a561172fa28e117 | -| protocol | tcp | -| remote_address_group_id | None | -| remote_group_id | None | -| remote_ip_prefix | 0.0.0.0/0 | -| revision_number | 0 | -| security_group_id | 51f19002-e17c-45f8-b58e-487dfa49850d | -| tags | [] | -| updated_at | 2023-06-22T13:59:21Z | -+-------------------------+--------------------------------------+ - - -Create cloud private network and subnet, so far isolated (CIDR:192.168.0.0/24) -... (keypress or wait 2m) -+---------------------------+------------------------------------------+ -| Field | Value | -+---------------------------+------------------------------------------+ -| admin_state_up | UP | -| availability_zone_hints | | -| availability_zones | | -| created_at | 2023-06-22T13:59:26Z | -| description | | -| dns_domain | None | -| id | af3adfbb-45bd-42b2-8287-f1d4a0bbcc80 | -| ipv4_address_scope | None | -| ipv6_address_scope | None | -| is_default | False | -| is_vlan_transparent | None | -| mtu | 1442 | -| name | enes-basic-infrastructure-1-demo-network | -| port_security_enabled | True | -| project_id | 786566209a7444f89a561172fa28e117 | -| provider:network_type | None | -| provider:physical_network | None | -| provider:segmentation_id | None | -| qos_policy_id | None | -| revision_number | 1 | -| router:external | Internal | -| segments | None | -| shared | False | -| status | ACTIVE | -| subnets | | -| tags | | -| updated_at | 2023-06-22T13:59:26Z | -+---------------------------+------------------------------------------+ -+----------------------+-----------------------------------------+ -| Field | Value | -+----------------------+-----------------------------------------+ -| allocation_pools | 192.168.0.2-192.168.0.254 | -| cidr | 192.168.0.0/24 | -| created_at | 2023-06-22T13:59:32Z | -| description | | -| dns_nameservers | | -| dns_publish_fixed_ip | None | -| enable_dhcp | True | -| gateway_ip | 192.168.0.1 | -| host_routes | | -| id | 7fb3bad8-3597-464d-b903-16042190e9b7 | -| ip_version | 4 | -| ipv6_address_mode | None | -| ipv6_ra_mode | None | -| name | enes-basic-infrastructure-1-demo-subnet | -| network_id | af3adfbb-45bd-42b2-8287-f1d4a0bbcc80 | -| prefix_length | None | -| project_id | 786566209a7444f89a561172fa28e117 | -| revision_number | 0 | -| segment_id | None | -| service_types | | -| subnetpool_id | None | -| tags | | -| updated_at | 2023-06-22T13:59:32Z | -+----------------------+-----------------------------------------+ - - -Create cloud VM extra volume "enes-basic-infrastructure-1-demo-volume" with following configuration: - size: 1000 GB, volume type: ceph-extra-ec -... (keypress or wait 2m) -+---------------------+------------------------------------------------------------------+ -| Field | Value | -+---------------------+------------------------------------------------------------------+ -| attachments | [] | -| availability_zone | brno1 | -| bootable | false | -| consistencygroup_id | None | -| created_at | 2023-06-22T13:59:38.000000 | -| description | None | -| encrypted | False | -| id | 30f15a28-fca4-4e8b-97a3-6e94a0d311aa | -| multiattach | False | -| name | enes-basic-infrastructure-1-demo-volume | -| properties | | -| replication_status | None | -| size | 1000 | -| snapshot_id | None | -| source_volid | None | -| status | creating | -| type | ceph-extra-ec | -| updated_at | None | -| user_id | cbd97591acf3d91e3c32d20558935b4a7196589eb6c46b43879ea38355463ac6 | -+---------------------+------------------------------------------------------------------+ - - -Create cloud VM instance "enes-basic-infrastructure-1-demo-server" with following configuration: - flavor: standard.small, image/os: ubuntu-jammy-x86_64, network: enes-basic-infrastructure-1-demo-network - keypair: enes-basic-infrastructure-1-demo-keypair, sec-group/firewall: enes-basic-infrastructure-1-demo-secgroup) -... (keypress or wait 2m) -+-----------------------------+------------------------------------------------------------------+ -| Field | Value | -+-----------------------------+------------------------------------------------------------------+ -| OS-DCF:diskConfig | MANUAL | -| OS-EXT-AZ:availability_zone | | -| OS-EXT-STS:power_state | NOSTATE | -| OS-EXT-STS:task_state | scheduling | -| OS-EXT-STS:vm_state | building | -| OS-SRV-USG:launched_at | None | -| OS-SRV-USG:terminated_at | None | -| accessIPv4 | | -| accessIPv6 | | -| addresses | | -| adminPass | AJg7T929n3kv | -| config_drive | | -| created | 2023-06-22T13:59:43Z | -| flavor | standard.small (57bf9ed0-cd71-4c7c-b886-2a5263d52678) | -| hostId | | -| id | 128f83a5-1f45-4ea0-b0d3-e94adeb85ea3 | -| image | ubuntu-jammy-x86_64 (c2c5952c-b3fa-494d-b6c3-1a6f118acaf7) | -| key_name | enes-basic-infrastructure-1-demo-keypair | -| name | enes-basic-infrastructure-1-demo-server | -| progress | 0 | -| project_id | 786566209a7444f89a561172fa28e117 | -| properties | | -| security_groups | name='51f19002-e17c-45f8-b58e-487dfa49850d' | -| status | BUILD | -| updated | 2023-06-22T13:59:43Z | -| user_id | cbd97591acf3d91e3c32d20558935b4a7196589eb6c46b43879ea38355463ac6 | -| volumes_attached | | -+-----------------------------+------------------------------------------------------------------+ - - -Wait for VM instance "enes-basic-infrastructure-1-demo-server" being ACTIVE -BUILD ACTIVE - - -Attach extra volume "enes-basic-infrastructure-1-demo-volume" (1000 GB) to VM "enes-basic-infrastructure-1-demo-server" -... (keypress or wait 2m) - - -Route VM from internal software defined networking outside - - - 1] Create route, associate router with external provider network and internal subnet (192.168.0.0/24) -... (keypress or wait 2m) -+-------------------------+-----------------------------------------+ -| Field | Value | -+-------------------------+-----------------------------------------+ -| admin_state_up | UP | -| availability_zone_hints | | -| availability_zones | | -| created_at | 2023-06-22T14:00:05Z | -| description | | -| external_gateway_info | null | -| flavor_id | None | -| id | 7d1f193c-a58c-45d7-9e07-9110df10f263 | -| name | enes-basic-infrastructure-1-demo-router | -| project_id | 786566209a7444f89a561172fa28e117 | -| revision_number | 1 | -| routes | | -| status | ACTIVE | -| tags | | -| updated_at | 2023-06-22T14:00:05Z | -+-------------------------+-----------------------------------------+ - - - 2] Allocate single FIP (floating ip) from external provider network -... (keypress or wait 2m) -Obtained public FIP 147.251.124.115 - - - 3] Assign selected FIP with created VM -... (keypress or wait 2m) - - -Test access to the VM server instance - - - 1] TCP ping (ncat -z 147.251.124.115 22) -... (keypress or wait 2m) -.VM accessible 147.251.124.115:22 - - - 2] SSH command (ssh -i /home/freznicek/.ssh/generated-keypair/id_rsa.enes-basic-infrastructure-1-demo-keypair ubuntu@147.251.124.115) -... (keypress or wait 2m) -The authenticity of host '147.251.124.115 (147.251.124.115)' can't be established. -ED25519 key fingerprint is SHA256:CrPlRJWObGzDxRrdh0kalvc2ke6brEXBa4EazcMNroo. -This key is not known by any other names -Are you sure you want to continue connecting (yes/no/[fingerprint])? yes -Warning: Permanently added '147.251.124.115' (ED25519) to the list of known hosts. - -Linux enes-basic-infrastructure-1-demo-server 5.15.0-69-generic #76-Ubuntu SMP Fri Mar 17 17:19:29 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux - 14:00:52 up 0 min, 0 users, load average: 1.39, 0.37, 0.13 - - -Object summary in profile enes-basic-infrastructure-1 -... (keypress or wait 2m) -keypairs: - +--------------------------------------------+-------------------------------------------------+------+ - | Name | Fingerprint | Type | - +--------------------------------------------+-------------------------------------------------+------+ - | enes-basic-infrastructure-1-demo-keypair | 95:77:62:76:35:62:10:bc:ce:ba:63:9e:11:cc:8b:7d | ssh | - +--------------------------------------------+-------------------------------------------------+------+ -networks: - +--------------------------------------+--------------------------------------------+--------------------------------------+ - | ID | Name | Subnets | - +--------------------------------------+--------------------------------------------+--------------------------------------+ - | af3adfbb-45bd-42b2-8287-f1d4a0bbcc80 | enes-basic-infrastructure-1-demo-network | 7fb3bad8-3597-464d-b903-16042190e9b7 | - +--------------------------------------+--------------------------------------------+--------------------------------------+ -subnets: - +--------------------------------------+-------------------------------------------+--------------------------------------+-----------------------+ - | ID | Name | Network | Subnet | - +--------------------------------------+-------------------------------------------+--------------------------------------+-----------------------+ - | 7fb3bad8-3597-464d-b903-16042190e9b7 | enes-basic-infrastructure-1-demo-subnet | af3adfbb-45bd-42b2-8287-f1d4a0bbcc80 | 192.168.0.0/24 | - +--------------------------------------+-------------------------------------------+--------------------------------------+-----------------------+ -routers: - +--------------------------------------+-------------------------------------------+--------+-------+----------------------------------+ - | ID | Name | Status | State | Project | - +--------------------------------------+-------------------------------------------+--------+-------+----------------------------------+ - | 7d1f193c-a58c-45d7-9e07-9110df10f263 | enes-basic-infrastructure-1-demo-router | ACTIVE | UP | 786566209a7444f89a561172fa28e117 | - +--------------------------------------+-------------------------------------------+--------+-------+----------------------------------+ -floating_ips: - +--------------------------------------+---------------------+------------------+--------------------------------------+--------------------------------------+----------------------------------+ - | ID | Floating IP Address | Fixed IP Address | Port | Floating Network | Project | - +--------------------------------------+---------------------+------------------+--------------------------------------+--------------------------------------+----------------------------------+ - | 7556e3c0-6ad9-43cb-9b8d-b227c78e3fc5 | 147.251.124.115 | 192.168.0.242 | c4f6253c-6f51-45a3-9b4a-19701bd1e03b | 8d5e18ab-5d43-4fb5-83e9-eb581c4d5365 | 786566209a7444f89a561172fa28e117 | - +--------------------------------------+---------------------+------------------+--------------------------------------+--------------------------------------+----------------------------------+ -security_groups: - +--------------------------------------+---------------------------------------------+-----------------------------------------------------------+----------------------------------+------+ - | ID | Name | Description | Project | Tags | - +--------------------------------------+---------------------------------------------+-----------------------------------------------------------+----------------------------------+------+ - | 51f19002-e17c-45f8-b58e-487dfa49850d | enes-basic-infrastructure-1-demo-secgroup | enes-basic-infrastructure-1 demo default security group | 786566209a7444f89a561172fa28e117 | [] | - +--------------------------------------+---------------------------------------------+-----------------------------------------------------------+----------------------------------+------+ -volumes: - +--------------------------------------+-------------------------------------------+-----------+------+--------------------------------------------------------------------+ - | ID | Name | Status | Size | Attached to | - +--------------------------------------+-------------------------------------------+-----------+------+--------------------------------------------------------------------+ - | 30f15a28-fca4-4e8b-97a3-6e94a0d311aa | enes-basic-infrastructure-1-demo-volume | in-use | 1000 | Attached to enes-basic-infrastructure-1-demo-server on /dev/sdb | - +--------------------------------------+-------------------------------------------+-----------+------+--------------------------------------------------------------------+ -servers: - +--------------------------------------+-------------------------------------------+--------+-------------------------------------------------------------------------+---------------------+----------------+ - | ID | Name | Status | Networks | Image | Flavor | - +--------------------------------------+-------------------------------------------+--------+-------------------------------------------------------------------------+---------------------+----------------+ - | 128f83a5-1f45-4ea0-b0d3-e94adeb85ea3 | enes-basic-infrastructure-1-demo-server | ACTIVE | enes-basic-infrastructure-1-demo-network=147.251.124.115, 192.168.0.242 | ubuntu-jammy-x86_64 | standard.small | - +--------------------------------------+-------------------------------------------+--------+-------------------------------------------------------------------------+---------------------+----------------+ - - -Teardown of the objects (Interrupt with CTRL-C if you want to keep the created infrastructure and skip its destruction) -... (keypress or wait 2m)^C - - -# #################################################### -# B. Test SSH access and validation dists are attached -# #################################################### - -[freznicek@lenovo-t14 commandline 130]$ ssh -i /home/freznicek/.ssh/generated-keypair/id_rsa.enes-basic-infrastructure-1-demo-keypair ubuntu@147.251.124.115 lsblk -NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS -loop0 7:0 0 63.3M 1 loop /snap/core20/1852 -loop1 7:1 0 111.9M 1 loop /snap/lxd/24322 -loop2 7:2 0 49.8M 1 loop /snap/snapd/18596 -sda 8:0 0 80G 0 disk -├─sda1 8:1 0 79.9G 0 part / -├─sda14 8:14 0 4M 0 part -└─sda15 8:15 0 106M 0 part /boot/efi -sdb 8:16 0 1000G 0 disk - - -# ############################ -# C. Teardown of the resources -# ############################ - -[freznicek@lenovo-t14 commandline 0]$ EXTRA_VOLUME_SIZE_GB=1000 ./cmdline-demo.sh enes-basic-infrastructure-1 - -Using commandline tools: -openstack --version: - openstack 5.5.0 -bash --version: - GNU bash, verze 5.2.15(1)-release (x86_64-redhat-linux-gnu) -awk -W version: - GNU Awk 5.1.1, API: 3.1 (GNU MPFR 4.1.0-p13, GNU MP 6.2.1) -ssh -V: - OpenSSH_8.8p1, OpenSSL 3.0.8 7 Feb 2023 -which ssh-keygen: - /usr/bin/ssh-keygen -ncat --version: - Ncat: Version 7.93 ( https://nmap.org/ncat ) -grep --version: - grep (GNU grep) 3.7 - - -Using OpenStack cloud: -| brno1 | identity | 3.13 | CURRENT | https://identity.cloud.muni.cz/v3/ | None | None | - - -In project vo.enes.org - - -Delete previously created objects in profile enes-basic-infrastructure-1 (so we start from the nothing) -floating-ip server volume keypair disconnect-router-from-subnet router subnet network security-group - - -List currently allocated objects (profile enes-basic-infrastructure-1) - - -Create (generate) locally SSH keypair, upload public SSH key to cloud -... (keypress or wait 2m)^C diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/README.md b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/README.md deleted file mode 100644 index 5efce6ee783ab28649e493e2de939f7c08954445..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# Terraform demonstration - -This Terraform module creates up to two kind of VMs: - - public facing bastion VM - - private HPC VM farm - -Cloud-init add following: - - Add ssh keys, disable SSH password auth - - Create partition and filesystemand mount extra data from extra volume - -## Infrastructure schema - -### Two tier infrastructure: public bastion and private VM farm - - - -### Single tier infrastructure: public VM farm - - - -## Create Infrastructure - -1. Clone the repository. -1. Load you OpenStack application credentials to environment variables `source project_openrc.sh.inc` -1. Override any infrastructure variables in [main.tf](main.tf) file if needed. Full set of variables can be found in [modules/2tier_public_bastion_private_vm_farm/variables.tf](modules/2tier_public_bastion_private_vm_farm/variables.tf) or [modules/1tier-public-vm-farm/variables.tf](modules/1tier-public-vm-farm/variables.tf). -1. In the [terraform root directory](/clouds/g1/brno/vo.enes.org/terraform) run following commands to initiate and validate environment - * `terraform init` - * `terraform validate` -1. In the [same directory](/clouds/g1/brno/vo.enes.org/terraform) run commands to deploy cloud infrastructure - * `terraform plan --out plan` - * `terraform apply plan` -1. Once you need to change the infrastructure, first modify the infrastructure declaration and repeat above steps to deploy changes. -1. Similarly for resource teardown, once you want to clean-up cloud resources issue `terraform destroy`. - - -Detailed terminal transcript can be found in [terminal-transcript.log](./terminal-transcript.log). - - -## Access to the HPC nodes - -In single tier infrastructure you access directly the individual HPC VM nodes via SSH on public IP addresses. -Two tier infrastructure requires the access following way: -1. Establish the connection with bastion -```sh -sshuttle -r ubuntu@<bastion-ip> -``` -1. Connect directly to HPC VM nodes via SSH on private IP addresses: -```sh -ssh ubuntu@<vm-node-ip-from-10.10.10.0/24> -``` diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/main.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/main.tf deleted file mode 100644 index c3ae0ce96a75ba946aad44523a93aaf1674c161f..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/main.tf +++ /dev/null @@ -1,21 +0,0 @@ -terraform { - backend "local" {} -} - -module "toplevel" { - # two tier infrastructure (2tier_public_bastion_private_vm_farm module): - # * single public facing tiny bastion VM - # * <nodes_count> private HPC VM farm - source = "./modules/2tier_public_bastion_private_vm_farm" - # single tier infrastructure (1tier_public_vm_farm monule) - # * <nodes_count> public HPC VM farm - #source = "./modules/1tier_public_vm_farm" - - infra_name = "vo-enes-org-tf-demo" - - nodes_count = 3 - nodes_extra_volume_size = 1000 # in GB - - #nodes_flavor = "hpc.16core-32ram" - #nodes_image = "ubuntu-jammy-x86_64" -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/instances.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/instances.tf deleted file mode 120000 index 1b0affe75dec19d734fca77cad9c11ace98c3ed8..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/instances.tf +++ /dev/null @@ -1 +0,0 @@ -../common/instances.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/keypair.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/keypair.tf deleted file mode 120000 index 77516d3e7806eb2637f74b83653fecbf63d490f9..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/keypair.tf +++ /dev/null @@ -1 +0,0 @@ -../common/keypair.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/networks.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/networks.tf deleted file mode 120000 index 09f02c14eabbdd83d5441fd2f735cb7cd9437258..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/networks.tf +++ /dev/null @@ -1 +0,0 @@ -../common/networks.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/nodes-cloudinit.txt b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/nodes-cloudinit.txt deleted file mode 120000 index cd96cf14a086f7a1ee2a9190b9f9379311d148f4..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/nodes-cloudinit.txt +++ /dev/null @@ -1 +0,0 @@ -../common/nodes-cloudinit.txt \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/nodes-networks.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/nodes-networks.tf deleted file mode 100644 index b97a8d6ef5bf6dc81f42bf42e2663024cbc5a980..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/nodes-networks.tf +++ /dev/null @@ -1,11 +0,0 @@ -# Floating IPs -resource "openstack_networking_floatingip_v2" "nodes_fips" { - count = var.nodes_count - pool = var.public_external_network -} - -resource "openstack_compute_floatingip_associate_v2" "nodes_fips_associations" { - count = var.nodes_count - floating_ip = element(openstack_networking_floatingip_v2.nodes_fips.*.address, count.index) - instance_id = element(openstack_compute_instance_v2.nodes.*.id, count.index) -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/providers.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/providers.tf deleted file mode 120000 index 4b272fc455489e11a6b6570233567d2f234a0878..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/providers.tf +++ /dev/null @@ -1 +0,0 @@ -../common/providers.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/secgroup_rules.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/secgroup_rules.tf deleted file mode 120000 index b8efc8637cfbf34b857abcdadca20bc45f0b7430..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/secgroup_rules.tf +++ /dev/null @@ -1 +0,0 @@ -../common/secgroup_rules.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/variables.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/variables.tf deleted file mode 100644 index ddf43a1df66ac381e1a5e9b474bd8cb8fa94a5b4..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/variables.tf +++ /dev/null @@ -1,81 +0,0 @@ -variable "infra_name" { - description = "Infrastructure (profile) name. Used as a name prefix. Must match [a-zA-Z0-9-]+ regexp." - default = "vo-enes-org-tf-demo" -} - -variable "ssh_public_key" { - default = "~/.ssh/id_rsa.pub" -} - - -######################### -# master nodes settings # -######################### - -variable "nodes_count" { - default = 1 -} - -variable "nodes_name" { - description = "Name of the nodes. Must match [a-zA-Z0-9-]+ regexp." - default = "server" -} - -variable "bastion_name" { - description = "Name of the bastion VM. Must match [a-zA-Z0-9-]+ regexp." - default = "bastion-server" -} - -variable "bastion_flavor" { - default = "standard.small" -} - -variable "nodes_flavor" { - default = "hpc.16core-32ram" -} - - -variable "int_network" { - description = "Internal network address, use CIDR notation" - default = "10.10.10.0/24" -} - -variable "public_external_network" { - description = "Cloud public external network pool" - default = "public-cesnet-195-113-167-GROUP" -} - - -variable "bastion_image" { - description = "Bastion OS: Image name" - default = "ubuntu-jammy-x86_64" -} - -variable "nodes_image" { - description = "nodes OS: Image name" - default = "ubuntu-jammy-x86_64" -} - -variable "bastion_ssh_user_name" { - default = "ubuntu" -} - -variable "nodes_ssh_user_name" { - default = "ubuntu" -} - - -variable "nodes_volume_size" { - description = "The size of the volume to create (in gigabytes) for root filesystem. " - default = "10" -} - -variable "nodes_extra_volume_size" { - description = "The size of the volume to create (in gigabytes) for extra data." - default = "10" -} - -variable "nodes_extra_volume_type" { - description = "The type of extra volume." - default = "ceph-extra-ec" -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/volumes.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/volumes.tf deleted file mode 120000 index cfca71e1a757c5785a365745fc26c3c1c3c038bd..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/1tier_public_vm_farm/volumes.tf +++ /dev/null @@ -1 +0,0 @@ -../common/volumes.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/bastion-cloudinit.txt b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/bastion-cloudinit.txt deleted file mode 100644 index 13818fd8f5f2c90a7cf36e7e272c4e75c72edaeb..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/bastion-cloudinit.txt +++ /dev/null @@ -1,7 +0,0 @@ -users: - - default - - name: ubuntu - shell: /bin/bash - ssh_authorized_keys: - - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC5fFLKPzxna7fq6kh1CHaIQFnpqXybqLqGs4ZpTDbIrEn7xjCsdyxMm9dcptyS0t6BzXO56BlJyYsR1GWo4rp3g8rMmb9u6/oHmMwgn7G/GLgsaAAO5XHW0A3UEJl3JHfCQLHkN1APQ4dy7gNTG24ahH/pcyr4rV0SsjPUCqFqkSMDZxRgfllNGftxWVHR2fYfPALLrGdhR/SjNSIs3pwBIUXaSfF3aBLsjeGBj4y5YsiR9yI3y2gUmpURROofTvtE7Fp8OIgmWCVqRe70CKDbl17HFbz3FIqYwZLAQHILcp1M45zV8koSOjW5+3C/ZJYzBKOnw/a/1Cw3uHFDrZfRqKLMP/gagnoEPRHjfmUsJ3UJO0eXDCXmnH7F48xBI76CgxYl039/SMmJ2mR0KqAHGnwqVmJI3yBGyK+Z4iEwk+JVDLEB14RHiMp2/I/tYpDWFE1IOigFFNLdfaZrVFY1/fD+yGGyFUO1Wo+CKb8tpndLB4H3Yj2MLRDP/aNpLC4M7Aru7hWnUF81aE/VUAqR6CP2vsHzlAOmH08pOlP9FVITinmJqzBL15l+W7q0Rhh4WBRO4ixlrtRJDNL2wm0vf+GiJnXligFtZ7Cw8bk/LcAe37WqcTl0xLKDyPSw4SvWOC2aE6BVuJjPAhoUUcBaNzoBa7lf4eb+FS4tquTZlQ== freznicek@LenovoThinkCentreE73 -ssh_pwauth: false diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/bastion-instance.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/bastion-instance.tf deleted file mode 100644 index 4aad5371fd76a15e0567960432230daa9980482e..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/bastion-instance.tf +++ /dev/null @@ -1,13 +0,0 @@ -resource "openstack_compute_instance_v2" "bastion" { - name = "${var.infra_name}-${var.bastion_name}" - image_name = var.bastion_image - flavor_name = var.bastion_flavor - key_pair = openstack_compute_keypair_v2.pubkey.name - security_groups = [openstack_networking_secgroup_v2.secgroup_default.name] - user_data = "#cloud-config\nhostname: ${var.infra_name}-${var.bastion_name}.local\n${file("${path.module}/bastion-cloudinit.txt")}" - - network { - uuid = openstack_networking_network_v2.network_default.id - port = openstack_networking_port_v2.bastion_port.id - } -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/bastion-networks.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/bastion-networks.tf deleted file mode 100644 index c7962e107fc13a10755d1ef22494f94e05fbf205..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/bastion-networks.tf +++ /dev/null @@ -1,20 +0,0 @@ -# Floating IPs (only for bastion node) -resource "openstack_networking_floatingip_v2" "bastion_fip" { - pool = var.public_external_network -} - -resource "openstack_compute_floatingip_associate_v2" "bastion_fip_associate" { - floating_ip = openstack_networking_floatingip_v2.bastion_fip.address - instance_id = openstack_compute_instance_v2.bastion.id -} - -# Ports -resource "openstack_networking_port_v2" "bastion_port" { - name = "${var.infra_name}-${var.bastion_name}-port" - network_id = openstack_networking_network_v2.network_default.id - admin_state_up = "true" - security_group_ids = [openstack_networking_secgroup_v2.secgroup_default.id] - fixed_ip { - subnet_id = openstack_networking_subnet_v2.subnet_default.id - } -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/instances.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/instances.tf deleted file mode 120000 index 1b0affe75dec19d734fca77cad9c11ace98c3ed8..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/instances.tf +++ /dev/null @@ -1 +0,0 @@ -../common/instances.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/keypair.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/keypair.tf deleted file mode 120000 index 77516d3e7806eb2637f74b83653fecbf63d490f9..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/keypair.tf +++ /dev/null @@ -1 +0,0 @@ -../common/keypair.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/networks.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/networks.tf deleted file mode 120000 index 09f02c14eabbdd83d5441fd2f735cb7cd9437258..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/networks.tf +++ /dev/null @@ -1 +0,0 @@ -../common/networks.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/nodes-cloudinit.txt b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/nodes-cloudinit.txt deleted file mode 120000 index cd96cf14a086f7a1ee2a9190b9f9379311d148f4..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/nodes-cloudinit.txt +++ /dev/null @@ -1 +0,0 @@ -../common/nodes-cloudinit.txt \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/providers.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/providers.tf deleted file mode 120000 index 4b272fc455489e11a6b6570233567d2f234a0878..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/providers.tf +++ /dev/null @@ -1 +0,0 @@ -../common/providers.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/secgroup_rules.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/secgroup_rules.tf deleted file mode 120000 index b8efc8637cfbf34b857abcdadca20bc45f0b7430..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/secgroup_rules.tf +++ /dev/null @@ -1 +0,0 @@ -../common/secgroup_rules.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/variables.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/variables.tf deleted file mode 100644 index ddf43a1df66ac381e1a5e9b474bd8cb8fa94a5b4..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/variables.tf +++ /dev/null @@ -1,81 +0,0 @@ -variable "infra_name" { - description = "Infrastructure (profile) name. Used as a name prefix. Must match [a-zA-Z0-9-]+ regexp." - default = "vo-enes-org-tf-demo" -} - -variable "ssh_public_key" { - default = "~/.ssh/id_rsa.pub" -} - - -######################### -# master nodes settings # -######################### - -variable "nodes_count" { - default = 1 -} - -variable "nodes_name" { - description = "Name of the nodes. Must match [a-zA-Z0-9-]+ regexp." - default = "server" -} - -variable "bastion_name" { - description = "Name of the bastion VM. Must match [a-zA-Z0-9-]+ regexp." - default = "bastion-server" -} - -variable "bastion_flavor" { - default = "standard.small" -} - -variable "nodes_flavor" { - default = "hpc.16core-32ram" -} - - -variable "int_network" { - description = "Internal network address, use CIDR notation" - default = "10.10.10.0/24" -} - -variable "public_external_network" { - description = "Cloud public external network pool" - default = "public-cesnet-195-113-167-GROUP" -} - - -variable "bastion_image" { - description = "Bastion OS: Image name" - default = "ubuntu-jammy-x86_64" -} - -variable "nodes_image" { - description = "nodes OS: Image name" - default = "ubuntu-jammy-x86_64" -} - -variable "bastion_ssh_user_name" { - default = "ubuntu" -} - -variable "nodes_ssh_user_name" { - default = "ubuntu" -} - - -variable "nodes_volume_size" { - description = "The size of the volume to create (in gigabytes) for root filesystem. " - default = "10" -} - -variable "nodes_extra_volume_size" { - description = "The size of the volume to create (in gigabytes) for extra data." - default = "10" -} - -variable "nodes_extra_volume_type" { - description = "The type of extra volume." - default = "ceph-extra-ec" -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/volumes.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/volumes.tf deleted file mode 120000 index cfca71e1a757c5785a365745fc26c3c1c3c038bd..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/2tier_public_bastion_private_vm_farm/volumes.tf +++ /dev/null @@ -1 +0,0 @@ -../common/volumes.tf \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/common/instances.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/common/instances.tf deleted file mode 100644 index 82aa9fe251287cd0f36b4f56944e4f8768d51c55..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/common/instances.tf +++ /dev/null @@ -1,31 +0,0 @@ -#################### -# Define instances # -#################### - -data "openstack_images_image_v2" "nodes_image" { - name = var.nodes_image -} - -resource "openstack_compute_instance_v2" "nodes" { - count = var.nodes_count - name = "${var.infra_name}-${var.nodes_name}-${count.index+1}" - image_name = var.nodes_image - flavor_name = var.nodes_flavor - key_pair = openstack_compute_keypair_v2.pubkey.name - security_groups = [openstack_networking_secgroup_v2.secgroup_default.name] - user_data = "#cloud-config\nhostname: ${var.infra_name}-${var.nodes_name}-${count.index+1}.local\n${file("${path.module}/nodes-cloudinit.txt")}" - - network { - uuid = openstack_networking_network_v2.network_default.id - port = element(openstack_networking_port_v2.nodes_ports.*.id, count.index) - } - - block_device { - uuid = data.openstack_images_image_v2.nodes_image.id - source_type = "image" - volume_size = var.nodes_volume_size - destination_type = "local" - boot_index = 0 - delete_on_termination = true - } -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/common/keypair.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/common/keypair.tf deleted file mode 100644 index d52e2d66b33fa9e3410d84befbe2314a86c8f544..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/common/keypair.tf +++ /dev/null @@ -1,6 +0,0 @@ - -resource "openstack_compute_keypair_v2" "pubkey" { - name = "${var.infra_name}-keypair" - public_key = file("${var.ssh_public_key}") -} - diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/common/networks.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/common/networks.tf deleted file mode 100644 index 641864a441b6ac575051de8b6cc92338cec3aaaf..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/common/networks.tf +++ /dev/null @@ -1,38 +0,0 @@ -resource "openstack_networking_network_v2" "network_default" { - name = "${var.infra_name}_network" - admin_state_up = "true" -} - -resource "openstack_networking_subnet_v2" "subnet_default" { - name = "${var.infra_name}_subnet" - network_id = openstack_networking_network_v2.network_default.id - cidr = var.int_network - ip_version = 4 - dns_nameservers = ["1.1.1.1", "8.8.8.8"] -} - -data "openstack_networking_network_v2" "external_network" { - name = var.public_external_network -} - -resource "openstack_networking_router_v2" "router_default" { - name = "${var.infra_name}_infra-test" - admin_state_up = "true" - external_network_id = data.openstack_networking_network_v2.external_network.id -} - -resource "openstack_networking_router_interface_v2" "router_default_interface" { - router_id = openstack_networking_router_v2.router_default.id - subnet_id = openstack_networking_subnet_v2.subnet_default.id -} - -resource "openstack_networking_port_v2" "nodes_ports" { - count = var.nodes_count - name = "${var.infra_name}_${var.nodes_name}_port_${count.index+1}" - network_id = openstack_networking_network_v2.network_default.id - admin_state_up = "true" - security_group_ids = [openstack_networking_secgroup_v2.secgroup_default.id] - fixed_ip { - subnet_id = openstack_networking_subnet_v2.subnet_default.id - } -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/common/nodes-cloudinit.txt b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/common/nodes-cloudinit.txt deleted file mode 100644 index 29457ead3618aa7b77dadb1b41f054dd4280442c..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/common/nodes-cloudinit.txt +++ /dev/null @@ -1,21 +0,0 @@ -users: - - default - - name: ubuntu - shell: /bin/bash - ssh_authorized_keys: - - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC5fFLKPzxna7fq6kh1CHaIQFnpqXybqLqGs4ZpTDbIrEn7xjCsdyxMm9dcptyS0t6BzXO56BlJyYsR1GWo4rp3g8rMmb9u6/oHmMwgn7G/GLgsaAAO5XHW0A3UEJl3JHfCQLHkN1APQ4dy7gNTG24ahH/pcyr4rV0SsjPUCqFqkSMDZxRgfllNGftxWVHR2fYfPALLrGdhR/SjNSIs3pwBIUXaSfF3aBLsjeGBj4y5YsiR9yI3y2gUmpURROofTvtE7Fp8OIgmWCVqRe70CKDbl17HFbz3FIqYwZLAQHILcp1M45zV8koSOjW5+3C/ZJYzBKOnw/a/1Cw3uHFDrZfRqKLMP/gagnoEPRHjfmUsJ3UJO0eXDCXmnH7F48xBI76CgxYl039/SMmJ2mR0KqAHGnwqVmJI3yBGyK+Z4iEwk+JVDLEB14RHiMp2/I/tYpDWFE1IOigFFNLdfaZrVFY1/fD+yGGyFUO1Wo+CKb8tpndLB4H3Yj2MLRDP/aNpLC4M7Aru7hWnUF81aE/VUAqR6CP2vsHzlAOmH08pOlP9FVITinmJqzBL15l+W7q0Rhh4WBRO4ixlrtRJDNL2wm0vf+GiJnXligFtZ7Cw8bk/LcAe37WqcTl0xLKDyPSw4SvWOC2aE6BVuJjPAhoUUcBaNzoBa7lf4eb+FS4tquTZlQ== freznicek@LenovoThinkCentreE73 -disk_setup: - /dev/sdb: - table_type: gpt - layout: true - overwrite: true -fs_setup: -- label: extra_data - filesystem: ext4 - device: /dev/sdb1 - cmd: mkfs -t %(filesystem)s -L %(label)s %(device)s -runcmd: - - mkdir -p /mnt/data -mounts: - - ["/dev/sdb1", "/mnt/data"] -ssh_pwauth: false diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/common/providers.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/common/providers.tf deleted file mode 100644 index 411e68d2f037e32cb6c42beed58affa79a819964..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/common/providers.tf +++ /dev/null @@ -1,8 +0,0 @@ -terraform { - required_providers { - openstack = { - source = "terraform-provider-openstack/openstack" - version = "~> 1.51.1" - } - } -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/common/secgroup_rules.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/common/secgroup_rules.tf deleted file mode 100644 index 1d4da810fc06110b5486ed101d67ad46671e40d7..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/common/secgroup_rules.tf +++ /dev/null @@ -1,82 +0,0 @@ -################################## -# Define Network Security Groups # -################################## - - -resource "openstack_networking_secgroup_v2" "secgroup_default" { - name = "${var.infra_name}_security_group" - description = "${var.infra_name} Security group" -} - - -# Allow all internal TCP & UDP - -/* resource "openstack_networking_secgroup_rule_v2" "secgroup_rule_alltcp4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "tcp" - port_range_min = 1 - port_range_max = 65535 - remote_ip_prefix = var.int_network - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} - -resource "openstack_networking_secgroup_rule_v2" "secgroup_rule_alludp4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "udp" - port_range_min = 1 - port_range_max = 65535 - remote_ip_prefix = var.int_network - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} */ - - -# External communication -# HTTP(S) - -resource "openstack_networking_secgroup_rule_v2" "secgroup_rule_https4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "tcp" - port_range_min = 443 - port_range_max = 443 - remote_ip_prefix = "0.0.0.0/0" - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} - -resource "openstack_networking_secgroup_rule_v2" "secgroup_rule_http4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "tcp" - port_range_min = 80 - port_range_max = 80 - remote_ip_prefix = "0.0.0.0/0" - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} - - - -# ICMP - -resource "openstack_networking_secgroup_rule_v2" "secgroup_rule_icmp4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "icmp" - port_range_min = 0 - port_range_max = 0 - remote_ip_prefix = "0.0.0.0/0" - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} - -# SSH - -resource "openstack_networking_secgroup_rule_v2" "secgroup_rule_ssh4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "tcp" - port_range_min = 22 - port_range_max = 22 - remote_ip_prefix = "0.0.0.0/0" - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/common/volumes.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/common/volumes.tf deleted file mode 100644 index d7bc3b03be84a4f8b942327e10d74adb1778a2f8..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/modules/common/volumes.tf +++ /dev/null @@ -1,14 +0,0 @@ -# extra volume -resource "openstack_blockstorage_volume_v3" "nodes_extra_volumes" { - count = var.nodes_count - name = "${var.infra_name}-extra-volume-${count.index+1}" - size = var.nodes_extra_volume_size - volume_type = var.nodes_extra_volume_type -} - -resource "openstack_compute_volume_attach_v2" "nodes_extra_volumes_attachments" { - count = var.nodes_count - instance_id = element(openstack_compute_instance_v2.nodes.*.id, count.index) - volume_id = element(openstack_blockstorage_volume_v3.nodes_extra_volumes.*.id, count.index) - device = "/dev/sdb" -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/output.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/output.tf deleted file mode 100644 index 744094a36e9df34feff5b8e67adfb5a3bc7d1ed6..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/output.tf +++ /dev/null @@ -1,25 +0,0 @@ -/* -output "toplevel_instance_ip_bastion" { - value = module.toplevel.bastion_instance_ip -} - -output "toplevel_instance_floating_ip_bastion" { - value = module.toplevel.bastion_floating_ip -} - - -output "d_infra_test_instance_ip_a" { - value = module.toplevel.nodes_a_instance_ip -} - -output "c_infra_test_instance_name_a" { - value = module.toplevel.nodes_a_name -} - -output "e_infra_test_instance_name_b" { - value = module.toplevel.nodes_b_name -} - -output "f_infra_test_instance_ip_b" { - value = module.toplevel.nodes_b_instance_ip -}*/ \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/terminal-transcript.log b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/terminal-transcript.log deleted file mode 100644 index c12674e2127aa885038732fd364a91d014e9dd38..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.enes.org/terraform/terminal-transcript.log +++ /dev/null @@ -1,1434 +0,0 @@ -# A. Check command-line tools - -[freznicek@lenovo-t14 terraform 0]$ openstack --version -openstack 5.5.0 -[freznicek@lenovo-t14 terraform 0]$ terraform version -Terraform v1.5.0 -on linux_amd64 -+ provider registry.terraform.io/terraform-provider-openstack/openstack v1.51.1 - -Your version of Terraform is out of date! The latest version -is 1.5.1. You can update by downloading from https://www.terraform.io/downloads.html -[freznicek@lenovo-t14 terraform 0]$ ssh -V -OpenSSH_8.8p1, OpenSSL 3.0.8 7 Feb 2023 -[freznicek@lenovo-t14 terraform 0]$ sshuttle --version -1.1.0 - - -# B. Prepare infrastructure (main.tf) - -# log into vo.enes.org OpenStack project -[freznicek@lenovo-t14 terraform 0]$ source ~/conf/prod-egi-freznicek-vo.enes.org-all-roles-openrc.sh.inc # project_openrc.sh.inc - -[freznicek@lenovo-t14 terraform 0]$ cat main.tf -terraform { - backend "local" {} -} - -module "toplevel" { - # two tier infrastructure (2tier_public_bastion_private_vm_farm module): - # * single public facing tiny bastion VM - # * N private HPC VM farm - source = "./modules/2tier_public_bastion_private_vm_farm" - - infra_name = "vo-enes-org-tf-demo" - - nodes_count = 3 - nodes_extra_volume_size = 1000 # in GB - - #bastion_flavor = "standard.medium" - #bastion_image = "ubuntu-jammy-x86_64" - #nodes_flavor = "hpc.16core-32ram" - #nodes_image = "ubuntu-jammy-x86_64" -} - -# C. Validate terraform environment (init+validate) - -[freznicek@lenovo-t14 terraform 1]$ terraform init - -Initializing the backend... -Initializing modules... - -Initializing provider plugins... -- Reusing previous version of terraform-provider-openstack/openstack from the dependency lock file -- Using previously-installed terraform-provider-openstack/openstack v1.51.1 - -Terraform has been successfully initialized! - -You may now begin working with Terraform. Try running "terraform plan" to see -any changes that are required for your infrastructure. All Terraform commands -should now work. - -If you ever set or change modules or backend configuration for Terraform, -rerun this command to reinitialize your working directory. If you forget, other -commands will detect it and remind you to do so if necessary. - -[freznicek@lenovo-t14 terraform 0]$ terraform validate -Success! The configuration is valid. - - -# D. Deploy infrastructure (plan+apply) - -[freznicek@lenovo-t14 terraform 0]$ terraform plan --out plan -module.toplevel.data.openstack_networking_network_v2.external_network: Reading... -module.toplevel.data.openstack_images_image_v2.nodes_image: Reading... -module.toplevel.data.openstack_images_image_v2.nodes_image: Read complete after 1s [id=bf08651f-047f-402a-9c9f-8fe415bffb89] -module.toplevel.data.openstack_networking_network_v2.external_network: Read complete after 1s [id=9edb9ab8-8742-49e3-9461-528f31397672] - -Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: - + create - -Terraform will perform the following actions: - - # module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[0] will be created - + resource "openstack_blockstorage_volume_v3" "nodes_extra_volumes" { - + attachment = (known after apply) - + availability_zone = (known after apply) - + id = (known after apply) - + metadata = (known after apply) - + name = "vo-enes-org-tf-demo-extra-volume-1" - + region = (known after apply) - + size = 1000 - + volume_type = "ceph-extra-rep" - } - - # module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[1] will be created - + resource "openstack_blockstorage_volume_v3" "nodes_extra_volumes" { - + attachment = (known after apply) - + availability_zone = (known after apply) - + id = (known after apply) - + metadata = (known after apply) - + name = "vo-enes-org-tf-demo-extra-volume-2" - + region = (known after apply) - + size = 1000 - + volume_type = "ceph-extra-rep" - } - - # module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[2] will be created - + resource "openstack_blockstorage_volume_v3" "nodes_extra_volumes" { - + attachment = (known after apply) - + availability_zone = (known after apply) - + id = (known after apply) - + metadata = (known after apply) - + name = "vo-enes-org-tf-demo-extra-volume-3" - + region = (known after apply) - + size = 1000 - + volume_type = "ceph-extra-rep" - } - - # module.toplevel.openstack_compute_floatingip_associate_v2.bastion_fip_associate will be created - + resource "openstack_compute_floatingip_associate_v2" "bastion_fip_associate" { - + floating_ip = (known after apply) - + id = (known after apply) - + instance_id = (known after apply) - + region = (known after apply) - } - - # module.toplevel.openstack_compute_instance_v2.bastion will be created - + resource "openstack_compute_instance_v2" "bastion" { - + access_ip_v4 = (known after apply) - + access_ip_v6 = (known after apply) - + all_metadata = (known after apply) - + all_tags = (known after apply) - + availability_zone = (known after apply) - + created = (known after apply) - + flavor_id = (known after apply) - + flavor_name = "standard.medium" - + force_delete = false - + id = (known after apply) - + image_id = (known after apply) - + image_name = "ubuntu-jammy-x86_64" - + key_pair = "vo-enes-org-tf-demo-keypair" - + name = "vo-enes-org-tf-demo-bastion-server" - + power_state = "active" - + region = (known after apply) - + security_groups = [ - + "vo-enes-org-tf-demo_security_group", - ] - + stop_before_destroy = false - + updated = (known after apply) - + user_data = "a3a49ba4d021dc7ea72f930700b21701d957ddd6" - - + network { - + access_network = false - + fixed_ip_v4 = (known after apply) - + fixed_ip_v6 = (known after apply) - + floating_ip = (known after apply) - + mac = (known after apply) - + name = (known after apply) - + port = (known after apply) - + uuid = (known after apply) - } - } - - # module.toplevel.openstack_compute_instance_v2.nodes[0] will be created - + resource "openstack_compute_instance_v2" "nodes" { - + access_ip_v4 = (known after apply) - + access_ip_v6 = (known after apply) - + all_metadata = (known after apply) - + all_tags = (known after apply) - + availability_zone = (known after apply) - + created = (known after apply) - + flavor_id = (known after apply) - + flavor_name = "hpc.16core-32ram" - + force_delete = false - + id = (known after apply) - + image_id = (known after apply) - + image_name = "ubuntu-jammy-x86_64" - + key_pair = "vo-enes-org-tf-demo-keypair" - + name = "vo-enes-org-tf-demo-server-1" - + power_state = "active" - + region = (known after apply) - + security_groups = [ - + "vo-enes-org-tf-demo_security_group", - ] - + stop_before_destroy = false - + updated = (known after apply) - + user_data = "8d4565d32104990f59352f6ea5c69e398c356e26" - - + block_device { - + boot_index = 0 - + delete_on_termination = true - + destination_type = "local" - + source_type = "image" - + uuid = "bf08651f-047f-402a-9c9f-8fe415bffb89" - + volume_size = 10 - } - - + network { - + access_network = false - + fixed_ip_v4 = (known after apply) - + fixed_ip_v6 = (known after apply) - + floating_ip = (known after apply) - + mac = (known after apply) - + name = (known after apply) - + port = (known after apply) - + uuid = (known after apply) - } - } - - # module.toplevel.openstack_compute_instance_v2.nodes[1] will be created - + resource "openstack_compute_instance_v2" "nodes" { - + access_ip_v4 = (known after apply) - + access_ip_v6 = (known after apply) - + all_metadata = (known after apply) - + all_tags = (known after apply) - + availability_zone = (known after apply) - + created = (known after apply) - + flavor_id = (known after apply) - + flavor_name = "hpc.16core-32ram" - + force_delete = false - + id = (known after apply) - + image_id = (known after apply) - + image_name = "ubuntu-jammy-x86_64" - + key_pair = "vo-enes-org-tf-demo-keypair" - + name = "vo-enes-org-tf-demo-server-2" - + power_state = "active" - + region = (known after apply) - + security_groups = [ - + "vo-enes-org-tf-demo_security_group", - ] - + stop_before_destroy = false - + updated = (known after apply) - + user_data = "c2819c22aff3e1d7ebb2659b98724aac67590530" - - + block_device { - + boot_index = 0 - + delete_on_termination = true - + destination_type = "local" - + source_type = "image" - + uuid = "bf08651f-047f-402a-9c9f-8fe415bffb89" - + volume_size = 10 - } - - + network { - + access_network = false - + fixed_ip_v4 = (known after apply) - + fixed_ip_v6 = (known after apply) - + floating_ip = (known after apply) - + mac = (known after apply) - + name = (known after apply) - + port = (known after apply) - + uuid = (known after apply) - } - } - - # module.toplevel.openstack_compute_instance_v2.nodes[2] will be created - + resource "openstack_compute_instance_v2" "nodes" { - + access_ip_v4 = (known after apply) - + access_ip_v6 = (known after apply) - + all_metadata = (known after apply) - + all_tags = (known after apply) - + availability_zone = (known after apply) - + created = (known after apply) - + flavor_id = (known after apply) - + flavor_name = "hpc.16core-32ram" - + force_delete = false - + id = (known after apply) - + image_id = (known after apply) - + image_name = "ubuntu-jammy-x86_64" - + key_pair = "vo-enes-org-tf-demo-keypair" - + name = "vo-enes-org-tf-demo-server-3" - + power_state = "active" - + region = (known after apply) - + security_groups = [ - + "vo-enes-org-tf-demo_security_group", - ] - + stop_before_destroy = false - + updated = (known after apply) - + user_data = "0d9eecc7260a206e8502b6403c5a1d43e7c869cf" - - + block_device { - + boot_index = 0 - + delete_on_termination = true - + destination_type = "local" - + source_type = "image" - + uuid = "bf08651f-047f-402a-9c9f-8fe415bffb89" - + volume_size = 10 - } - - + network { - + access_network = false - + fixed_ip_v4 = (known after apply) - + fixed_ip_v6 = (known after apply) - + floating_ip = (known after apply) - + mac = (known after apply) - + name = (known after apply) - + port = (known after apply) - + uuid = (known after apply) - } - } - - # module.toplevel.openstack_compute_keypair_v2.pubkey will be created - + resource "openstack_compute_keypair_v2" "pubkey" { - + fingerprint = (known after apply) - + id = (known after apply) - + name = "vo-enes-org-tf-demo-keypair" - + private_key = (known after apply) - + public_key = <<-EOT - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCh5m8MwPW2mSXPFj0P3SSnAjukeQinvdESJfUeVqxOLozx3uAprm+ghPlun4V0mqfIfs6SmJM2wN8oDjd18yJVgCc1tfaSTDYDnVdrVPzWQYDdCqca0a3z+fXuK/sffv+9SH4LdNGqm6wA6xjJAbp8HbsnUNbcxs9bt9GJToxRjVCHjawJxlBBUemuYU7x7B8tdq3W5Fxtc9dIEcpO7NLvVujSSzbTwxVANSpOsbhroN6IQP299hB7Ggoa7P0MNaJa9VHJSU4Z6N7lYDrMG5gkm6LxL6s37ljyQS7IVDNKbhj1WrWfxAWrYtQy5alzisa7uuaxb1dOwEEWzZI5Z59T79cZActsJJPf6e4zurYo8Tqw9vpJId8ohDEQVnmb5asDGMz5G8xXa4G98McVYL1766fN1FxflYLIVRi7uPTLjN76COh/Q/ZxYuByFYl62VY+vT3CxcYInsqOkhwgfmHMbepq3ndRRIrN97IDDMutT5peTLSwpsmME+202Tg12TL7aGMyeNfcRxJkm3nHvXXKSAu1fJKXPvTQZZRxctX9GQ+2iYBhB57WnmtvfzgfcrAdZTXH3Mh08xRB+Uv/VqupLhm9Fgs/+IVUyi0AezsL6NrGItyPVcVU2HXF6xdsIFyHgb2Jhbdm2PzN/n7lcRa6lkltPBpLSWZb0N0DSHbrJw== freznicek@fedora - EOT - + region = (known after apply) - + user_id = (known after apply) - } - - # module.toplevel.openstack_compute_volume_attach_v2.nodes_extra_volumes_attachments[0] will be created - + resource "openstack_compute_volume_attach_v2" "nodes_extra_volumes_attachments" { - + device = "/dev/sdb" - + id = (known after apply) - + instance_id = (known after apply) - + region = (known after apply) - + volume_id = (known after apply) - } - - # module.toplevel.openstack_compute_volume_attach_v2.nodes_extra_volumes_attachments[1] will be created - + resource "openstack_compute_volume_attach_v2" "nodes_extra_volumes_attachments" { - + device = "/dev/sdb" - + id = (known after apply) - + instance_id = (known after apply) - + region = (known after apply) - + volume_id = (known after apply) - } - - # module.toplevel.openstack_compute_volume_attach_v2.nodes_extra_volumes_attachments[2] will be created - + resource "openstack_compute_volume_attach_v2" "nodes_extra_volumes_attachments" { - + device = "/dev/sdb" - + id = (known after apply) - + instance_id = (known after apply) - + region = (known after apply) - + volume_id = (known after apply) - } - - # module.toplevel.openstack_networking_floatingip_v2.bastion_fip will be created - + resource "openstack_networking_floatingip_v2" "bastion_fip" { - + address = (known after apply) - + all_tags = (known after apply) - + dns_domain = (known after apply) - + dns_name = (known after apply) - + fixed_ip = (known after apply) - + id = (known after apply) - + pool = "public-cesnet-195-113-167-GROUP" - + port_id = (known after apply) - + region = (known after apply) - + subnet_id = (known after apply) - + tenant_id = (known after apply) - } - - # module.toplevel.openstack_networking_network_v2.network_default will be created - + resource "openstack_networking_network_v2" "network_default" { - + admin_state_up = true - + all_tags = (known after apply) - + availability_zone_hints = (known after apply) - + dns_domain = (known after apply) - + external = (known after apply) - + id = (known after apply) - + mtu = (known after apply) - + name = "vo-enes-org-tf-demo_network" - + port_security_enabled = (known after apply) - + qos_policy_id = (known after apply) - + region = (known after apply) - + shared = (known after apply) - + tenant_id = (known after apply) - + transparent_vlan = (known after apply) - } - - # module.toplevel.openstack_networking_port_v2.bastion_port will be created - + resource "openstack_networking_port_v2" "bastion_port" { - + admin_state_up = true - + all_fixed_ips = (known after apply) - + all_security_group_ids = (known after apply) - + all_tags = (known after apply) - + device_id = (known after apply) - + device_owner = (known after apply) - + dns_assignment = (known after apply) - + dns_name = (known after apply) - + id = (known after apply) - + mac_address = (known after apply) - + name = "vo-enes-org-tf-demo-bastion-server-port" - + network_id = (known after apply) - + port_security_enabled = (known after apply) - + qos_policy_id = (known after apply) - + region = (known after apply) - + security_group_ids = (known after apply) - + tenant_id = (known after apply) - - + fixed_ip { - + subnet_id = (known after apply) - } - } - - # module.toplevel.openstack_networking_port_v2.nodes_ports[0] will be created - + resource "openstack_networking_port_v2" "nodes_ports" { - + admin_state_up = true - + all_fixed_ips = (known after apply) - + all_security_group_ids = (known after apply) - + all_tags = (known after apply) - + device_id = (known after apply) - + device_owner = (known after apply) - + dns_assignment = (known after apply) - + dns_name = (known after apply) - + id = (known after apply) - + mac_address = (known after apply) - + name = "vo-enes-org-tf-demo_server_port_1" - + network_id = (known after apply) - + port_security_enabled = (known after apply) - + qos_policy_id = (known after apply) - + region = (known after apply) - + security_group_ids = (known after apply) - + tenant_id = (known after apply) - - + fixed_ip { - + subnet_id = (known after apply) - } - } - - # module.toplevel.openstack_networking_port_v2.nodes_ports[1] will be created - + resource "openstack_networking_port_v2" "nodes_ports" { - + admin_state_up = true - + all_fixed_ips = (known after apply) - + all_security_group_ids = (known after apply) - + all_tags = (known after apply) - + device_id = (known after apply) - + device_owner = (known after apply) - + dns_assignment = (known after apply) - + dns_name = (known after apply) - + id = (known after apply) - + mac_address = (known after apply) - + name = "vo-enes-org-tf-demo_server_port_2" - + network_id = (known after apply) - + port_security_enabled = (known after apply) - + qos_policy_id = (known after apply) - + region = (known after apply) - + security_group_ids = (known after apply) - + tenant_id = (known after apply) - - + fixed_ip { - + subnet_id = (known after apply) - } - } - - # module.toplevel.openstack_networking_port_v2.nodes_ports[2] will be created - + resource "openstack_networking_port_v2" "nodes_ports" { - + admin_state_up = true - + all_fixed_ips = (known after apply) - + all_security_group_ids = (known after apply) - + all_tags = (known after apply) - + device_id = (known after apply) - + device_owner = (known after apply) - + dns_assignment = (known after apply) - + dns_name = (known after apply) - + id = (known after apply) - + mac_address = (known after apply) - + name = "vo-enes-org-tf-demo_server_port_3" - + network_id = (known after apply) - + port_security_enabled = (known after apply) - + qos_policy_id = (known after apply) - + region = (known after apply) - + security_group_ids = (known after apply) - + tenant_id = (known after apply) - - + fixed_ip { - + subnet_id = (known after apply) - } - } - - # module.toplevel.openstack_networking_router_interface_v2.router_default_interface will be created - + resource "openstack_networking_router_interface_v2" "router_default_interface" { - + force_destroy = false - + id = (known after apply) - + port_id = (known after apply) - + region = (known after apply) - + router_id = (known after apply) - + subnet_id = (known after apply) - } - - # module.toplevel.openstack_networking_router_v2.router_default will be created - + resource "openstack_networking_router_v2" "router_default" { - + admin_state_up = true - + all_tags = (known after apply) - + availability_zone_hints = (known after apply) - + distributed = (known after apply) - + enable_snat = (known after apply) - + external_gateway = (known after apply) - + external_network_id = "9edb9ab8-8742-49e3-9461-528f31397672" - + id = (known after apply) - + name = "vo-enes-org-tf-demo_infra-test" - + region = (known after apply) - + tenant_id = (known after apply) - } - - # module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_http4 will be created - + resource "openstack_networking_secgroup_rule_v2" "secgroup_rule_http4" { - + direction = "ingress" - + ethertype = "IPv4" - + id = (known after apply) - + port_range_max = 80 - + port_range_min = 80 - + protocol = "tcp" - + region = (known after apply) - + remote_group_id = (known after apply) - + remote_ip_prefix = "0.0.0.0/0" - + security_group_id = (known after apply) - + tenant_id = (known after apply) - } - - # module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_https4 will be created - + resource "openstack_networking_secgroup_rule_v2" "secgroup_rule_https4" { - + direction = "ingress" - + ethertype = "IPv4" - + id = (known after apply) - + port_range_max = 443 - + port_range_min = 443 - + protocol = "tcp" - + region = (known after apply) - + remote_group_id = (known after apply) - + remote_ip_prefix = "0.0.0.0/0" - + security_group_id = (known after apply) - + tenant_id = (known after apply) - } - - # module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_icmp4 will be created - + resource "openstack_networking_secgroup_rule_v2" "secgroup_rule_icmp4" { - + direction = "ingress" - + ethertype = "IPv4" - + id = (known after apply) - + port_range_max = 0 - + port_range_min = 0 - + protocol = "icmp" - + region = (known after apply) - + remote_group_id = (known after apply) - + remote_ip_prefix = "0.0.0.0/0" - + security_group_id = (known after apply) - + tenant_id = (known after apply) - } - - # module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_ssh4 will be created - + resource "openstack_networking_secgroup_rule_v2" "secgroup_rule_ssh4" { - + direction = "ingress" - + ethertype = "IPv4" - + id = (known after apply) - + port_range_max = 22 - + port_range_min = 22 - + protocol = "tcp" - + region = (known after apply) - + remote_group_id = (known after apply) - + remote_ip_prefix = "0.0.0.0/0" - + security_group_id = (known after apply) - + tenant_id = (known after apply) - } - - # module.toplevel.openstack_networking_secgroup_v2.secgroup_default will be created - + resource "openstack_networking_secgroup_v2" "secgroup_default" { - + all_tags = (known after apply) - + description = "vo-enes-org-tf-demo Security group" - + id = (known after apply) - + name = "vo-enes-org-tf-demo_security_group" - + region = (known after apply) - + tenant_id = (known after apply) - } - - # module.toplevel.openstack_networking_subnet_v2.subnet_default will be created - + resource "openstack_networking_subnet_v2" "subnet_default" { - + all_tags = (known after apply) - + cidr = "10.10.10.0/24" - + dns_nameservers = [ - + "1.1.1.1", - + "8.8.8.8", - ] - + enable_dhcp = true - + gateway_ip = (known after apply) - + id = (known after apply) - + ip_version = 4 - + ipv6_address_mode = (known after apply) - + ipv6_ra_mode = (known after apply) - + name = "vo-enes-org-tf-demo_subnet" - + network_id = (known after apply) - + no_gateway = false - + region = (known after apply) - + service_types = (known after apply) - + tenant_id = (known after apply) - } - -Plan: 26 to add, 0 to change, 0 to destroy. - -────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── - -Saved the plan to: plan - -To perform exactly these actions, run the following command to apply: - terraform apply "plan" -[freznicek@lenovo-t14 terraform 0]$ terraform apply "plan" -module.toplevel.openstack_compute_keypair_v2.pubkey: Creating... -module.toplevel.openstack_networking_secgroup_v2.secgroup_default: Creating... -module.toplevel.openstack_networking_floatingip_v2.bastion_fip: Creating... -module.toplevel.openstack_networking_network_v2.network_default: Creating... -module.toplevel.openstack_networking_router_v2.router_default: Creating... -module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[1]: Creating... -module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[2]: Creating... -module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[0]: Creating... -module.toplevel.openstack_compute_keypair_v2.pubkey: Creation complete after 1s [id=vo-enes-org-tf-demo-keypair] -module.toplevel.openstack_networking_secgroup_v2.secgroup_default: Creation complete after 1s [id=ed3f6682-e6c9-46b5-983d-3baf25131142] -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_https4: Creating... -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_http4: Creating... -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_icmp4: Creating... -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_ssh4: Creating... -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_ssh4: Creation complete after 0s [id=f56e25f7-21c1-4337-b6be-7e8def76bfff] -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_https4: Creation complete after 1s [id=3e4a6d33-f68e-4c8c-8408-9594c6e41e61] -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_http4: Creation complete after 2s [id=9df51e87-e30c-46f4-ae9a-a6d833759b9c] -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_icmp4: Creation complete after 2s [id=5f6519c2-ed4a-445d-b63c-7c030eab581d] -module.toplevel.openstack_networking_network_v2.network_default: Creation complete after 7s [id=ba35e97d-7f04-47b4-a82c-0130a1f217a7] -module.toplevel.openstack_networking_subnet_v2.subnet_default: Creating... -module.toplevel.openstack_networking_floatingip_v2.bastion_fip: Creation complete after 9s [id=ec66ce9d-c8ca-490f-a249-043b55230f22] -module.toplevel.openstack_networking_router_v2.router_default: Creation complete after 9s [id=c2747273-6f7b-4733-a919-96701ea0a153] -module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[2]: Still creating... [10s elapsed] -module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[0]: Still creating... [10s elapsed] -module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[1]: Still creating... [10s elapsed] -module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[0]: Creation complete after 11s [id=a527bff6-6a80-469b-89d1-71fcf3f7d0b1] -module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[1]: Creation complete after 11s [id=58ed3694-5141-4db1-b156-3c46a9f5654b] -module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[2]: Creation complete after 11s [id=adbd2ddc-600e-4d77-aa3f-ed66d94ae2dd] -module.toplevel.openstack_networking_subnet_v2.subnet_default: Creation complete after 6s [id=a0dfc195-fa9d-4df1-aa6d-7e6ca842e899] -module.toplevel.openstack_networking_router_interface_v2.router_default_interface: Creating... -module.toplevel.openstack_networking_port_v2.bastion_port: Creating... -module.toplevel.openstack_networking_port_v2.nodes_ports[2]: Creating... -module.toplevel.openstack_networking_port_v2.nodes_ports[1]: Creating... -module.toplevel.openstack_networking_port_v2.nodes_ports[0]: Creating... -module.toplevel.openstack_networking_port_v2.bastion_port: Creation complete after 7s [id=e8dafeed-a6eb-44de-af9b-d5d19844512f] -module.toplevel.openstack_compute_instance_v2.bastion: Creating... -module.toplevel.openstack_networking_port_v2.nodes_ports[2]: Creation complete after 7s [id=d4bb617c-bce7-4572-9a07-1f638e482da2] -module.toplevel.openstack_networking_port_v2.nodes_ports[0]: Creation complete after 7s [id=41fa4b8b-5096-4699-94b6-735afc88ba35] -module.toplevel.openstack_networking_port_v2.nodes_ports[1]: Creation complete after 7s [id=9749a231-94db-4c0c-a86f-d5c378bbc9e6] -module.toplevel.openstack_compute_instance_v2.nodes[0]: Creating... -module.toplevel.openstack_compute_instance_v2.nodes[1]: Creating... -module.toplevel.openstack_compute_instance_v2.nodes[2]: Creating... -module.toplevel.openstack_networking_router_interface_v2.router_default_interface: Creation complete after 9s [id=8ea9c9cf-be4e-429a-8e1c-ae3b562f69d2] -module.toplevel.openstack_compute_instance_v2.bastion: Still creating... [10s elapsed] -module.toplevel.openstack_compute_instance_v2.nodes[0]: Still creating... [10s elapsed] -module.toplevel.openstack_compute_instance_v2.nodes[1]: Still creating... [10s elapsed] -module.toplevel.openstack_compute_instance_v2.nodes[2]: Still creating... [10s elapsed] -module.toplevel.openstack_compute_instance_v2.nodes[1]: Creation complete after 15s [id=66ae2ce7-2d0e-42b2-bdec-e4a704c69c6c] -module.toplevel.openstack_compute_instance_v2.bastion: Creation complete after 16s [id=749623e7-7010-4a09-ac69-400baa610042] -module.toplevel.openstack_compute_floatingip_associate_v2.bastion_fip_associate: Creating... -module.toplevel.openstack_compute_instance_v2.nodes[2]: Creation complete after 16s [id=e1f199f5-b57a-4ca0-bc8e-7e675fdfae13] -module.toplevel.openstack_compute_instance_v2.nodes[0]: Creation complete after 16s [id=809eda35-291a-46e1-a0ae-6d0c954bb7a0] -module.toplevel.openstack_compute_volume_attach_v2.nodes_extra_volumes_attachments[0]: Creating... -module.toplevel.openstack_compute_volume_attach_v2.nodes_extra_volumes_attachments[2]: Creating... -module.toplevel.openstack_compute_volume_attach_v2.nodes_extra_volumes_attachments[1]: Creating... -module.toplevel.openstack_compute_floatingip_associate_v2.bastion_fip_associate: Creation complete after 2s [id=195.113.167.75/749623e7-7010-4a09-ac69-400baa610042/] -module.toplevel.openstack_compute_volume_attach_v2.nodes_extra_volumes_attachments[1]: Creation complete after 6s [id=66ae2ce7-2d0e-42b2-bdec-e4a704c69c6c/58ed3694-5141-4db1-b156-3c46a9f5654b] -module.toplevel.openstack_compute_volume_attach_v2.nodes_extra_volumes_attachments[0]: Creation complete after 6s [id=809eda35-291a-46e1-a0ae-6d0c954bb7a0/a527bff6-6a80-469b-89d1-71fcf3f7d0b1] -module.toplevel.openstack_compute_volume_attach_v2.nodes_extra_volumes_attachments[2]: Creation complete after 6s [id=e1f199f5-b57a-4ca0-bc8e-7e675fdfae13/adbd2ddc-600e-4d77-aa3f-ed66d94ae2dd] - -Apply complete! Resources: 26 added, 0 changed, 0 destroyed. - - -# E. Verify the objects with openstack client - -[freznicek@lenovo-t14 terraform 0]$ openstack server list -+--------------------------------------+-------------------------------------------+--------+-----------------------------------------------------------------------+--------------------------------+------------------+ -| ID | Name | Status | Networks | Image | Flavor | -+--------------------------------------+-------------------------------------------+--------+-----------------------------------------------------------------------+--------------------------------+------------------+ -| 66ae2ce7-2d0e-42b2-bdec-e4a704c69c6c | vo-enes-org-tf-demo-server-2 | ACTIVE | vo-enes-org-tf-demo_network=10.10.10.247 | ubuntu-jammy-x86_64 | hpc.16core-32ram | -| 749623e7-7010-4a09-ac69-400baa610042 | vo-enes-org-tf-demo-bastion-server | ACTIVE | vo-enes-org-tf-demo_network=10.10.10.39, 195.113.167.75 | ubuntu-jammy-x86_64 | standard.medium | -| 809eda35-291a-46e1-a0ae-6d0c954bb7a0 | vo-enes-org-tf-demo-server-1 | ACTIVE | vo-enes-org-tf-demo_network=10.10.10.201 | ubuntu-jammy-x86_64 | hpc.16core-32ram | -| e1f199f5-b57a-4ca0-bc8e-7e675fdfae13 | vo-enes-org-tf-demo-server-3 | ACTIVE | vo-enes-org-tf-demo_network=10.10.10.32 | ubuntu-jammy-x86_64 | hpc.16core-32ram | -+--------------------------------------+-------------------------------------------+--------+-----------------------------------------------------------------------+--------------------------------+------------------+ -[freznicek@lenovo-t14 terraform 0]$ openstack volume list -+--------------------------------------+-------------------------------------------+--------+------+----------------------------------------------------------------+ -| ID | Name | Status | Size | Attached to | -+--------------------------------------+-------------------------------------------+--------+------+----------------------------------------------------------------+ -| adbd2ddc-600e-4d77-aa3f-ed66d94ae2dd | vo-enes-org-tf-demo-extra-volume-3 | in-use | 1000 | Attached to vo-enes-org-tf-demo-server-3 on /dev/sdb | -| a527bff6-6a80-469b-89d1-71fcf3f7d0b1 | vo-enes-org-tf-demo-extra-volume-1 | in-use | 1000 | Attached to vo-enes-org-tf-demo-server-1 on /dev/sdb | -| 58ed3694-5141-4db1-b156-3c46a9f5654b | vo-enes-org-tf-demo-extra-volume-2 | in-use | 1000 | Attached to vo-enes-org-tf-demo-server-2 on /dev/sdb | -+--------------------------------------+-------------------------------------------+--------+------+----------------------------------------------------------------+ - -[freznicek@lenovo-t14 terraform 0]$ openstack volume show vo-enes-org-tf-demo-extra-volume-1 -fjson -{ - "attachments": [ - { - "id": "a527bff6-6a80-469b-89d1-71fcf3f7d0b1", - "attachment_id": "efbcd175-90cb-4698-9510-16318200a3b3", - "volume_id": "a527bff6-6a80-469b-89d1-71fcf3f7d0b1", - "server_id": "809eda35-291a-46e1-a0ae-6d0c954bb7a0", - "host_name": "eli-hda2-055-ostack.priv.cloud.muni.cz", - "device": "/dev/sdb", - "attached_at": "2023-06-23T12:18:57.000000" - } - ], - "availability_zone": "brno1", - "bootable": "false", - "consistencygroup_id": null, - "created_at": "2023-06-23T12:18:19.000000", - "description": null, - "encrypted": false, - "id": "a527bff6-6a80-469b-89d1-71fcf3f7d0b1", - "multiattach": false, - "name": "vo-enes-org-tf-demo-extra-volume-1", - "os-vol-tenant-attr:tenant_id": "786566209a7444f89a561172fa28e117", - "properties": {}, - "replication_status": null, - "size": 1000, - "snapshot_id": null, - "source_volid": null, - "status": "in-use", - "updated_at": "2023-06-23T12:18:57.000000", - "user_id": "cbd97591acf3d91e3c32d20558935b4a7196589eb6c46b43879ea38355463ac6" -} - - -# F. Access the VM via the bastion - -## F1. Connect to public bastion (terminal 1) - -[freznicek@lenovo-t14 terraform 99]$ sshuttle -e "ssh -i ~/.ssh/id_rsa.LenovoThinkCentreE73" -r ubuntu@195.113.167.75 10.10.10.0/24 -The authenticity of host '195.113.167.75 (195.113.167.75)' can't be established. -ED25519 key fingerprint is SHA256:hjyrJDdt5unjForvHCbk1pSZTWBGI+jSrgrber4Opdg. -This key is not known by any other names -Are you sure you want to continue connecting (yes/no/[fingerprint])? yes -Warning: Permanently added '195.113.167.75' (ED25519) to the list of known hosts. -c : Connected to server. - - -## F2. Connect to HPC nodes (on private addresses, terminal 2) - -[freznicek@lenovo-t14 terraform 0]$ assh ubuntu@10.10.10.201 -... -To run a command as administrator (user "root"), use "sudo <command>". -See "man sudo_root" for details. - -ubuntu@vo-enes-org-tf-demo-server-1:~$ lsblk -NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS -loop0 7:0 0 63.5M 1 loop /snap/core20/1891 -loop1 7:1 0 111.9M 1 loop /snap/lxd/24322 -loop2 7:2 0 53.3M 1 loop /snap/snapd/19361 -sda 8:0 0 80G 0 disk -├─sda1 8:1 0 79.9G 0 part / -├─sda14 8:14 0 4M 0 part -└─sda15 8:15 0 106M 0 part /boot/efi -sdb 8:16 0 1000G 0 disk -└─sdb1 8:17 0 1000G 0 part /mnt/data -ubuntu@vo-enes-org-tf-demo-server-1:~$ df -ah /mnt/data -Filesystem Size Used Avail Use% Mounted on -/dev/sdb1 984G 28K 934G 1% /mnt/data - - -# G. Destroy the infrastructure - -[freznicek@lenovo-t14 terraform 0]$ terraform destroy -module.toplevel.data.openstack_networking_network_v2.external_network: Reading... -module.toplevel.openstack_compute_keypair_v2.pubkey: Refreshing state... [id=vo-enes-org-tf-demo-keypair] -module.toplevel.openstack_networking_secgroup_v2.secgroup_default: Refreshing state... [id=ed3f6682-e6c9-46b5-983d-3baf25131142] -module.toplevel.data.openstack_images_image_v2.nodes_image: Reading... -module.toplevel.openstack_networking_floatingip_v2.bastion_fip: Refreshing state... [id=ec66ce9d-c8ca-490f-a249-043b55230f22] -module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[0]: Refreshing state... [id=a527bff6-6a80-469b-89d1-71fcf3f7d0b1] -module.toplevel.openstack_networking_network_v2.network_default: Refreshing state... [id=ba35e97d-7f04-47b4-a82c-0130a1f217a7] -module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[2]: Refreshing state... [id=adbd2ddc-600e-4d77-aa3f-ed66d94ae2dd] -module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[1]: Refreshing state... [id=58ed3694-5141-4db1-b156-3c46a9f5654b] -module.toplevel.data.openstack_images_image_v2.nodes_image: Read complete after 1s [id=bf08651f-047f-402a-9c9f-8fe415bffb89] -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_ssh4: Refreshing state... [id=f56e25f7-21c1-4337-b6be-7e8def76bfff] -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_http4: Refreshing state... [id=9df51e87-e30c-46f4-ae9a-a6d833759b9c] -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_icmp4: Refreshing state... [id=5f6519c2-ed4a-445d-b63c-7c030eab581d] -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_https4: Refreshing state... [id=3e4a6d33-f68e-4c8c-8408-9594c6e41e61] -module.toplevel.openstack_networking_subnet_v2.subnet_default: Refreshing state... [id=a0dfc195-fa9d-4df1-aa6d-7e6ca842e899] -module.toplevel.data.openstack_networking_network_v2.external_network: Read complete after 1s [id=9edb9ab8-8742-49e3-9461-528f31397672] -module.toplevel.openstack_networking_router_v2.router_default: Refreshing state... [id=c2747273-6f7b-4733-a919-96701ea0a153] -module.toplevel.openstack_networking_port_v2.bastion_port: Refreshing state... [id=e8dafeed-a6eb-44de-af9b-d5d19844512f] -module.toplevel.openstack_networking_port_v2.nodes_ports[2]: Refreshing state... [id=d4bb617c-bce7-4572-9a07-1f638e482da2] -module.toplevel.openstack_networking_port_v2.nodes_ports[0]: Refreshing state... [id=41fa4b8b-5096-4699-94b6-735afc88ba35] -module.toplevel.openstack_networking_port_v2.nodes_ports[1]: Refreshing state... [id=9749a231-94db-4c0c-a86f-d5c378bbc9e6] -module.toplevel.openstack_networking_router_interface_v2.router_default_interface: Refreshing state... [id=8ea9c9cf-be4e-429a-8e1c-ae3b562f69d2] -module.toplevel.openstack_compute_instance_v2.bastion: Refreshing state... [id=749623e7-7010-4a09-ac69-400baa610042] -module.toplevel.openstack_compute_instance_v2.nodes[2]: Refreshing state... [id=e1f199f5-b57a-4ca0-bc8e-7e675fdfae13] -module.toplevel.openstack_compute_instance_v2.nodes[0]: Refreshing state... [id=809eda35-291a-46e1-a0ae-6d0c954bb7a0] -module.toplevel.openstack_compute_instance_v2.nodes[1]: Refreshing state... [id=66ae2ce7-2d0e-42b2-bdec-e4a704c69c6c] -module.toplevel.openstack_compute_floatingip_associate_v2.bastion_fip_associate: Refreshing state... [id=195.113.167.75/749623e7-7010-4a09-ac69-400baa610042/] -module.toplevel.openstack_compute_volume_attach_v2.nodes_extra_volumes_attachments[0]: Refreshing state... [id=809eda35-291a-46e1-a0ae-6d0c954bb7a0/a527bff6-6a80-469b-89d1-71fcf3f7d0b1] -module.toplevel.openstack_compute_volume_attach_v2.nodes_extra_volumes_attachments[2]: Refreshing state... [id=e1f199f5-b57a-4ca0-bc8e-7e675fdfae13/adbd2ddc-600e-4d77-aa3f-ed66d94ae2dd] -module.toplevel.openstack_compute_volume_attach_v2.nodes_extra_volumes_attachments[1]: Refreshing state... [id=66ae2ce7-2d0e-42b2-bdec-e4a704c69c6c/58ed3694-5141-4db1-b156-3c46a9f5654b] - -Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: - - destroy - -Terraform will perform the following actions: - - # module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[0] will be destroyed - - resource "openstack_blockstorage_volume_v3" "nodes_extra_volumes" { - - attachment = [ - - { - - device = "/dev/sdb" - - id = "a527bff6-6a80-469b-89d1-71fcf3f7d0b1" - - instance_id = "809eda35-291a-46e1-a0ae-6d0c954bb7a0" - }, - ] -> null - - availability_zone = "brno1" -> null - - id = "a527bff6-6a80-469b-89d1-71fcf3f7d0b1" -> null - - metadata = {} -> null - - name = "vo-enes-org-tf-demo-extra-volume-1" -> null - - region = "brno1" -> null - - size = 1000 -> null - - volume_type = "ceph-extra-rep" -> null - } - - # module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[1] will be destroyed - - resource "openstack_blockstorage_volume_v3" "nodes_extra_volumes" { - - attachment = [ - - { - - device = "/dev/sdb" - - id = "58ed3694-5141-4db1-b156-3c46a9f5654b" - - instance_id = "66ae2ce7-2d0e-42b2-bdec-e4a704c69c6c" - }, - ] -> null - - availability_zone = "brno1" -> null - - id = "58ed3694-5141-4db1-b156-3c46a9f5654b" -> null - - metadata = {} -> null - - name = "vo-enes-org-tf-demo-extra-volume-2" -> null - - region = "brno1" -> null - - size = 1000 -> null - - volume_type = "ceph-extra-rep" -> null - } - - # module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[2] will be destroyed - - resource "openstack_blockstorage_volume_v3" "nodes_extra_volumes" { - - attachment = [ - - { - - device = "/dev/sdb" - - id = "adbd2ddc-600e-4d77-aa3f-ed66d94ae2dd" - - instance_id = "e1f199f5-b57a-4ca0-bc8e-7e675fdfae13" - }, - ] -> null - - availability_zone = "brno1" -> null - - id = "adbd2ddc-600e-4d77-aa3f-ed66d94ae2dd" -> null - - metadata = {} -> null - - name = "vo-enes-org-tf-demo-extra-volume-3" -> null - - region = "brno1" -> null - - size = 1000 -> null - - volume_type = "ceph-extra-rep" -> null - } - - # module.toplevel.openstack_compute_floatingip_associate_v2.bastion_fip_associate will be destroyed - - resource "openstack_compute_floatingip_associate_v2" "bastion_fip_associate" { - - floating_ip = "195.113.167.75" -> null - - id = "195.113.167.75/749623e7-7010-4a09-ac69-400baa610042/" -> null - - instance_id = "749623e7-7010-4a09-ac69-400baa610042" -> null - - region = "brno1" -> null - } - - # module.toplevel.openstack_compute_instance_v2.bastion will be destroyed - - resource "openstack_compute_instance_v2" "bastion" { - - access_ip_v4 = "10.10.10.39" -> null - - all_metadata = {} -> null - - all_tags = [] -> null - - availability_zone = "brno1" -> null - - created = "2023-06-23 12:18:41 +0000 UTC" -> null - - flavor_id = "4c153ce3-a163-4668-baa7-2cbcb57e2dd8" -> null - - flavor_name = "standard.medium" -> null - - force_delete = false -> null - - id = "749623e7-7010-4a09-ac69-400baa610042" -> null - - image_id = "bf08651f-047f-402a-9c9f-8fe415bffb89" -> null - - image_name = "ubuntu-jammy-x86_64" -> null - - key_pair = "vo-enes-org-tf-demo-keypair" -> null - - name = "vo-enes-org-tf-demo-bastion-server" -> null - - power_state = "active" -> null - - region = "brno1" -> null - - security_groups = [ - - "vo-enes-org-tf-demo_security_group", - ] -> null - - stop_before_destroy = false -> null - - tags = [] -> null - - updated = "2023-06-23 12:18:53 +0000 UTC" -> null - - user_data = "a3a49ba4d021dc7ea72f930700b21701d957ddd6" -> null - - - network { - - access_network = false -> null - - fixed_ip_v4 = "10.10.10.39" -> null - - mac = "fa:16:3e:c1:2b:43" -> null - - name = "vo-enes-org-tf-demo_network" -> null - - port = "e8dafeed-a6eb-44de-af9b-d5d19844512f" -> null - - uuid = "ba35e97d-7f04-47b4-a82c-0130a1f217a7" -> null - } - } - - # module.toplevel.openstack_compute_instance_v2.nodes[0] will be destroyed - - resource "openstack_compute_instance_v2" "nodes" { - - access_ip_v4 = "10.10.10.201" -> null - - all_metadata = {} -> null - - all_tags = [] -> null - - availability_zone = "brno1" -> null - - created = "2023-06-23 12:18:41 +0000 UTC" -> null - - flavor_id = "fd5b2a18-30c7-427f-84b1-23194346f20c" -> null - - flavor_name = "hpc.16core-32ram" -> null - - force_delete = false -> null - - id = "809eda35-291a-46e1-a0ae-6d0c954bb7a0" -> null - - image_id = "bf08651f-047f-402a-9c9f-8fe415bffb89" -> null - - image_name = "ubuntu-jammy-x86_64" -> null - - key_pair = "vo-enes-org-tf-demo-keypair" -> null - - name = "vo-enes-org-tf-demo-server-1" -> null - - power_state = "active" -> null - - region = "brno1" -> null - - security_groups = [ - - "vo-enes-org-tf-demo_security_group", - ] -> null - - stop_before_destroy = false -> null - - tags = [] -> null - - updated = "2023-06-23 12:18:53 +0000 UTC" -> null - - user_data = "8d4565d32104990f59352f6ea5c69e398c356e26" -> null - - - block_device { - - boot_index = 0 -> null - - delete_on_termination = true -> null - - destination_type = "local" -> null - - source_type = "image" -> null - - uuid = "bf08651f-047f-402a-9c9f-8fe415bffb89" -> null - - volume_size = 10 -> null - } - - - network { - - access_network = false -> null - - fixed_ip_v4 = "10.10.10.201" -> null - - mac = "fa:16:3e:bb:93:3b" -> null - - name = "vo-enes-org-tf-demo_network" -> null - - port = "41fa4b8b-5096-4699-94b6-735afc88ba35" -> null - - uuid = "ba35e97d-7f04-47b4-a82c-0130a1f217a7" -> null - } - } - - # module.toplevel.openstack_compute_instance_v2.nodes[1] will be destroyed - - resource "openstack_compute_instance_v2" "nodes" { - - access_ip_v4 = "10.10.10.247" -> null - - all_metadata = {} -> null - - all_tags = [] -> null - - availability_zone = "brno1" -> null - - created = "2023-06-23 12:18:41 +0000 UTC" -> null - - flavor_id = "fd5b2a18-30c7-427f-84b1-23194346f20c" -> null - - flavor_name = "hpc.16core-32ram" -> null - - force_delete = false -> null - - id = "66ae2ce7-2d0e-42b2-bdec-e4a704c69c6c" -> null - - image_id = "bf08651f-047f-402a-9c9f-8fe415bffb89" -> null - - image_name = "ubuntu-jammy-x86_64" -> null - - key_pair = "vo-enes-org-tf-demo-keypair" -> null - - name = "vo-enes-org-tf-demo-server-2" -> null - - power_state = "active" -> null - - region = "brno1" -> null - - security_groups = [ - - "vo-enes-org-tf-demo_security_group", - ] -> null - - stop_before_destroy = false -> null - - tags = [] -> null - - updated = "2023-06-23 12:18:51 +0000 UTC" -> null - - user_data = "c2819c22aff3e1d7ebb2659b98724aac67590530" -> null - - - block_device { - - boot_index = 0 -> null - - delete_on_termination = true -> null - - destination_type = "local" -> null - - source_type = "image" -> null - - uuid = "bf08651f-047f-402a-9c9f-8fe415bffb89" -> null - - volume_size = 10 -> null - } - - - network { - - access_network = false -> null - - fixed_ip_v4 = "10.10.10.247" -> null - - mac = "fa:16:3e:8d:24:c1" -> null - - name = "vo-enes-org-tf-demo_network" -> null - - port = "9749a231-94db-4c0c-a86f-d5c378bbc9e6" -> null - - uuid = "ba35e97d-7f04-47b4-a82c-0130a1f217a7" -> null - } - } - - # module.toplevel.openstack_compute_instance_v2.nodes[2] will be destroyed - - resource "openstack_compute_instance_v2" "nodes" { - - access_ip_v4 = "10.10.10.32" -> null - - all_metadata = {} -> null - - all_tags = [] -> null - - availability_zone = "brno1" -> null - - created = "2023-06-23 12:18:41 +0000 UTC" -> null - - flavor_id = "fd5b2a18-30c7-427f-84b1-23194346f20c" -> null - - flavor_name = "hpc.16core-32ram" -> null - - force_delete = false -> null - - id = "e1f199f5-b57a-4ca0-bc8e-7e675fdfae13" -> null - - image_id = "bf08651f-047f-402a-9c9f-8fe415bffb89" -> null - - image_name = "ubuntu-jammy-x86_64" -> null - - key_pair = "vo-enes-org-tf-demo-keypair" -> null - - name = "vo-enes-org-tf-demo-server-3" -> null - - power_state = "active" -> null - - region = "brno1" -> null - - security_groups = [ - - "vo-enes-org-tf-demo_security_group", - ] -> null - - stop_before_destroy = false -> null - - tags = [] -> null - - updated = "2023-06-23 12:18:52 +0000 UTC" -> null - - user_data = "0d9eecc7260a206e8502b6403c5a1d43e7c869cf" -> null - - - block_device { - - boot_index = 0 -> null - - delete_on_termination = true -> null - - destination_type = "local" -> null - - source_type = "image" -> null - - uuid = "bf08651f-047f-402a-9c9f-8fe415bffb89" -> null - - volume_size = 10 -> null - } - - - network { - - access_network = false -> null - - fixed_ip_v4 = "10.10.10.32" -> null - - mac = "fa:16:3e:b3:c2:fe" -> null - - name = "vo-enes-org-tf-demo_network" -> null - - port = "d4bb617c-bce7-4572-9a07-1f638e482da2" -> null - - uuid = "ba35e97d-7f04-47b4-a82c-0130a1f217a7" -> null - } - } - - # module.toplevel.openstack_compute_keypair_v2.pubkey will be destroyed - - resource "openstack_compute_keypair_v2" "pubkey" { - - fingerprint = "75:e0:a4:d6:4c:76:ba:21:f1:d1:75:c8:75:22:93:4f" -> null - - id = "vo-enes-org-tf-demo-keypair" -> null - - name = "vo-enes-org-tf-demo-keypair" -> null - - public_key = <<-EOT - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCh5m8MwPW2mSXPFj0P3SSnAjukeQinvdESJfUeVqxOLozx3uAprm+ghPlun4V0mqfIfs6SmJM2wN8oDjd18yJVgCc1tfaSTDYDnVdrVPzWQYDdCqca0a3z+fXuK/sffv+9SH4LdNGqm6wA6xjJAbp8HbsnUNbcxs9bt9GJToxRjVCHjawJxlBBUemuYU7x7B8tdq3W5Fxtc9dIEcpO7NLvVujSSzbTwxVANSpOsbhroN6IQP299hB7Ggoa7P0MNaJa9VHJSU4Z6N7lYDrMG5gkm6LxL6s37ljyQS7IVDNKbhj1WrWfxAWrYtQy5alzisa7uuaxb1dOwEEWzZI5Z59T79cZActsJJPf6e4zurYo8Tqw9vpJId8ohDEQVnmb5asDGMz5G8xXa4G98McVYL1766fN1FxflYLIVRi7uPTLjN76COh/Q/ZxYuByFYl62VY+vT3CxcYInsqOkhwgfmHMbepq3ndRRIrN97IDDMutT5peTLSwpsmME+202Tg12TL7aGMyeNfcRxJkm3nHvXXKSAu1fJKXPvTQZZRxctX9GQ+2iYBhB57WnmtvfzgfcrAdZTXH3Mh08xRB+Uv/VqupLhm9Fgs/+IVUyi0AezsL6NrGItyPVcVU2HXF6xdsIFyHgb2Jhbdm2PzN/n7lcRa6lkltPBpLSWZb0N0DSHbrJw== freznicek@fedora - EOT -> null - - region = "brno1" -> null - } - - # module.toplevel.openstack_compute_volume_attach_v2.nodes_extra_volumes_attachments[0] will be destroyed - - resource "openstack_compute_volume_attach_v2" "nodes_extra_volumes_attachments" { - - device = "/dev/sdb" -> null - - id = "809eda35-291a-46e1-a0ae-6d0c954bb7a0/a527bff6-6a80-469b-89d1-71fcf3f7d0b1" -> null - - instance_id = "809eda35-291a-46e1-a0ae-6d0c954bb7a0" -> null - - region = "brno1" -> null - - volume_id = "a527bff6-6a80-469b-89d1-71fcf3f7d0b1" -> null - } - - # module.toplevel.openstack_compute_volume_attach_v2.nodes_extra_volumes_attachments[1] will be destroyed - - resource "openstack_compute_volume_attach_v2" "nodes_extra_volumes_attachments" { - - device = "/dev/sdb" -> null - - id = "66ae2ce7-2d0e-42b2-bdec-e4a704c69c6c/58ed3694-5141-4db1-b156-3c46a9f5654b" -> null - - instance_id = "66ae2ce7-2d0e-42b2-bdec-e4a704c69c6c" -> null - - region = "brno1" -> null - - volume_id = "58ed3694-5141-4db1-b156-3c46a9f5654b" -> null - } - - # module.toplevel.openstack_compute_volume_attach_v2.nodes_extra_volumes_attachments[2] will be destroyed - - resource "openstack_compute_volume_attach_v2" "nodes_extra_volumes_attachments" { - - device = "/dev/sdb" -> null - - id = "e1f199f5-b57a-4ca0-bc8e-7e675fdfae13/adbd2ddc-600e-4d77-aa3f-ed66d94ae2dd" -> null - - instance_id = "e1f199f5-b57a-4ca0-bc8e-7e675fdfae13" -> null - - region = "brno1" -> null - - volume_id = "adbd2ddc-600e-4d77-aa3f-ed66d94ae2dd" -> null - } - - # module.toplevel.openstack_networking_floatingip_v2.bastion_fip will be destroyed - - resource "openstack_networking_floatingip_v2" "bastion_fip" { - - address = "195.113.167.75" -> null - - all_tags = [] -> null - - fixed_ip = "10.10.10.39" -> null - - id = "ec66ce9d-c8ca-490f-a249-043b55230f22" -> null - - pool = "public-cesnet-195-113-167-GROUP" -> null - - port_id = "e8dafeed-a6eb-44de-af9b-d5d19844512f" -> null - - region = "brno1" -> null - - tags = [] -> null - - tenant_id = "786566209a7444f89a561172fa28e117" -> null - } - - # module.toplevel.openstack_networking_network_v2.network_default will be destroyed - - resource "openstack_networking_network_v2" "network_default" { - - admin_state_up = true -> null - - all_tags = [] -> null - - availability_zone_hints = [] -> null - - external = false -> null - - id = "ba35e97d-7f04-47b4-a82c-0130a1f217a7" -> null - - mtu = 1442 -> null - - name = "vo-enes-org-tf-demo_network" -> null - - port_security_enabled = true -> null - - region = "brno1" -> null - - shared = false -> null - - tags = [] -> null - - tenant_id = "786566209a7444f89a561172fa28e117" -> null - - transparent_vlan = false -> null - } - - # module.toplevel.openstack_networking_port_v2.bastion_port will be destroyed - - resource "openstack_networking_port_v2" "bastion_port" { - - admin_state_up = true -> null - - all_fixed_ips = [ - - "10.10.10.39", - ] -> null - - all_security_group_ids = [ - - "ed3f6682-e6c9-46b5-983d-3baf25131142", - ] -> null - - all_tags = [] -> null - - device_id = "749623e7-7010-4a09-ac69-400baa610042" -> null - - device_owner = "compute:brno1" -> null - - dns_assignment = [] -> null - - id = "e8dafeed-a6eb-44de-af9b-d5d19844512f" -> null - - mac_address = "fa:16:3e:c1:2b:43" -> null - - name = "vo-enes-org-tf-demo-bastion-server-port" -> null - - network_id = "ba35e97d-7f04-47b4-a82c-0130a1f217a7" -> null - - port_security_enabled = true -> null - - region = "brno1" -> null - - security_group_ids = [ - - "ed3f6682-e6c9-46b5-983d-3baf25131142", - ] -> null - - tags = [] -> null - - tenant_id = "786566209a7444f89a561172fa28e117" -> null - - - binding { - - vif_details = {} -> null - - vnic_type = "normal" -> null - } - - - fixed_ip { - - subnet_id = "a0dfc195-fa9d-4df1-aa6d-7e6ca842e899" -> null - } - } - - # module.toplevel.openstack_networking_port_v2.nodes_ports[0] will be destroyed - - resource "openstack_networking_port_v2" "nodes_ports" { - - admin_state_up = true -> null - - all_fixed_ips = [ - - "10.10.10.201", - ] -> null - - all_security_group_ids = [ - - "ed3f6682-e6c9-46b5-983d-3baf25131142", - ] -> null - - all_tags = [] -> null - - device_id = "809eda35-291a-46e1-a0ae-6d0c954bb7a0" -> null - - device_owner = "compute:brno1" -> null - - dns_assignment = [] -> null - - id = "41fa4b8b-5096-4699-94b6-735afc88ba35" -> null - - mac_address = "fa:16:3e:bb:93:3b" -> null - - name = "vo-enes-org-tf-demo_server_port_1" -> null - - network_id = "ba35e97d-7f04-47b4-a82c-0130a1f217a7" -> null - - port_security_enabled = true -> null - - region = "brno1" -> null - - security_group_ids = [ - - "ed3f6682-e6c9-46b5-983d-3baf25131142", - ] -> null - - tags = [] -> null - - tenant_id = "786566209a7444f89a561172fa28e117" -> null - - - binding { - - vif_details = {} -> null - - vnic_type = "normal" -> null - } - - - fixed_ip { - - subnet_id = "a0dfc195-fa9d-4df1-aa6d-7e6ca842e899" -> null - } - } - - # module.toplevel.openstack_networking_port_v2.nodes_ports[1] will be destroyed - - resource "openstack_networking_port_v2" "nodes_ports" { - - admin_state_up = true -> null - - all_fixed_ips = [ - - "10.10.10.247", - ] -> null - - all_security_group_ids = [ - - "ed3f6682-e6c9-46b5-983d-3baf25131142", - ] -> null - - all_tags = [] -> null - - device_id = "66ae2ce7-2d0e-42b2-bdec-e4a704c69c6c" -> null - - device_owner = "compute:brno1" -> null - - dns_assignment = [] -> null - - id = "9749a231-94db-4c0c-a86f-d5c378bbc9e6" -> null - - mac_address = "fa:16:3e:8d:24:c1" -> null - - name = "vo-enes-org-tf-demo_server_port_2" -> null - - network_id = "ba35e97d-7f04-47b4-a82c-0130a1f217a7" -> null - - port_security_enabled = true -> null - - region = "brno1" -> null - - security_group_ids = [ - - "ed3f6682-e6c9-46b5-983d-3baf25131142", - ] -> null - - tags = [] -> null - - tenant_id = "786566209a7444f89a561172fa28e117" -> null - - - binding { - - vif_details = {} -> null - - vnic_type = "normal" -> null - } - - - fixed_ip { - - subnet_id = "a0dfc195-fa9d-4df1-aa6d-7e6ca842e899" -> null - } - } - - # module.toplevel.openstack_networking_port_v2.nodes_ports[2] will be destroyed - - resource "openstack_networking_port_v2" "nodes_ports" { - - admin_state_up = true -> null - - all_fixed_ips = [ - - "10.10.10.32", - ] -> null - - all_security_group_ids = [ - - "ed3f6682-e6c9-46b5-983d-3baf25131142", - ] -> null - - all_tags = [] -> null - - device_id = "e1f199f5-b57a-4ca0-bc8e-7e675fdfae13" -> null - - device_owner = "compute:brno1" -> null - - dns_assignment = [] -> null - - id = "d4bb617c-bce7-4572-9a07-1f638e482da2" -> null - - mac_address = "fa:16:3e:b3:c2:fe" -> null - - name = "vo-enes-org-tf-demo_server_port_3" -> null - - network_id = "ba35e97d-7f04-47b4-a82c-0130a1f217a7" -> null - - port_security_enabled = true -> null - - region = "brno1" -> null - - security_group_ids = [ - - "ed3f6682-e6c9-46b5-983d-3baf25131142", - ] -> null - - tags = [] -> null - - tenant_id = "786566209a7444f89a561172fa28e117" -> null - - - binding { - - vif_details = {} -> null - - vnic_type = "normal" -> null - } - - - fixed_ip { - - subnet_id = "a0dfc195-fa9d-4df1-aa6d-7e6ca842e899" -> null - } - } - - # module.toplevel.openstack_networking_router_interface_v2.router_default_interface will be destroyed - - resource "openstack_networking_router_interface_v2" "router_default_interface" { - - force_destroy = false -> null - - id = "8ea9c9cf-be4e-429a-8e1c-ae3b562f69d2" -> null - - port_id = "8ea9c9cf-be4e-429a-8e1c-ae3b562f69d2" -> null - - region = "brno1" -> null - - router_id = "c2747273-6f7b-4733-a919-96701ea0a153" -> null - - subnet_id = "a0dfc195-fa9d-4df1-aa6d-7e6ca842e899" -> null - } - - # module.toplevel.openstack_networking_router_v2.router_default will be destroyed - - resource "openstack_networking_router_v2" "router_default" { - - admin_state_up = true -> null - - all_tags = [] -> null - - availability_zone_hints = [] -> null - - distributed = false -> null - - enable_snat = true -> null - - external_gateway = "9edb9ab8-8742-49e3-9461-528f31397672" -> null - - external_network_id = "9edb9ab8-8742-49e3-9461-528f31397672" -> null - - id = "c2747273-6f7b-4733-a919-96701ea0a153" -> null - - name = "vo-enes-org-tf-demo_infra-test" -> null - - region = "brno1" -> null - - tags = [] -> null - - tenant_id = "786566209a7444f89a561172fa28e117" -> null - - - external_fixed_ip { - - ip_address = "195.113.167.204" -> null - - subnet_id = "6c6803e7-bc74-4e74-ad7a-581ad3943c04" -> null - } - } - - # module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_http4 will be destroyed - - resource "openstack_networking_secgroup_rule_v2" "secgroup_rule_http4" { - - direction = "ingress" -> null - - ethertype = "IPv4" -> null - - id = "9df51e87-e30c-46f4-ae9a-a6d833759b9c" -> null - - port_range_max = 80 -> null - - port_range_min = 80 -> null - - protocol = "tcp" -> null - - region = "brno1" -> null - - remote_ip_prefix = "0.0.0.0/0" -> null - - security_group_id = "ed3f6682-e6c9-46b5-983d-3baf25131142" -> null - - tenant_id = "786566209a7444f89a561172fa28e117" -> null - } - - # module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_https4 will be destroyed - - resource "openstack_networking_secgroup_rule_v2" "secgroup_rule_https4" { - - direction = "ingress" -> null - - ethertype = "IPv4" -> null - - id = "3e4a6d33-f68e-4c8c-8408-9594c6e41e61" -> null - - port_range_max = 443 -> null - - port_range_min = 443 -> null - - protocol = "tcp" -> null - - region = "brno1" -> null - - remote_ip_prefix = "0.0.0.0/0" -> null - - security_group_id = "ed3f6682-e6c9-46b5-983d-3baf25131142" -> null - - tenant_id = "786566209a7444f89a561172fa28e117" -> null - } - - # module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_icmp4 will be destroyed - - resource "openstack_networking_secgroup_rule_v2" "secgroup_rule_icmp4" { - - direction = "ingress" -> null - - ethertype = "IPv4" -> null - - id = "5f6519c2-ed4a-445d-b63c-7c030eab581d" -> null - - port_range_max = 0 -> null - - port_range_min = 0 -> null - - protocol = "icmp" -> null - - region = "brno1" -> null - - remote_ip_prefix = "0.0.0.0/0" -> null - - security_group_id = "ed3f6682-e6c9-46b5-983d-3baf25131142" -> null - - tenant_id = "786566209a7444f89a561172fa28e117" -> null - } - - # module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_ssh4 will be destroyed - - resource "openstack_networking_secgroup_rule_v2" "secgroup_rule_ssh4" { - - direction = "ingress" -> null - - ethertype = "IPv4" -> null - - id = "f56e25f7-21c1-4337-b6be-7e8def76bfff" -> null - - port_range_max = 22 -> null - - port_range_min = 22 -> null - - protocol = "tcp" -> null - - region = "brno1" -> null - - remote_ip_prefix = "0.0.0.0/0" -> null - - security_group_id = "ed3f6682-e6c9-46b5-983d-3baf25131142" -> null - - tenant_id = "786566209a7444f89a561172fa28e117" -> null - } - - # module.toplevel.openstack_networking_secgroup_v2.secgroup_default will be destroyed - - resource "openstack_networking_secgroup_v2" "secgroup_default" { - - all_tags = [] -> null - - description = "vo-enes-org-tf-demo Security group" -> null - - id = "ed3f6682-e6c9-46b5-983d-3baf25131142" -> null - - name = "vo-enes-org-tf-demo_security_group" -> null - - region = "brno1" -> null - - tags = [] -> null - - tenant_id = "786566209a7444f89a561172fa28e117" -> null - } - - # module.toplevel.openstack_networking_subnet_v2.subnet_default will be destroyed - - resource "openstack_networking_subnet_v2" "subnet_default" { - - all_tags = [] -> null - - cidr = "10.10.10.0/24" -> null - - dns_nameservers = [ - - "1.1.1.1", - - "8.8.8.8", - ] -> null - - enable_dhcp = true -> null - - gateway_ip = "10.10.10.1" -> null - - id = "a0dfc195-fa9d-4df1-aa6d-7e6ca842e899" -> null - - ip_version = 4 -> null - - name = "vo-enes-org-tf-demo_subnet" -> null - - network_id = "ba35e97d-7f04-47b4-a82c-0130a1f217a7" -> null - - no_gateway = false -> null - - region = "brno1" -> null - - service_types = [] -> null - - tags = [] -> null - - tenant_id = "786566209a7444f89a561172fa28e117" -> null - - - allocation_pool { - - end = "10.10.10.254" -> null - - start = "10.10.10.2" -> null - } - - - allocation_pools { - - end = "10.10.10.254" -> null - - start = "10.10.10.2" -> null - } - } - -Plan: 0 to add, 0 to change, 26 to destroy. - -Do you really want to destroy all resources? - Terraform will destroy all your managed infrastructure, as shown above. - There is no undo. Only 'yes' will be accepted to confirm. - - Enter a value: yes - -module.toplevel.openstack_compute_volume_attach_v2.nodes_extra_volumes_attachments[1]: Destroying... [id=66ae2ce7-2d0e-42b2-bdec-e4a704c69c6c/58ed3694-5141-4db1-b156-3c46a9f5654b] -module.toplevel.openstack_compute_floatingip_associate_v2.bastion_fip_associate: Destroying... [id=195.113.167.75/749623e7-7010-4a09-ac69-400baa610042/] -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_icmp4: Destroying... [id=5f6519c2-ed4a-445d-b63c-7c030eab581d] -module.toplevel.openstack_compute_volume_attach_v2.nodes_extra_volumes_attachments[2]: Destroying... [id=e1f199f5-b57a-4ca0-bc8e-7e675fdfae13/adbd2ddc-600e-4d77-aa3f-ed66d94ae2dd] -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_https4: Destroying... [id=3e4a6d33-f68e-4c8c-8408-9594c6e41e61] -module.toplevel.openstack_compute_volume_attach_v2.nodes_extra_volumes_attachments[0]: Destroying... [id=809eda35-291a-46e1-a0ae-6d0c954bb7a0/a527bff6-6a80-469b-89d1-71fcf3f7d0b1] -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_http4: Destroying... [id=9df51e87-e30c-46f4-ae9a-a6d833759b9c] -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_ssh4: Destroying... [id=f56e25f7-21c1-4337-b6be-7e8def76bfff] -module.toplevel.openstack_networking_router_interface_v2.router_default_interface: Destroying... [id=8ea9c9cf-be4e-429a-8e1c-ae3b562f69d2] -module.toplevel.openstack_compute_floatingip_associate_v2.bastion_fip_associate: Destruction complete after 3s -module.toplevel.openstack_networking_floatingip_v2.bastion_fip: Destroying... [id=ec66ce9d-c8ca-490f-a249-043b55230f22] -module.toplevel.openstack_compute_instance_v2.bastion: Destroying... [id=749623e7-7010-4a09-ac69-400baa610042] -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_icmp4: Destruction complete after 6s -module.toplevel.openstack_compute_volume_attach_v2.nodes_extra_volumes_attachments[2]: Destruction complete after 9s -module.toplevel.openstack_compute_volume_attach_v2.nodes_extra_volumes_attachments[1]: Destruction complete after 9s -module.toplevel.openstack_compute_volume_attach_v2.nodes_extra_volumes_attachments[0]: Destruction complete after 9s -module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[1]: Destroying... [id=58ed3694-5141-4db1-b156-3c46a9f5654b] -module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[2]: Destroying... [id=adbd2ddc-600e-4d77-aa3f-ed66d94ae2dd] -module.toplevel.openstack_compute_instance_v2.nodes[1]: Destroying... [id=66ae2ce7-2d0e-42b2-bdec-e4a704c69c6c] -module.toplevel.openstack_compute_instance_v2.nodes[0]: Destroying... [id=809eda35-291a-46e1-a0ae-6d0c954bb7a0] -module.toplevel.openstack_networking_floatingip_v2.bastion_fip: Destruction complete after 6s -module.toplevel.openstack_compute_instance_v2.nodes[2]: Destroying... [id=e1f199f5-b57a-4ca0-bc8e-7e675fdfae13] -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_http4: Still destroying... [id=9df51e87-e30c-46f4-ae9a-a6d833759b9c, 10s elapsed] -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_ssh4: Still destroying... [id=f56e25f7-21c1-4337-b6be-7e8def76bfff, 10s elapsed] -module.toplevel.openstack_networking_router_interface_v2.router_default_interface: Still destroying... [id=8ea9c9cf-be4e-429a-8e1c-ae3b562f69d2, 10s elapsed] -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_https4: Still destroying... [id=3e4a6d33-f68e-4c8c-8408-9594c6e41e61, 10s elapsed] -module.toplevel.openstack_networking_router_interface_v2.router_default_interface: Destruction complete after 11s -module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[0]: Destroying... [id=a527bff6-6a80-469b-89d1-71fcf3f7d0b1] -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_http4: Destruction complete after 11s -module.toplevel.openstack_networking_router_v2.router_default: Destroying... [id=c2747273-6f7b-4733-a919-96701ea0a153] -module.toplevel.openstack_compute_instance_v2.bastion: Still destroying... [id=749623e7-7010-4a09-ac69-400baa610042, 10s elapsed] -module.toplevel.openstack_compute_instance_v2.bastion: Destruction complete after 10s -module.toplevel.openstack_networking_port_v2.bastion_port: Destroying... [id=e8dafeed-a6eb-44de-af9b-d5d19844512f] -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_https4: Destruction complete after 16s -module.toplevel.openstack_networking_router_v2.router_default: Destruction complete after 7s -module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[1]: Still destroying... [id=58ed3694-5141-4db1-b156-3c46a9f5654b, 10s elapsed] -module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[2]: Still destroying... [id=adbd2ddc-600e-4d77-aa3f-ed66d94ae2dd, 10s elapsed] -module.toplevel.openstack_compute_instance_v2.nodes[1]: Still destroying... [id=66ae2ce7-2d0e-42b2-bdec-e4a704c69c6c, 10s elapsed] -module.toplevel.openstack_compute_instance_v2.nodes[0]: Still destroying... [id=809eda35-291a-46e1-a0ae-6d0c954bb7a0, 10s elapsed] -module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[2]: Destruction complete after 10s -module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[1]: Destruction complete after 10s -module.toplevel.openstack_compute_instance_v2.nodes[0]: Destruction complete after 10s -module.toplevel.openstack_compute_instance_v2.nodes[1]: Destruction complete after 10s -module.toplevel.openstack_compute_instance_v2.nodes[2]: Still destroying... [id=e1f199f5-b57a-4ca0-bc8e-7e675fdfae13, 10s elapsed] -module.toplevel.openstack_compute_instance_v2.nodes[2]: Destruction complete after 10s -module.toplevel.openstack_compute_keypair_v2.pubkey: Destroying... [id=vo-enes-org-tf-demo-keypair] -module.toplevel.openstack_networking_port_v2.nodes_ports[0]: Destroying... [id=41fa4b8b-5096-4699-94b6-735afc88ba35] -module.toplevel.openstack_networking_port_v2.nodes_ports[2]: Destroying... [id=d4bb617c-bce7-4572-9a07-1f638e482da2] -module.toplevel.openstack_networking_port_v2.nodes_ports[1]: Destroying... [id=9749a231-94db-4c0c-a86f-d5c378bbc9e6] -module.toplevel.openstack_compute_keypair_v2.pubkey: Destruction complete after 1s -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_ssh4: Still destroying... [id=f56e25f7-21c1-4337-b6be-7e8def76bfff, 20s elapsed] -module.toplevel.openstack_networking_port_v2.bastion_port: Destruction complete after 7s -module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[0]: Still destroying... [id=a527bff6-6a80-469b-89d1-71fcf3f7d0b1, 10s elapsed] -module.toplevel.openstack_blockstorage_volume_v3.nodes_extra_volumes[0]: Destruction complete after 10s -module.toplevel.openstack_networking_secgroup_rule_v2.secgroup_rule_ssh4: Destruction complete after 21s -module.toplevel.openstack_networking_port_v2.nodes_ports[0]: Destruction complete after 6s -module.toplevel.openstack_networking_port_v2.nodes_ports[1]: Destruction complete after 6s -module.toplevel.openstack_networking_port_v2.nodes_ports[2]: Destruction complete after 6s -module.toplevel.openstack_networking_secgroup_v2.secgroup_default: Destroying... [id=ed3f6682-e6c9-46b5-983d-3baf25131142] -module.toplevel.openstack_networking_subnet_v2.subnet_default: Destroying... [id=a0dfc195-fa9d-4df1-aa6d-7e6ca842e899] -module.toplevel.openstack_networking_secgroup_v2.secgroup_default: Destruction complete after 9s -module.toplevel.openstack_networking_subnet_v2.subnet_default: Destruction complete after 10s -module.toplevel.openstack_networking_network_v2.network_default: Destroying... [id=ba35e97d-7f04-47b4-a82c-0130a1f217a7] -module.toplevel.openstack_networking_network_v2.network_default: Destruction complete after 6s - -Destroy complete! Resources: 26 destroyed. -[freznicek@lenovo-t14 terraform 0]$ - diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/README.md b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/README.md deleted file mode 100644 index 417021f98367e25324f661bb0c7b57de30659cda..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# vo.thepund.it Infrastructure as Code demo - -There are presented two simple approaches: - * [infrastructure using terraform (best practice)](./terraform) - * [infrastructure using command-line openstack client](./commandline) diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/commandline/README.md b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/commandline/README.md deleted file mode 100644 index a4aa7195653c58c1e5c64e02cab6c9438623b3b2..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/commandline/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Build OpenStack infrastructure from command-line using openstack client - -## Pre-requisites - * Linux/Mac/WSL2 terminal - * installed openstack client ([how?](https://docs.fuga.cloud/how-to-use-the-openstack-cli-tools-on-linux)) - * downloaded application credentials from OpenStack Horizon dashboard ([how?](https://docs.cloud.muni.cz/cloud/cli/#getting-credentials)) - - -## How to use the script -```sh -./cmdline-demo-group-project.sh "infrastructure-a" -``` - -## Infrastructure schema - - diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/commandline/cmdline-demo-group-project.sh b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/commandline/cmdline-demo-group-project.sh deleted file mode 100755 index 3445b0b2ac7f0a0a07c442cae7c412631700791e..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/commandline/cmdline-demo-group-project.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/env bash -# MetaCentrum MCC openstack command-line demo - group projecp -# Usage: cmdline-demo-group-project.sh [ostack-entities-prefix] -# - -SCRIPT_DIR=$(dirname $(readlink -f $0)) -############################################################################# -# variables -############################################################################# -ENTITIES_PREFIX="${1:-"the-pund-it"}" -EXTERNAL_NETWORK_NAME="public-muni-147-251-124-GROUP" -KEYPAIR_NAME="${ENTITIES_PREFIX}-demo-keypair" -NETWORK_NAME="${ENTITIES_PREFIX}-demo-network" -SUBNET_NAME="${ENTITIES_PREFIX}-demo-subnet" -SUBNET_CIDR="192.168.0.0/24" -SERVER_NAME="${ENTITIES_PREFIX}-demo-server" -FLAVOR_NAME="standard.2core-16ram" -IMAGE_NAME="ubuntu-jammy-x86_64" -VM_LOGIN="ubuntu" -ROUTER_NAME="${ENTITIES_PREFIX}-demo-router" -FIP_FILE="fip.txt" -SECGROUP_NAME="${ENTITIES_PREFIX}-demo-secgroup" -SSH_KEYPAIR_DIR="${HOME}/.ssh/generated-keypair" - -############################################################################# -# functions -############################################################################# -source ${SCRIPT_DIR}/../../../../common/lib.sh.inc - -############################################################################# -# main steps -############################################################################# - -# test openstack client version -if ! openstack --version; then - log "Install openstack client (yum / apt install python3-openstackclient)" -fi - -# delete objects (from previous run) -log "Delete previously created objects" -delete_objects_group_project - -log "List currently allocated objects" -list_objects - -log_keypress "Create (generate) locally SSH keypair, upload public SSH key to cloud" -mkdir -p ${SSH_KEYPAIR_DIR} -chmod 700 ${SSH_KEYPAIR_DIR} -ssh-keygen -t rsa -b 4096 -f "${SSH_KEYPAIR_DIR}/id_rsa.${KEYPAIR_NAME}" -openstack keypair create --type ssh --public-key "${SSH_KEYPAIR_DIR}/id_rsa.${KEYPAIR_NAME}.pub" "${KEYPAIR_NAME}" -ls -la ${SSH_KEYPAIR_DIR}/id_rsa.${KEYPAIR_NAME}* - -log_keypress "Create cloud security groups (custom VM firewall) to allow outgoing traffic and incomming SSH traffic on port 22" -openstack security group create --description "${ENTITIES_PREFIX} demo default security group" "${SECGROUP_NAME}" -openstack security group rule create --ingress --proto tcp --remote-ip 0.0.0.0/0 --dst-port 22 "${SECGROUP_NAME}" -openstack security group rule create --egress --proto tcp --remote-ip 0.0.0.0/0 --dst-port 1:65535 "${SECGROUP_NAME}" - -log_keypress "Create cloud private network and subnet, so far isolated (CIDR:${SUBNET_CIDR})" -openstack network create "${NETWORK_NAME}" -NETWORK_ID=$(openstack network show "${NETWORK_NAME}" -f value -c id) -openstack subnet create "${SUBNET_NAME}" --network "${NETWORK_ID}" --subnet-range "${SUBNET_CIDR}" - -log_keypress "Create cloud VM instance \"${SERVER_NAME}\" with following configuration:\n" \ - " flavor: ${FLAVOR_NAME}, image/os: ${IMAGE_NAME}, network: ${NETWORK_NAME}\n" \ - " keypair: ${KEYPAIR_NAME}, sec-group/firewall: ${SECGROUP_NAME})" -openstack server create --flavor "${FLAVOR_NAME}" --image "${IMAGE_NAME}" \ - --network "${NETWORK_ID}" --key-name "${KEYPAIR_NAME}" \ - --security-group "${SECGROUP_NAME}" "${SERVER_NAME}" -SERVER_ID=$(openstack server show "${SERVER_NAME}" -f value -c id) - -log "Wait for VM instance \"${SERVER_NAME}\" being ACTIVE" -vm_wait_for_status "${SERVER_NAME}" "ACTIVE" - -log "Route VM from internal software defined networking outside" -log_keypress " 1] Create route, associate router with external provider network and internal subnet (${SUBNET_CIDR})" -openstack router create "${ROUTER_NAME}" -openstack router set "${ROUTER_NAME}" --external-gateway "${EXTERNAL_NETWORK_NAME}" -openstack router add subnet "${ROUTER_NAME}" "${SUBNET_NAME}" - -log_keypress " 2] Allocate single FIP (floating ip) from external provider network" -FIP=$(openstack floating ip create "${EXTERNAL_NETWORK_NAME}" -f value -c name) -echo "${FIP}" > "${FIP_FILE}" -echo "Obtained public FIP ${FIP}" - -log_keypress " 3] Assign selected FIP with created VM" -openstack server add floating ip "${SERVER_NAME}" "${FIP}" - -log "Test access to the VM server instance" -log_keypress " 1] TCP ping (ncat -z ${FIP} 22)" -test_vm_access "${FIP}" -log_keypress " 2] SSH command (ssh -i ${SSH_KEYPAIR_DIR}/id_rsa.${KEYPAIR_NAME} ${VM_LOGIN}@${FIP})" -ssh-keygen -R ${FIP} &>/dev/null -ssh -i "${SSH_KEYPAIR_DIR}/id_rsa.${KEYPAIR_NAME}" "${VM_LOGIN}@${FIP}" 'echo "";uname -a;uptime' - -log_keypress "Object summary:" -list_objects - -log_keypress "Teardown of the objects" -delete_objects_group_project - diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/commandline/obrazek.png b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/commandline/obrazek.png deleted file mode 100644 index c866407bf731fac84926cb6e8e2c81ac026dc826..0000000000000000000000000000000000000000 Binary files a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/commandline/obrazek.png and /dev/null differ diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/README.md b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/README.md deleted file mode 100644 index f525e3301bdf29e3d6ad95b9ef84a44d03505441..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# Build and maintain OpenStack infrastructure from command-line using terraform - -This Terraform module creates simple virtual infrastructure cluster in OpenStack. - -## Pre-requisites - * Linux/Mac/WSL2 terminal - * installed terraform ([how?](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli#install-terraform)) - * downloaded application credentials from OpenStack Horizon dashboard ([how?](https://docs.cloud.muni.cz/cloud/cli/#getting-credentials)) - -## Create Infrastructure - -1. Clone the repository. -1. Load you OpenStack application credentials to environment variables `source ~/conf/prod-meta-cloud-new-openstack-all-roles-openrc.sh` -1. Override any variable if needed. Every variable specified in [modules/infra/variables.tf](modules/infra/variables.tf) can be overridden in the [main.tf](main.tf) file in its *module* section. -1. In the root folder run `terraform init`. -1. In the root folder run `terraform validate`. -1. Run `terraform plan -out plan1` to generate terraform plan. -1. Run `terraform apply "plan1"` to apply the plan. - -## Destroy Infrastructure - -To delete all created resources run the following commands: - -```sh -terraform plan -destroy -out plan1 -terraform apply "plan1" -``` - -## SSH to nodes - -### node with associated FIP -Connecting to master is as easy as `ssh ubuntu@<any-master-ip>` - -### other nodes -Establish SSH VPN to first head node using `sshuttle`. - -```sh -sshuttle -r ubuntu@<any-master-ip> 192.168.0.0/24 -``` - -Connection to any other node is then via SSH VPN (sshuttle) on internal network i.e. `ssh ubuntu@<vm-internal-ip-from-192.168.0.0/24>` diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/main.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/main.tf deleted file mode 100644 index 8371b68fd078b9fe5c4172bab8f021f6a165b6ca..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/main.tf +++ /dev/null @@ -1,39 +0,0 @@ -terraform { - backend "local" {} -} - -terraform { - required_providers { - openstack = { - source = "terraform-provider-openstack/openstack" - version = "~> 1.47.0" - } - } -} - - -provider "openstack" { - # auth arguments are read from environment variables (sourced opestack RC file) - auth_url = "https://identity.cloud.muni.cz/v3" -} - - -module "demo" { - source = "./modules/infra" - - # Example of variable override - nodes_count = 1 - kusername = "thepundit" - public_key = "~/.ssh/id_rsa.pub" - - nodes_flavor = "standard.2core-16ram" - image = "ubuntu-jammy-x86_64" - - int_network = "192.168.0.0/24" - pool = "public-muni-147-251-124-GROUP" - - # attach additional single volume 500GB - node_volumes_count = 1 - node_volume_size = 500 -} - diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/cloudinit.txt b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/cloudinit.txt deleted file mode 100644 index b760d4eb67613269833858fb3bec83579c51d0ad..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/cloudinit.txt +++ /dev/null @@ -1,6 +0,0 @@ -users: - - default - - name: ubuntu - shell: /bin/bash - ssh_authorized_keys: - - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDSS8J5AStswCnf2JQboCyue8JzX5T/Tsg68LasOT3XZkAMelVrjYBIZ/0P858WMTMW5Qc+ebSmbm0eOopuaN9FrZW2ZsaDyzPamAuxseoTkRV+7Oz5NOF0WCYspgLsbMcaQ+F+qrKzMJRLwduhL67inIJVYkgeXY6S1N2wZAEgYUE3jbZrhaGNA1kQf2dJoMtnikrtOB+vyZkLgFRfgjmq+ny5rCM277otFxwCHhm2+jrWtM8lPY6kJ6WcZfg2njdYW3Oda479jMUg28t4pjqmBygKl3MQ9MOVlJkde4Ez5LhTynXMkSPhH5PnzQrfkQMU2YozCNQ2KBiGDdB3Cd2Lqsou32zUk1/sKc+aN1+8jtm+iogpgYxAPwyCh8S/brVbDu9BerowNRMa4Nual/7YKdtwPEClFp34dgV7tvXVcnVF/TtAkJAUtd02Fh9iS2iM9IrC0gkDEBUr0HGY5U83zODf356aVGTE6hs65wsURGAT6z/DvWYZtMLWJB8Y3p7qHGV1N1OHSLDHgjzuhAHI54h8zhjQaiPsH3Yx4324D1ndtJX8DeWkKdzCNARnw8sfIUhCkwbgv0v6ZkDy8yP6jsHjBc89NjB9kNw1dZcnaDLNqGctcCy50BOeciBYC598i0hec2MieoN0Z2E7lbWZps/+0korxtIxp7TzcKfiKw== secureduser@securedhost diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/instances.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/instances.tf deleted file mode 100644 index de02a10795eac09ce404c6d5e472d584582bcae3..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/instances.tf +++ /dev/null @@ -1,20 +0,0 @@ - -#################### -# Define instances # -#################### - -resource "openstack_compute_instance_v2" "nodes" { - count = var.nodes_count - name = "${var.kusername}-${var.nodes_name_prefix}-${count.index+1}" - image_name = var.image - flavor_name = var.nodes_flavor - key_pair = openstack_compute_keypair_v2.pubkey.name - security_groups = [openstack_networking_secgroup_v2.secgroup_default.name] - user_data = "#cloud-config\nhostname: ${var.kusername}-${var.nodes_name_prefix}-${count.index+1}.local\n${file("${path.module}/cloudinit.txt")}" - - network { - uuid = openstack_networking_network_v2.network_default.id - port = element(openstack_networking_port_v2.ports.*.id, count.index) - } - -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/main.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/main.tf deleted file mode 100644 index 9de28ef6fc670b7465f1440abf451ad6cccd8436..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/main.tf +++ /dev/null @@ -1,6 +0,0 @@ - -resource "openstack_compute_keypair_v2" "pubkey" { - name = "${var.kusername}-demo" - public_key = file("${var.public_key}") -} - diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/networks.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/networks.tf deleted file mode 100644 index 7f30c979a1755259a152897db21736e13b7630f2..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/networks.tf +++ /dev/null @@ -1,54 +0,0 @@ -############################################################### -# Define networking # -# Security group rules are in separate file secgroup_rules.tf # -############################################################### - -resource "openstack_networking_network_v2" "network_default" { - name = "${var.kusername}_demo" - admin_state_up = "true" -} - -resource "openstack_networking_subnet_v2" "subnet_default" { - name = "${var.kusername}_demo" - network_id = openstack_networking_network_v2.network_default.id - cidr = var.int_network - ip_version = 4 - dns_nameservers = ["1.1.1.1", "8.8.8.8"] -} - -data "openstack_networking_network_v2" "terraform-demo-external-net" { - name = var.pool -} - -resource "openstack_networking_router_v2" "router_default" { - name = "${var.kusername}_demo" - admin_state_up = "true" - external_network_id = data.openstack_networking_network_v2.terraform-demo-external-net.id -} - -resource "openstack_networking_router_interface_v2" "terraform-demo-router-interface-1" { - router_id = openstack_networking_router_v2.router_default.id - subnet_id = openstack_networking_subnet_v2.subnet_default.id -} - -# Floating IPs (only for single (first) node) -resource "openstack_networking_floatingip_v2" "fip" { - pool = var.pool -} - -resource "openstack_compute_floatingip_associate_v2" "res_fip_associate" { - floating_ip = openstack_networking_floatingip_v2.fip.address - instance_id = openstack_compute_instance_v2.nodes[0].id -} - -# Ports -resource "openstack_networking_port_v2" "ports" { - count = var.nodes_count - name = "${var.kusername}_port_${count.index+1}" - network_id = openstack_networking_network_v2.network_default.id - admin_state_up = "true" - security_group_ids = [openstack_networking_secgroup_v2.secgroup_default.id] - fixed_ip { - subnet_id = openstack_networking_subnet_v2.subnet_default.id - } -} \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/output.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/output.tf deleted file mode 100644 index c40645dd8c9d4b82bfeef453f4227d2f740cbd9c..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/output.tf +++ /dev/null @@ -1,7 +0,0 @@ -output "node_instance_ip" { - value = openstack_compute_instance_v2.nodes[*].access_ip_v4 -} - -output "node_fip" { - value = openstack_networking_floatingip_v2.fip.address -} \ No newline at end of file diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/providers.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/providers.tf deleted file mode 100644 index ef4ba65152b61ce99a5dfe96616724d08fad199b..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/providers.tf +++ /dev/null @@ -1,9 +0,0 @@ -terraform { - required_providers { - openstack = { - source = "terraform-provider-openstack/openstack" - version = "~> 1.47.0" - } - } -} - diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/secgroup_rules.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/secgroup_rules.tf deleted file mode 100644 index 3d04ced43df7bd96881f9abcee8200898b232059..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/secgroup_rules.tf +++ /dev/null @@ -1,57 +0,0 @@ -################################## -# Define Network Security Groups # -################################## - - -resource "openstack_networking_secgroup_v2" "secgroup_default" { - name = "${var.kusername}_demo" - description = "Security group for demo" -} - - -# Allow all internal TCP & UDP - -resource "openstack_networking_secgroup_rule_v2" "alltcp4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "tcp" - port_range_min = 1 - port_range_max = 32768 - remote_ip_prefix = var.int_network - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} - -resource "openstack_networking_secgroup_rule_v2" "alludp4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "udp" - port_range_min = 1 - port_range_max = 32768 - remote_ip_prefix = var.int_network - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} - - -# External communication - -# ICMP -resource "openstack_networking_secgroup_rule_v2" "icmp4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "icmp" - port_range_min = 0 - port_range_max = 0 - remote_ip_prefix = "0.0.0.0/0" - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} - -# SSH -resource "openstack_networking_secgroup_rule_v2" "ssh4" { - direction = "ingress" - ethertype = "IPv4" - protocol = "tcp" - port_range_min = 22 - port_range_max = 22 - remote_ip_prefix = "0.0.0.0/0" - security_group_id = openstack_networking_secgroup_v2.secgroup_default.id -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/variables.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/variables.tf deleted file mode 100644 index 8c1ed8f15f9f3d4893cb6c3da51069744e7813fc..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/variables.tf +++ /dev/null @@ -1,58 +0,0 @@ -variable "kusername" { - description = "Name prefix for all resources. Use a-z, 0-9 and the hyphen (-) only." - default = "demo" -} - -variable "public_key" { - default = "~/.ssh/id_rsa.pub" -} - -################## -# nodes settings # -################## -variable "nodes_count" { - default = 3 -} - -variable "nodes_name_prefix" { - description = "Use a-z, 0-9 and the hyphen (-) only." - default = "" -} - -variable "nodes_flavor" { - default = "hpc.8core-32ram-ssd-ephem" -} - - -variable "int_network" { - description = "Internal network address, use CIDR notation" - default = "10.0.0.0/24" -} - -variable "pool" { - description = "FIP pool" - default = "public-cesnet-195-113-167-GROUP" -} - -variable "image" { - description = "Image used for virtual nodes" - default = "88f8e72a-bbf0-4ccc-8ff2-4f3188cd0d18" -} - -variable "ssh_user_name" { - default = "ubuntu" -} - -######################### -# node volumes -######################### - -variable "node_volumes_count" { - description = "Number of volumes added to nodes (allowed values: 0 to disable attaching volumes, 1 single volume to attach)" - default = "" -} - -variable "node_volume_size" { - description = "Size of volume attached to nodes (in GB)" - default = 500 -} diff --git a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/volumes.tf b/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/volumes.tf deleted file mode 100644 index 8e5c9f12df0d1d3cfb7565af22f2ac9c9c528c0a..0000000000000000000000000000000000000000 --- a/openstack-infrastructure-as-code-automation/clouds/g1/brno/vo.thepund.it/terraform/modules/infra/volumes.tf +++ /dev/null @@ -1,14 +0,0 @@ - -resource "openstack_blockstorage_volume_v3" "volumes_b" { - count = var.node_volumes_count != "" ? var.node_volumes_count : var.nodes_count - name = "${var.kusername}-node-volume-b-${count.index+1}" - size = var.node_volume_size -} - -resource "openstack_compute_volume_attach_v2" "volumes_b_attachments" { - count = var.node_volumes_count != "" ? var.node_volumes_count : var.nodes_count - instance_id = element(openstack_compute_instance_v2.nodes.*.id, count.index) - volume_id = element(openstack_blockstorage_volume_v3.volumes_b.*.id, count.index) - #device = "/dev/sdb" -} -