From 29ced93663a13b330f4bbddb913b2d0db578994d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Franti=C5=A1ek=20=C5=98ezn=C3=AD=C4=8Dek?=
 <246254@mail.muni.cz>
Date: Tue, 16 Jan 2024 14:55:26 +0100
Subject: [PATCH] feat: g1 to g2 migration IaaS code

---
 clouds/g1-to-g2-migration/README.md           |  2 ++
 .../general/commandline/README.md             |  4 ++++
 .../general/terraform/README.md               | 24 +++++--------------
 3 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/clouds/g1-to-g2-migration/README.md b/clouds/g1-to-g2-migration/README.md
index 91f1b11..85771c7 100644
--- a/clouds/g1-to-g2-migration/README.md
+++ b/clouds/g1-to-g2-migration/README.md
@@ -1 +1,3 @@
 # e-INFRA CZ G1 to G2 cloud migration resources
+
+You can find here G1 to G2 migration resources in [terraform](./general/terraform/) and shell [commandline](./general/commandline/).
\ No newline at end of file
diff --git a/clouds/g1-to-g2-migration/general/commandline/README.md b/clouds/g1-to-g2-migration/general/commandline/README.md
index 0978b80..93e240e 100644
--- a/clouds/g1-to-g2-migration/general/commandline/README.md
+++ b/clouds/g1-to-g2-migration/general/commandline/README.md
@@ -26,3 +26,7 @@ How does the basic infrastructure looks like?
 * public floating ip address
 
 ![basic-infrastructure.png](/clouds/common/pictures/basic-infrastructure.png)
+
+## G1 and G2 cloud differences
+
+Inspect ([g1-prod-brno.sh.inc](./g1-prod-brno.sh.inc), [g2-prod-brno.sh.inc](./g2-prod-brno.sh.inc), [g2-prod-ostrava.sh.inc](./g2-prod-ostrava.sh.inc)) include shell files to see what needs to be changed.
\ No newline at end of file
diff --git a/clouds/g1-to-g2-migration/general/terraform/README.md b/clouds/g1-to-g2-migration/general/terraform/README.md
index a69aac4..4033c06 100644
--- a/clouds/g1-to-g2-migration/general/terraform/README.md
+++ b/clouds/g1-to-g2-migration/general/terraform/README.md
@@ -27,30 +27,18 @@ Terraform demonstrates [how to configure VM servers on creation with cloud-init]
 
 e-INFRA.CZ OpenStack cloud distinguishes between two project types: personal and group
 ([more the topic](https://docs.e-infra.cz/compute/openstack/technical-reference/brno-site/get-access/#personal-project)).
-Terraform demo code with additional variable file [`personal-projects.tfvars`](./personal-projects.tfvars) shows how to support both project types i.e. how to parametrize infrastructure definition with minimal code duplications.
 
-There is thin terraform wrapper [`terraform.sh`](./terraform.sh) abstracting the fact which project type you are on. It is not necessary to use the [`terraform.sh`](./terraform.sh) wrapper when you keep in mind that additional terraform variables file [`personal-projects.tfvars`](./personal-projects.tfvars) has to be passed at plan step when you are on personal project.
+Terraform demo code comes with terraform variable files (for instance [`personal-projects.tfvars`](./personal-projects.tfvars)) which show what has to be tuned for particular cloud and project type.
+
 
 ## Using the terraform demo
 
 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/common/variables.tf](modules/common/variables.tf).
-1. In the [terraform root directory](/clouds/g2/ostrava/general/terraform) run following commands to initiate and validate environment
-   * `./terraform.sh validate-tools`
-   * `./terraform.sh detect-cloud`
-   * `./terraform.sh detect-project`
-   * `./terraform.sh init`
-   * `./terraform.sh validate`
-1. In the [same directory](/clouds/g2/ostrava/general/terraform) run commands to deploy cloud infrastructure
-   * `./terraform.sh plan --out plan`
-   * `./terraform.sh apply plan`
-1. Once you need to change the infrastructure, first modify the infrastructure declaration and repeat above steps to deploy changes.
-1. Cloud resources can be deleted with `./terraform.sh destroy`.
-
-> You may use terraform directly without the [`terraform.sh`](./terraform.sh) wrapper, but then keep in your mind that just for personal project type you should pass additional variable file [`personal-projects.tfvars`](./personal-projects.tfvars) at plan step (i.e. `terraform plan --out personal-project.plan --var-file=personal-projects.tfvars`)
-
-Detailed terminal transcripts show how to run terraform demo inside personal project ([with](./terraform-2tier_public_bastion_private_vm_farm-personal-project-wrapper.log) / [without the wrapper](./terraform-2tier_public_bastion_private_vm_farm-personal-project-no-wrapper.log)) as well as under group project([with](./terraform-2tier_public_bastion_private_vm_farm-group-project-wrapper.log) / [without the wrapper](./terraform-2tier_public_bastion_private_vm_farm-group-project-no-wrapper.log)).
+1. Override any infrastructure variables in [main.tf](main.tf) file if needed. Full set of variables can be found in [modules/common/variables.tf](/clouds/common/general/terraform/modules/common/variables.tf).
+1. In the [terraform root directory](/clouds/g2/ostrava/general/terraform) run following command `./terraform-demo.sh <cloud-environment-name>` (for instance `g2-prod-brno`)
+
+Detailed terminal transcripts can be found in [logs/](./logs/) subdirectory..
 
 
 ## Access to the VM nodes
-- 
GitLab