Decommission storagehub-2204-1

This commit is contained in:
Giancarlo Panichi 2024-07-24 16:16:03 +02:00
parent 73161f2071
commit d693a68dad
2 changed files with 5 additions and 232 deletions

View File

@ -29,10 +29,6 @@ module "ssh_settings" {
source = "../../modules/ssh-key-ref"
}
resource "openstack_blockstorage_volume_v3" "storagehub_2204_1_dev_data_volume" {
name = "storagehub_2204_1_data_volume"
size = "25"
}
resource "openstack_blockstorage_volume_v3" "storagehub_3_dev_data_volume" {
name = "storagehub_3_data_volume"
@ -40,42 +36,6 @@ resource "openstack_blockstorage_volume_v3" "storagehub_3_dev_data_volume" {
}
# Instance 22.04
resource "openstack_compute_instance_v2" "storagehub_2204_1_dev" {
name = "storagehub-2204-1"
availability_zone_hints = module.common_variables.availability_zone_no_gpu_name
flavor_name = "m1.medium"
key_pair = module.ssh_settings.ssh_key_name
security_groups = [data.terraform_remote_state.privnet_dns_router.outputs.default_security_group_name, data.terraform_remote_state.privnet_dns_router.outputs.security_group_list.http_and_https_from_the_load_balancers]
block_device {
uuid = module.common_variables.ubuntu_2204.uuid
source_type = "image"
volume_size = 10
boot_index = 0
destination_type = "volume"
delete_on_termination = false
}
# Creates the networks according to input networks
dynamic "network" {
for_each = toset([data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql])
content {
name = network.value
}
}
# user_data script used
user_data = file("${module.common_variables.ubuntu_2204.user_data_file}")
# Do not replace the instance when the ssh key changes
lifecycle {
ignore_changes = [
# Ignore changes to tags, e.g. because a management agent
# updates these based on some ruleset managed elsewhere.
key_pair, user_data, network
]
}
}
# Instances 3
@ -117,12 +77,6 @@ resource "openstack_compute_instance_v2" "storagehub_3_dev" {
resource "openstack_compute_volume_attach_v2" "storagehub_2204_1_dev_attach" {
instance_id = openstack_compute_instance_v2.storagehub_2204_1_dev.id
volume_id = openstack_blockstorage_volume_v3.storagehub_2204_1_dev_data_volume.id
device = "/dev/vdb"
}
resource "openstack_compute_volume_attach_v2" "storagehub_3_dev_attach" {
instance_id = openstack_compute_instance_v2.storagehub_3_dev.id
volume_id = openstack_blockstorage_volume_v3.storagehub_3_dev_data_volume.id
@ -141,14 +95,6 @@ module "dns_records_create" {
source = "../../modules/dns_resources"
dns_resources_map = {
storagehub-2204-1 = {
zone_id = data.terraform_remote_state.privnet_dns_router.outputs.dns_zone_id
name = join(".", ["storagehub-2204-1", data.terraform_remote_state.privnet_dns_router.outputs.dns_zone.zone_name])
description = "StorageHub 22.04 1"
ttl = 8600
type = "CNAME"
records = [local.cname_target]
},
storagehub-3 = {
zone_id = data.terraform_remote_state.privnet_dns_router.outputs.dns_zone_id
name = join(".", ["storagehub-3", data.terraform_remote_state.privnet_dns_router.outputs.dns_zone.zone_name])

View File

@ -1,7 +1,7 @@
{
"version": 4,
"terraform_version": "1.6.4",
"serial": 10,
"serial": 15,
"lineage": "7ae19997-17fe-7f03-9bcb-e326176791ba",
"outputs": {},
"resources": [
@ -396,7 +396,7 @@
{
"mode": "managed",
"type": "openstack_blockstorage_volume_v3",
"name": "storagehub_2204_1_dev_data_volume",
"name": "storagehub_3_dev_data_volume",
"provider": "provider[\"registry.terraform.io/terraform-provider-openstack/openstack\"]",
"instances": [
{
@ -405,8 +405,8 @@
"attachment": [
{
"device": "/dev/vdb",
"id": "d036eaec-d5ff-448d-bd5e-fad39c45ae43",
"instance_id": "e46a5ce6-724a-4663-9352-67e8f0e6d847"
"id": "760379aa-ba97-4d23-9e84-e10ddb7aae88",
"instance_id": "28fafca3-13db-48ce-8453-ae5a1bfd8640"
}
],
"availability_zone": "nova",
@ -414,39 +414,6 @@
"consistency_group_id": null,
"description": "",
"enable_online_resize": null,
"id": "d036eaec-d5ff-448d-bd5e-fad39c45ae43",
"image_id": null,
"metadata": {},
"name": "storagehub_2204_1_data_volume",
"region": "isti_area_pi_1",
"scheduler_hints": [],
"size": 25,
"snapshot_id": "",
"source_replica": null,
"source_vol_id": "",
"timeouts": null,
"volume_type": "cephUnencrypted"
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwfX0="
}
]
},
{
"mode": "managed",
"type": "openstack_blockstorage_volume_v3",
"name": "storagehub_3_dev_data_volume",
"provider": "provider[\"registry.terraform.io/terraform-provider-openstack/openstack\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"attachment": [],
"availability_zone": "nova",
"backup_id": "",
"consistency_group_id": null,
"description": "",
"enable_online_resize": null,
"id": "760379aa-ba97-4d23-9e84-e10ddb7aae88",
"image_id": null,
"metadata": {},
@ -465,92 +432,6 @@
}
]
},
{
"mode": "managed",
"type": "openstack_compute_instance_v2",
"name": "storagehub_2204_1_dev",
"provider": "provider[\"registry.terraform.io/terraform-provider-openstack/openstack\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"access_ip_v4": "10.1.31.73",
"access_ip_v6": "",
"admin_pass": null,
"all_metadata": {},
"all_tags": [],
"availability_zone": "cnr-isti-nova-a",
"availability_zone_hints": "cnr-isti-nova-a",
"block_device": [
{
"boot_index": 0,
"delete_on_termination": false,
"destination_type": "volume",
"device_type": "",
"disk_bus": "",
"guest_format": "",
"multiattach": false,
"source_type": "image",
"uuid": "54768889-8556-4be4-a2eb-82a4d9b34627",
"volume_size": 10,
"volume_type": ""
}
],
"config_drive": null,
"created": "2024-07-18 09:46:24 +0000 UTC",
"flavor_id": "4",
"flavor_name": "m1.medium",
"force_delete": false,
"id": "e46a5ce6-724a-4663-9352-67e8f0e6d847",
"image_id": "Attempt to boot from volume - no image supplied",
"image_name": null,
"key_pair": "Giancarlo Panichi",
"metadata": null,
"name": "storagehub-2204-1",
"network": [
{
"access_network": false,
"fixed_ip_v4": "10.1.31.73",
"fixed_ip_v6": "",
"mac": "fa:16:3e:28:ca:51",
"name": "d4s-dev-cloud-main",
"port": "",
"uuid": "e0af5eba-f24a-4d0d-8184-bc654b980c4a"
},
{
"access_network": false,
"fixed_ip_v4": "192.168.2.164",
"fixed_ip_v6": "",
"mac": "fa:16:3e:f1:cb:bd",
"name": "postgresql-srv-net",
"port": "",
"uuid": "00422a4a-4b8b-4c85-acf9-ef733df842b9"
}
],
"network_mode": null,
"personality": [],
"power_state": "active",
"region": "isti_area_pi_1",
"scheduler_hints": [],
"security_groups": [
"default",
"traffic_from_the_main_load_balancers"
],
"stop_before_destroy": false,
"tags": [],
"timeouts": null,
"updated": "2024-07-18 09:48:21 +0000 UTC",
"user_data": "bb83b25fd1219aa1b850ece9be8d7b0f31714608",
"vendor_options": []
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInVwZGF0ZSI6MTgwMDAwMDAwMDAwMH19",
"dependencies": [
"data.terraform_remote_state.privnet_dns_router"
]
}
]
},
{
"mode": "managed",
"type": "openstack_compute_instance_v2",
@ -623,7 +504,7 @@
"traffic_from_the_main_load_balancers"
],
"stop_before_destroy": false,
"tags": null,
"tags": [],
"timeouts": null,
"updated": "2024-07-19 15:44:41 +0000 UTC",
"user_data": "bb83b25fd1219aa1b850ece9be8d7b0f31714608",
@ -637,35 +518,6 @@
}
]
},
{
"mode": "managed",
"type": "openstack_compute_volume_attach_v2",
"name": "storagehub_2204_1_dev_attach",
"provider": "provider[\"registry.terraform.io/terraform-provider-openstack/openstack\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"device": "/dev/vdb",
"id": "e46a5ce6-724a-4663-9352-67e8f0e6d847/d036eaec-d5ff-448d-bd5e-fad39c45ae43",
"instance_id": "e46a5ce6-724a-4663-9352-67e8f0e6d847",
"multiattach": null,
"region": "isti_area_pi_1",
"tag": null,
"timeouts": null,
"vendor_options": [],
"volume_id": "d036eaec-d5ff-448d-bd5e-fad39c45ae43"
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwfX0=",
"dependencies": [
"data.terraform_remote_state.privnet_dns_router",
"openstack_blockstorage_volume_v3.storagehub_2204_1_dev_data_volume",
"openstack_compute_instance_v2.storagehub_2204_1_dev"
]
}
]
},
{
"mode": "managed",
"type": "openstack_compute_volume_attach_v2",
@ -702,31 +554,6 @@
"name": "add_dns_recordset",
"provider": "provider[\"registry.terraform.io/terraform-provider-openstack/openstack\"]",
"instances": [
{
"index_key": "storagehub-2204-1",
"schema_version": 0,
"attributes": {
"description": "StorageHub 22.04 1",
"disable_status_check": false,
"id": "cbae638a-9d99-44aa-946c-0f5ffb7fc488/c49d45a0-2529-4605-b0d0-b7838905e677",
"name": "storagehub-2204-1.cloud-dev.d4science.org.",
"project_id": "e8f8ca72f30648a8b389b4e745ac83a9",
"records": [
"main-lb.cloud-dev.d4science.org."
],
"region": "isti_area_pi_1",
"timeouts": null,
"ttl": 8600,
"type": "CNAME",
"value_specs": null,
"zone_id": "cbae638a-9d99-44aa-946c-0f5ffb7fc488"
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH19",
"dependencies": [
"data.terraform_remote_state.privnet_dns_router"
]
},
{
"index_key": "storagehub-3",
"schema_version": 0,