summaryrefslogtreecommitdiff
path: root/sql/caas/adhoc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/caas/adhoc')
-rw-r--r--sql/caas/adhoc/migrate-mgmt-network-fields.sql40
-rw-r--r--sql/caas/adhoc/mtce-nominal.sql72
-rw-r--r--sql/caas/adhoc/wclab-dracut.sql159
-rw-r--r--sql/caas/adhoc/wclab-nominal.sql158
4 files changed, 429 insertions, 0 deletions
diff --git a/sql/caas/adhoc/migrate-mgmt-network-fields.sql b/sql/caas/adhoc/migrate-mgmt-network-fields.sql
new file mode 100644
index 0000000..f2559a9
--- /dev/null
+++ b/sql/caas/adhoc/migrate-mgmt-network-fields.sql
@@ -0,0 +1,40 @@
+do $$
+declare
+ rec caas_cluster%rowtype;
+ l_mgmt_subnet character varying;
+ l_mgmt_default_gateway character varying;
+begin
+ for rec in
+ select id,
+ cluster_name,
+ oam_vip_hostname,
+ oam_vip_address,
+ mgmt_address_range_start,
+ mgmt_address_range_end,
+ csr_id,
+ location_id,
+ namespace_id,
+ parent_cluster_id,
+ sap_clli_id,
+ vlan_id,
+ is_central_controller,
+ mgmt_default_gateway,
+ mgmt_subnet
+ from caas_cluster
+ where is_central_controller = 0
+ loop
+ select mgmt_subnet into l_mgmt_subnet
+ from caas_cellsiterouter
+ where id = rec.csr_id;
+
+ select mgmt_default_gateway into l_mgmt_default_gateway
+ from caas_cellsiterouter
+ where id = rec.csr_id;
+
+ update caas_cluster
+ set mgmt_subnet = l_mgmt_subnet,
+ mgmt_default_gateway = l_mgmt_default_gateway
+ where id = rec.id;
+ end loop;
+end;
+$$ language plpgsql;
diff --git a/sql/caas/adhoc/mtce-nominal.sql b/sql/caas/adhoc/mtce-nominal.sql
new file mode 100644
index 0000000..d1d2137
--- /dev/null
+++ b/sql/caas/adhoc/mtce-nominal.sql
@@ -0,0 +1,72 @@
+do $$
+declare
+ csr_name_central character varying := 'WELKTXEF-ROUTER-000004';
+ cluster_name_central character varying := 'welktxef-c000004-001';
+ ilo_hostname_central character varying := 'welktxef-000004-rh-p30e910-001';
+ oam_vip_hostname_central character varying := 'welktxef-000004-nh-pe1e910-001';
+ ilo_gateway_address_central character varying := '2607:f160:10:9051:ce:23::';
+ ilo_subnet_central character varying := '2607:f160:10:9051::';
+ oam_subnet_central character varying := '2607:f160:10:9051::';
+ oam_gateway_address_central character varying := ilo_gateway_address_central;
+ oam_floating_address_central character varying := '2607:f160:10:9051:ce:290:0:1000';
+ mgmt_start_address_central character varying := '2607:f160:10:9050:ce:290::';
+ mgmt_end_address_central character varying := '2607:f160:10:9050:ce:290:0:f';
+ mgmt_subnet_central character varying := '2607:f160:10:9050::';
+ mgmt_gateway_address_central character varying := '2607:f160:10:9050:ce:23::';
+
+ oam_hostname_central character varying := 'welktxef-000004-nh-pe2e910-001';
+ ilo_host_address_central character varying := '2607:f160:10:9221:ce:fe0:0:800b';
+ oam_host_address_central character varying := '2607:f160:10:9051:ce:290:0:1001';
+begin
+ update caas_cellsiterouter
+ set ilo_subnet = ilo_subnet_central
+ where csr_hostname = csr_name_central;
+
+ update caas_cellsiterouter
+ set ilo_default_gateway = ilo_gateway_address_central
+ where csr_hostname = csr_name_central;
+
+ update caas_cellsiterouter
+ set oam_subnet = oam_subnet_central
+ where csr_hostname = csr_name_central;
+
+ update caas_cellsiterouter
+ set oam_default_gateway = oam_gateway_address_central
+ where csr_hostname = csr_name_central;
+
+ update caas_cellsiterouter
+ set mgmt_subnet = mgmt_subnet_central
+ where csr_hostname = csr_name_central;
+
+ update caas_cellsiterouter
+ set mgmt_default_gateway = mgmt_gateway_address_central
+ where csr_hostname = csr_name_central;
+
+ update caas_cluster
+ set oam_vip_hostname = oam_vip_hostname_central
+ where cluster_name = cluster_name_central;
+
+ update caas_cluster
+ set oam_vip_address = oam_floating_address_central
+ where cluster_name = cluster_name_central;
+
+ update caas_cluster
+ set mgmt_address_range_start = mgmt_start_address_central
+ where cluster_name = cluster_name_central;
+
+ update caas_cluster
+ set mgmt_address_range_end = mgmt_end_address_central
+ where cluster_name = cluster_name_central;
+
+ update caas_server
+ set oam_hostname = oam_hostname_central
+ where ilo_hostname = ilo_hostname_central;
+
+ update caas_server
+ set oam_host_address = oam_host_address_central
+ where ilo_hostname = ilo_hostname_central;
+
+ update caas_server
+ set ilo_host_address = ilo_host_address_central
+ where ilo_hostname = ilo_hostname_central;
+end $$;
diff --git a/sql/caas/adhoc/wclab-dracut.sql b/sql/caas/adhoc/wclab-dracut.sql
new file mode 100644
index 0000000..579fb27
--- /dev/null
+++ b/sql/caas/adhoc/wclab-dracut.sql
@@ -0,0 +1,159 @@
+-- oam amd mgmt subnets are swapped to create the dracut condition.
+do $$
+declare
+ csr_name_central character varying := 'ye-olde-csr-hostname-1';
+ cluster_name_central character varying := 'walnutcr-d0000000-001';
+ oam_vip_hostname_central character varying := 'walnutcr-0000000-nh-pe1e910-001';
+ ilo_gateway_address_central character varying := 'fd00:4888:2000:7f3:528:23::';
+ ilo_subnet_central character varying := 'fd00:4888:2000:7f3:528:';
+ oam_subnet_central character varying := 'fd00:4888:2000:07fd::';
+ oam_floating_address_central character varying := 'fd00:4888:2000:07fd::290';
+ mgmt_start_address_central character varying := 'fd00:4888:2000:1100::a';
+ mgmt_end_address_central character varying := 'fd00:4888:2000:1100::2a';
+ mgmt_subnet_central character varying := 'fd00:4888:2000:1100::';
+ mgmt_gateway_address_central character varying := 'fd00:4888:2000:1100:524:23::';
+ csr_name_remote character varying := 'ye-olde-csr-hostname-2';
+ cluster_name_remote character varying := 'walnutcr-d9999999-001';
+ ilo_subnet_remote character varying := 'fd00:4888:2000:1205::';
+ ilo_gateway_address_remote character varying := 'fd00:4888:2000:1205::1';
+ oam_floating_address_remote character varying := 'fd00:4888:2000:1209::a';
+ oam_gateway_address_remote character varying := 'fd00:4888:2000:1209::1';
+ oam_subnet_remote character varying := 'fd00:4888:2000:1209::';
+ mgmt_start_address_remote character varying := 'fd00:4888:2000:120a::10';
+ mgmt_end_address_remote character varying := 'fd00:4888:2000:120a::1f';
+ mgmt_gateway_address_remote character varying := 'fd00:4888:2000:120a::1';
+ mgmt_subnet_remote character varying := 'fd00:4888:2000:120a::';
+
+ oam_hostname_central_0 character varying := 'walnutcr-0000000-nh-pe2e910-001';
+ ilo_host_address_central_0 character varying := 'fd00:4888:2000:7f3:528:ff2:0:8';
+ oam_host_address_central_0 character varying := 'fd00:4888:2000:07fd::292';
+
+ oam_hostname_central_1 character varying := 'walnutcr-0000000-nh-pe2e910-002';
+ ilo_host_address_central_1 character varying := 'fd00:4888:2000:7f3:528:ff2:0:7';
+ oam_host_address_central_1 character varying := 'fd00:4888:2000:07fd::291';
+
+ oam_hostname_central_2 character varying := 'walnutcr-0000000-nh-pe2e910-003';
+ ilo_host_address_central_2 character varying := 'fd00:4888:2000:7f3:528:ff2:0:9';
+ oam_host_address_central_2 character varying := 'fd00:4888:2000:07fd::293';
+
+ ilo_host_address_remote_0 character varying := 'fd00:4888:2000:1205::26';
+ oam_host_address_remote_0 character varying := 'fd00:4888:2000:120a::b';
+begin
+ update caas_cellsiterouter
+ set ilo_subnet = ilo_subnet_central
+ where csr_hostname = csr_name_central;
+
+ update caas_cellsiterouter
+ set ilo_default_gateway = ilo_gateway_address_central
+ where csr_hostname = csr_name_central;
+
+ update caas_cellsiterouter
+ set oam_subnet = oam_subnet_central
+ where csr_hostname = csr_name_central;
+
+ update caas_cellsiterouter
+ set oam_subnet = oam_subnet_remote
+ where csr_hostname = csr_name_remote;
+
+ update caas_cellsiterouter
+ set oam_default_gateway = oam_gateway_address_remote
+ where csr_hostname = csr_name_remote;
+
+ update caas_cellsiterouter
+ set mgmt_subnet = mgmt_subnet_central
+ where csr_hostname = csr_name_central;
+
+ update caas_cellsiterouter
+ set mgmt_default_gateway = mgmt_gateway_address_central
+ where csr_hostname = csr_name_central;
+
+ update caas_cellsiterouter
+ set mgmt_subnet = mgmt_subnet_remote
+ where csr_hostname = csr_name_remote;
+
+ update caas_cellsiterouter
+ set mgmt_default_gateway = mgmt_gateway_address_remote
+ where csr_hostname = csr_name_remote;
+
+ update caas_cellsiterouter
+ set ilo_subnet = ilo_subnet_remote
+ where csr_hostname = csr_name_remote;
+
+ update caas_cellsiterouter
+ set ilo_default_gateway = ilo_gateway_address_remote
+ where csr_hostname = csr_name_remote;
+
+ update caas_cluster
+ set oam_vip_hostname = oam_vip_hostname_central
+ where cluster_name = cluster_name_central;
+
+ update caas_cluster
+ set oam_vip_address = oam_floating_address_central
+ where cluster_name = cluster_name_central;
+
+ update caas_cluster
+ set mgmt_address_range_start = mgmt_start_address_central
+ where cluster_name = cluster_name_central;
+
+ update caas_cluster
+ set mgmt_address_range_end = mgmt_end_address_central
+ where cluster_name = cluster_name_central;
+
+ update caas_cluster
+ set oam_vip_address = oam_floating_address_remote
+ where cluster_name = cluster_name_remote;
+
+ update caas_cluster
+ set mgmt_address_range_start = mgmt_start_address_remote
+ where cluster_name = cluster_name_remote;
+
+ update caas_cluster
+ set mgmt_address_range_end = mgmt_end_address_remote
+ where cluster_name = cluster_name_remote;
+
+ update caas_server
+ set oam_hostname = oam_hostname_central_0
+ where ilo_host_address = ilo_host_address_central_0;
+
+ update caas_server
+ set oam_host_address = oam_host_address_remote_0
+ where ilo_host_address = ilo_host_address_remote_0;
+
+ update caas_server
+ set oam_hostname = oam_hostname_central_1
+ where ilo_host_address = ilo_host_address_central_1;
+
+ update caas_server
+ set oam_host_address = oam_host_address_central_1
+ where ilo_host_address = ilo_host_address_central_1;
+
+ update caas_server
+ set oam_hostname = oam_hostname_central_2
+ where ilo_host_address = ilo_host_address_central_2;
+
+ update caas_server
+ set oam_host_address = oam_host_address_central_2
+ where ilo_host_address = ilo_host_address_central_2;
+
+ update caas_server
+ set oam_host_address = oam_host_address_remote_0
+ where ilo_host_address = ilo_host_address_remote_0;
+end $$;
+
+/*
+
+truncate table caas_blade cascade;
+truncate table caas_cellsiterouter cascade;
+truncate table caas_chassis cascade;
+truncate table caas_cluster cascade;
+truncate table caas_credential cascade;
+truncate table caas_firmwareupgradeschedule cascade;
+truncate table caas_location cascade;
+truncate table caas_namespace cascade;
+truncate table caas_sapclli cascade;
+truncate table caas_server cascade;
+truncate table caas_vendor cascade;
+truncate table caas_vlan cascade;
+truncate table caas_wrinstallschedule cascade;
+
+*/
diff --git a/sql/caas/adhoc/wclab-nominal.sql b/sql/caas/adhoc/wclab-nominal.sql
new file mode 100644
index 0000000..0db2f9e
--- /dev/null
+++ b/sql/caas/adhoc/wclab-nominal.sql
@@ -0,0 +1,158 @@
+do $$
+declare
+ csr_name_central character varying := 'ye-olde-csr-hostname-1';
+ cluster_name_central character varying := 'walnutcr-d0000000-001';
+ oam_vip_hostname_central character varying := 'walnutcr-0000000-nh-pe1e910-001';
+ ilo_gateway_address_central character varying := 'fd00:4888:2000:7f3:528:23::';
+ ilo_subnet_central character varying := 'fd00:4888:2000:7f3::';
+ oam_subnet_central character varying := 'fd00:4888:2000:07fd::';
+ oam_floating_address_central character varying := 'fd00:4888:2000:07fd::290';
+ mgmt_start_address_central character varying := 'fd00:4888:2000:1100::a';
+ mgmt_end_address_central character varying := 'fd00:4888:2000:1100::2a';
+ mgmt_subnet_central character varying := 'fd00:4888:2000:1100::';
+ mgmt_gateway_address_central character varying := 'fd00:4888:2000:1100:524:23::';
+ csr_name_remote character varying := 'ye-olde-csr-hostname-2';
+ cluster_name_remote character varying := 'walnutcr-d9999999-001';
+ ilo_subnet_remote character varying := 'fd00:4888:2000:1205::';
+ ilo_gateway_address_remote character varying := 'fd00:4888:2000:1205::1';
+ oam_floating_address_remote character varying := 'fd00:4888:2000:120a::a';
+ oam_gateway_address_remote character varying := 'fd00:4888:2000:120a::1';
+ oam_subnet_remote character varying := 'fd00:4888:2000:120a::';
+ mgmt_start_address_remote character varying := 'fd00:4888:2000:1209::10';
+ mgmt_end_address_remote character varying := 'fd00:4888:2000:1209::1f';
+ mgmt_gateway_address_remote character varying := 'fd00:4888:2000:1209::1';
+ mgmt_subnet_remote character varying := 'fd00:4888:2000:1209::';
+
+ oam_hostname_central_0 character varying := 'walnutcr-0000000-nh-pe2e910-001';
+ ilo_host_address_central_0 character varying := 'fd00:4888:2000:7f3:528:ff2:0:8';
+ oam_host_address_central_0 character varying := 'fd00:4888:2000:07fd::292';
+
+ oam_hostname_central_1 character varying := 'walnutcr-0000000-nh-pe2e910-002';
+ ilo_host_address_central_1 character varying := 'fd00:4888:2000:7f3:528:ff2:0:7';
+ oam_host_address_central_1 character varying := 'fd00:4888:2000:07fd::291';
+
+ oam_hostname_central_2 character varying := 'walnutcr-0000000-nh-pe2e910-003';
+ ilo_host_address_central_2 character varying := 'fd00:4888:2000:7f3:528:ff2:0:9';
+ oam_host_address_central_2 character varying := 'fd00:4888:2000:07fd::293';
+
+ ilo_host_address_remote_0 character varying := 'fd00:4888:2000:1205::26';
+ oam_host_address_remote_0 character varying := 'fd00:4888:2000:120a::b';
+begin
+ update caas_cellsiterouter
+ set ilo_subnet = ilo_subnet_central
+ where csr_hostname = csr_name_central;
+
+ update caas_cellsiterouter
+ set ilo_default_gateway = ilo_gateway_address_central
+ where csr_hostname = csr_name_central;
+
+ update caas_cellsiterouter
+ set oam_subnet = oam_subnet_central
+ where csr_hostname = csr_name_central;
+
+ update caas_cellsiterouter
+ set oam_subnet = oam_subnet_remote
+ where csr_hostname = csr_name_remote;
+
+ update caas_cellsiterouter
+ set oam_default_gateway = oam_gateway_address_remote
+ where csr_hostname = csr_name_remote;
+
+ update caas_cellsiterouter
+ set mgmt_subnet = mgmt_subnet_central
+ where csr_hostname = csr_name_central;
+
+ update caas_cellsiterouter
+ set mgmt_default_gateway = mgmt_gateway_address_central
+ where csr_hostname = csr_name_central;
+
+ update caas_cellsiterouter
+ set mgmt_subnet = mgmt_subnet_remote
+ where csr_hostname = csr_name_remote;
+
+ update caas_cellsiterouter
+ set mgmt_default_gateway = mgmt_gateway_address_remote
+ where csr_hostname = csr_name_remote;
+
+ update caas_cellsiterouter
+ set ilo_subnet = ilo_subnet_remote
+ where csr_hostname = csr_name_remote;
+
+ update caas_cellsiterouter
+ set ilo_default_gateway = ilo_gateway_address_remote
+ where csr_hostname = csr_name_remote;
+
+ update caas_cluster
+ set oam_vip_hostname = oam_vip_hostname_central
+ where cluster_name = cluster_name_central;
+
+ update caas_cluster
+ set oam_vip_address = oam_floating_address_central
+ where cluster_name = cluster_name_central;
+
+ update caas_cluster
+ set mgmt_address_range_start = mgmt_start_address_central
+ where cluster_name = cluster_name_central;
+
+ update caas_cluster
+ set mgmt_address_range_end = mgmt_end_address_central
+ where cluster_name = cluster_name_central;
+
+ update caas_cluster
+ set oam_vip_address = oam_floating_address_remote
+ where cluster_name = cluster_name_remote;
+
+ update caas_cluster
+ set mgmt_address_range_start = mgmt_start_address_remote
+ where cluster_name = cluster_name_remote;
+
+ update caas_cluster
+ set mgmt_address_range_end = mgmt_end_address_remote
+ where cluster_name = cluster_name_remote;
+
+ update caas_server
+ set oam_hostname = oam_hostname_central_0
+ where ilo_host_address = ilo_host_address_central_0;
+
+ update caas_server
+ set oam_host_address = oam_host_address_remote_0
+ where ilo_host_address = ilo_host_address_remote_0;
+
+ update caas_server
+ set oam_hostname = oam_hostname_central_1
+ where ilo_host_address = ilo_host_address_central_1;
+
+ update caas_server
+ set oam_host_address = oam_host_address_central_1
+ where ilo_host_address = ilo_host_address_central_1;
+
+ update caas_server
+ set oam_hostname = oam_hostname_central_2
+ where ilo_host_address = ilo_host_address_central_2;
+
+ update caas_server
+ set oam_host_address = oam_host_address_central_2
+ where ilo_host_address = ilo_host_address_central_2;
+
+ update caas_server
+ set oam_host_address = oam_host_address_remote_0
+ where ilo_host_address = ilo_host_address_remote_0;
+end $$;
+
+/*
+
+truncate table caas_blade cascade;
+truncate table caas_cellsiterouter cascade;
+truncate table caas_chassis cascade;
+truncate table caas_cluster cascade;
+truncate table caas_credential cascade;
+truncate table caas_firmwareupgradeschedule cascade;
+truncate table caas_location cascade;
+truncate table caas_namespace cascade;
+truncate table caas_sapclli cascade;
+truncate table caas_server cascade;
+truncate table caas_vendor cascade;
+truncate table caas_vlan cascade;
+truncate table caas_wrinstallschedule cascade;
+
+*/