See #26997. New CNAME for the workspace-repository.

This commit is contained in:
Andrea Dell'Amico 2024-03-06 17:16:02 +01:00
parent e7ec7726c8
commit 26efafdfd5
Signed by: andrea.dellamico
GPG Key ID: 147ABE6CEB9E20FF
2 changed files with 78 additions and 21 deletions

View File

@ -31,19 +31,19 @@ module "ssh_settings" {
resource "openstack_blockstorage_volume_v3" "storagehub_prod_data_volume" {
count = 2
name = format("storagehub%01d_data_volume", count.index + 1)
size = "120"
name = format("storagehub%01d_data_volume", count.index + 1)
size = "120"
}
resource "openstack_blockstorage_volume_v3" "storagehub_prod_temp_volume" {
count = 2
name = format("storagehub%01d_temp_volume", count.index + 1)
size = "80"
name = format("storagehub%01d_temp_volume", count.index + 1)
size = "80"
}
# Instances
resource "openstack_compute_instance_v2" "storagehub1_prod" {
name = "storagehub1"
name = "storagehub1"
availability_zone_hints = module.common_variables.availability_zone_no_gpu_name
flavor_name = module.common_variables.flavor_list.m1_xlarge
key_pair = module.ssh_settings.ssh_key_name
@ -65,7 +65,7 @@ resource "openstack_compute_instance_v2" "storagehub1_prod" {
}
}
# user_data script used
user_data = file("${module.common_variables.ubuntu_1804.user_data_file}")
# Do not replace the instance when the ssh key changes
@ -79,7 +79,7 @@ resource "openstack_compute_instance_v2" "storagehub1_prod" {
}
resource "openstack_compute_instance_v2" "storagehub2_prod" {
name = "storagehub2"
name = "storagehub2"
availability_zone_hints = module.common_variables.availability_zone_no_gpu_name
flavor_name = module.common_variables.flavor_list.m1_xlarge
key_pair = module.ssh_settings.ssh_key_name
@ -101,7 +101,7 @@ resource "openstack_compute_instance_v2" "storagehub2_prod" {
}
}
# user_data script used
user_data = file("${module.common_variables.ubuntu_1804.user_data_file}")
# Do not replace the instance when the ssh key changes
@ -119,13 +119,13 @@ resource "openstack_compute_instance_v2" "storagehub2_prod" {
resource "openstack_compute_volume_attach_v2" "storagehub1_attach_1" {
instance_id = openstack_compute_instance_v2.storagehub1_prod.id
volume_id = openstack_blockstorage_volume_v3.storagehub_prod_data_volume.0.id
device = "/dev/vdb"
device = "/dev/vdb"
}
resource "openstack_compute_volume_attach_v2" "storagehub1_attach_2" {
instance_id = openstack_compute_instance_v2.storagehub1_prod.id
volume_id = openstack_blockstorage_volume_v3.storagehub_prod_temp_volume.0.id
device = "/dev/vdc"
device = "/dev/vdc"
depends_on = [openstack_compute_volume_attach_v2.storagehub1_attach_1]
}
@ -133,13 +133,13 @@ resource "openstack_compute_volume_attach_v2" "storagehub1_attach_2" {
resource "openstack_compute_volume_attach_v2" "storagehub2_attach_1" {
instance_id = openstack_compute_instance_v2.storagehub2_prod.id
volume_id = openstack_blockstorage_volume_v3.storagehub_prod_data_volume.1.id
device = "/dev/vdb"
device = "/dev/vdb"
}
resource "openstack_compute_volume_attach_v2" "storagehub2_attach_2" {
instance_id = openstack_compute_instance_v2.storagehub2_prod.id
volume_id = openstack_blockstorage_volume_v3.storagehub_prod_temp_volume.1.id
device = "/dev/vdc"
device = "/dev/vdc"
depends_on = [openstack_compute_volume_attach_v2.storagehub2_attach_1]
}
@ -172,6 +172,14 @@ module "dns_records_create" {
ttl = 8600
type = "CNAME"
records = [local.cname_target]
},
workspace_repo = {
zone_id = data.terraform_remote_state.privnet_dns_router.outputs.dns_zone_id
name = join(".", ["workspace-repository", data.terraform_remote_state.privnet_dns_router.outputs.dns_zone.zone_name])
description = "Workspace repository (storagehub)"
ttl = 8600
type = "CNAME"
records = [local.cname_target]
}
}
}
}

View File

@ -1,7 +1,7 @@
{
"version": 4,
"terraform_version": "1.6.4",
"serial": 12,
"terraform_version": "1.6.6",
"serial": 14,
"lineage": "2fcb0d7a-4633-fecf-ab9f-0551f8d16805",
"outputs": {},
"resources": [
@ -404,7 +404,13 @@
"index_key": 0,
"schema_version": 0,
"attributes": {
"attachment": [],
"attachment": [
{
"device": "/dev/vdb",
"id": "9287ce45-8c5e-461c-950c-769765f8ec4d",
"instance_id": "9daff67b-8a3b-4c7e-8cdd-0fc21cf25599"
}
],
"availability_zone": "nova",
"consistency_group_id": null,
"description": "",
@ -430,7 +436,13 @@
"index_key": 1,
"schema_version": 0,
"attributes": {
"attachment": [],
"attachment": [
{
"device": "/dev/vdb",
"id": "392e7062-f02c-483f-a8c5-6caffa7ce201",
"instance_id": "3aa1326a-773a-4f19-8fdb-b4c691d6b251"
}
],
"availability_zone": "nova",
"consistency_group_id": null,
"description": "",
@ -464,7 +476,13 @@
"index_key": 0,
"schema_version": 0,
"attributes": {
"attachment": [],
"attachment": [
{
"device": "/dev/vdc",
"id": "08a1870c-2867-44ad-81c3-de0ed1b851d1",
"instance_id": "9daff67b-8a3b-4c7e-8cdd-0fc21cf25599"
}
],
"availability_zone": "nova",
"consistency_group_id": null,
"description": "",
@ -490,7 +508,13 @@
"index_key": 1,
"schema_version": 0,
"attributes": {
"attachment": [],
"attachment": [
{
"device": "/dev/vdc",
"id": "4072259f-11c2-4ef7-b149-be1a04b4ca12",
"instance_id": "3aa1326a-773a-4f19-8fdb-b4c691d6b251"
}
],
"availability_zone": "nova",
"consistency_group_id": null,
"description": "",
@ -589,7 +613,7 @@
"traffic_from_the_main_load_balancers"
],
"stop_before_destroy": false,
"tags": null,
"tags": [],
"timeouts": null,
"updated": "2024-02-06 16:26:45 +0000 UTC",
"user_data": "47d4769e61324c305c4b70ed6673de4fad84150d",
@ -679,7 +703,7 @@
"traffic_from_the_main_load_balancers"
],
"stop_before_destroy": false,
"tags": null,
"tags": [],
"timeouts": null,
"updated": "2024-02-06 16:26:48 +0000 UTC",
"user_data": "47d4769e61324c305c4b70ed6673de4fad84150d",
@ -866,6 +890,31 @@
"dependencies": [
"data.terraform_remote_state.privnet_dns_router"
]
},
{
"index_key": "workspace_repo",
"schema_version": 0,
"attributes": {
"description": "Workspace repository (storagehub)",
"disable_status_check": false,
"id": "74135b34-1a9c-4c01-8cf0-22450a5660c4/2e1c977d-9d08-4c96-9072-c09e624cdee8",
"name": "workspace-repository.cloud.d4science.org.",
"project_id": "1b45adf388934758b56d0dfdb4bfacf3",
"records": [
"main-lb.cloud.d4science.org."
],
"region": "isti_area_pi_1",
"timeouts": null,
"ttl": 8600,
"type": "CNAME",
"value_specs": null,
"zone_id": "74135b34-1a9c-4c01-8cf0-22450a5660c4"
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH19",
"dependencies": [
"data.terraform_remote_state.privnet_dns_router"
]
}
]
}