Eli Mesika has uploaded a new change for review.

Change subject: [WIP]core: DB Changes for Multi-Tier fencing
......................................................................

[WIP]core: DB Changes for Multi-Tier fencing

This patch includes all relevant changes for Multi-Tier fencing support.

Change-Id: Iacc3b9abfcae4ebdbaaa4cc062c4bcc312e4b152
Signed-off-by: Eli Mesika <[email protected]>
---
M backend/manager/dbscripts/create_views.sql
A backend/manager/dbscripts/upgrade/03_02_0100_add_pm_multi_agent_support.sql
M 
backend/manager/dbscripts/upgrade/post_upgrade/0010_add_object_column_white_list_table.sql
M backend/manager/dbscripts/vds_sp.sql
4 files changed, 90 insertions(+), 34 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/58/10258/1

diff --git a/backend/manager/dbscripts/create_views.sql 
b/backend/manager/dbscripts/create_views.sql
index a349702..d476c59 100644
--- a/backend/manager/dbscripts/create_views.sql
+++ b/backend/manager/dbscripts/create_views.sql
@@ -621,7 +621,12 @@
                       vds_groups.selection_algorithm as selection_algorithm, 
vds_static.vds_id as vds_id, vds_static.vds_name as vds_name, vds_static.ip as 
ip, vds_static.vds_unique_id as vds_unique_id,
                       vds_static.host_name as host_name, vds_static.port as 
port, vds_static.vds_strength as vds_strength, vds_static.server_SSL_enabled as 
server_SSL_enabled, vds_static.vds_type as vds_type,
                       vds_static.pm_type as pm_type, vds_static.pm_user as 
pm_user, vds_static.pm_password as pm_password, vds_static.pm_port as pm_port,
-                      vds_static.pm_options as pm_options, 
vds_static.pm_enabled as pm_enabled, vds_static.vds_spm_priority as 
vds_spm_priority, vds_dynamic.hooks as hooks,vds_dynamic.status as status, 
vds_dynamic.cpu_cores as cpu_cores, vds_dynamic.cpu_model as cpu_model,
+                      vds_static.pm_options as pm_options, 
vds_static.pm_enabled as pm_enabled, vds_static.pm_secondary_ip as 
pm_secondary_ip,
+                      vds_static.pm_secondary_options as pm_secondary_options, 
vds_static.pm_secondary_port as pm_secondary_port,
+                      vds_static.pm_secondary_password as 
pm_secondary_password, vds_static.pm_secondary_user as pm_secondary_user,
+                      vds_static.pm_secondary_type as pm_secondary_type, 
vds_static.pm_secondary_concurrent as pm_secondary_concurrent,
+                      vds_static.vds_spm_priority as vds_spm_priority, 
vds_dynamic.hooks as hooks,vds_dynamic.status as status,
+                      vds_dynamic.cpu_cores as cpu_cores, 
vds_dynamic.cpu_model as cpu_model,
                       vds_dynamic.cpu_speed_mh as cpu_speed_mh, 
vds_dynamic.if_total_speed as if_total_speed, vds_dynamic.kvm_enabled as 
kvm_enabled, vds_dynamic.physical_mem_mb as physical_mem_mb,
                       vds_dynamic.pending_vcpus_count as pending_vcpus_count, 
vds_dynamic.pending_vmem_size as pending_vmem_size,vds_dynamic.mem_commited as 
mem_commited, vds_dynamic.vm_active as vm_active, vds_dynamic.vm_count as 
vm_count,
                       vds_dynamic.vm_migrating as vm_migrating, 
vds_dynamic.vms_cores_count as vms_cores_count, 
vds_dynamic.cpu_over_commit_time_stamp as cpu_over_commit_time_stamp,
@@ -653,7 +658,11 @@
                       vds_groups.selection_algorithm, vds_static.vds_id, 
vds_static.vds_name, vds_static.ip, vds_static.vds_unique_id,
                       vds_static.host_name, vds_static.port, 
vds_static.vds_strength, vds_static.server_SSL_enabled, vds_static.vds_type,
                       vds_static.pm_type, vds_static.pm_user, 
vds_static.pm_password, vds_static.pm_port,
-                      vds_static.pm_options, vds_static.pm_enabled, 
vds_dynamic.hooks, vds_dynamic.status, vds_dynamic.cpu_cores,
+                      vds_static.pm_options, vds_static.pm_enabled, 
vds_static.pm_secondary_ip as pm_secondary_ip,
+                      vds_static.pm_secondary_options as pm_secondary_options, 
vds_static.pm_secondary_port as pm_secondary_port,
+                      vds_static.pm_secondary_password as 
pm_secondary_password, vds_static.pm_secondary_user as pm_secondary_user,
+                      vds_static.pm_secondary_type as pm_secondary_type, 
vds_static.pm_secondary_concurrent as pm_secondary_concurrent,
+                      vds_dynamic.hooks, vds_dynamic.status, 
vds_dynamic.cpu_cores,
                       vds_dynamic.cpu_model, vds_dynamic.cpu_speed_mh, 
vds_dynamic.if_total_speed, vds_dynamic.kvm_enabled,
                       vds_dynamic.physical_mem_mb, 
vds_dynamic.pending_vcpus_count, vds_dynamic.pending_vmem_size,
                       vds_dynamic.mem_commited, vds_dynamic.vm_active, 
vds_dynamic.vm_count, vds_dynamic.vm_migrating,
diff --git 
a/backend/manager/dbscripts/upgrade/03_02_0100_add_pm_multi_agent_support.sql 
b/backend/manager/dbscripts/upgrade/03_02_0100_add_pm_multi_agent_support.sql
new file mode 100644
index 0000000..21d4b1f
--- /dev/null
+++ 
b/backend/manager/dbscripts/upgrade/03_02_0100_add_pm_multi_agent_support.sql
@@ -0,0 +1,8 @@
+-- Adding secondary PM agent device fields
+select fn_db_add_column('vds_static', 'pm_secondary_ip', 'VARCHAR(255) NULL 
DEFAULT ''''');
+select fn_db_add_column('vds_static', 'pm_secondary_type', 'VARCHAR(20) NULL 
DEFAULT ''''');
+select fn_db_add_column('vds_static', 'pm_secondary_user', 'VARCHAR(50) NULL 
DEFAULT ''''');
+select fn_db_add_column('vds_static', 'pm_secondary_password', 'TEXT NULL 
DEFAULT ''''');
+select fn_db_add_column('vds_static', 'pm_secondary_port', 'INTEGER NULL ');
+select fn_db_add_column('vds_static', 'pm_secondary_options', 'VARCHAR(4000) 
NULL DEFAULT ''''');
+select fn_db_add_column('vds_static', 'pm_secondary_concurrent', 'BOOLEAN NULL 
DEFAULT false');
diff --git 
a/backend/manager/dbscripts/upgrade/post_upgrade/0010_add_object_column_white_list_table.sql
 
b/backend/manager/dbscripts/upgrade/post_upgrade/0010_add_object_column_white_list_table.sql
index 309b636..1a5636a 100644
--- 
a/backend/manager/dbscripts/upgrade/post_upgrade/0010_add_object_column_white_list_table.sql
+++ 
b/backend/manager/dbscripts/upgrade/post_upgrade/0010_add_object_column_white_list_table.sql
@@ -40,8 +40,9 @@
        column_name in (
           'vds_group_id', 'vds_group_name', 'vds_group_description', 
'selection_algorithm',
           'vds_id', 'vds_name', 'ip', 'vds_unique_id', 'host_name', 'port', 
'vds_strength',
-          'server_ssl_enabled', 'vds_type', 'pm_type', 'pm_user', 
'pm_password', 'pm_port',
-          'pm_options', 'pm_enabled', 'vds_spm_priority', 'hooks', 'status', 
'cpu_cores',
+          'server_ssl_enabled', 'vds_type', 'pm_type', 'pm_user', 'pm_port',
+          'pm_options',  'pm_secondary_ip', 'pm_secondary_type', 
'pm_secondary_user', 'pm_secondary_port',
+          'pm_secondary_options','pm_enabled', 'vds_spm_priority', 'hooks', 
'status', 'cpu_cores',
           'cpu_model', 'cpu_speed_mh', 'if_total_speed', 'kvm_enabled', 
'physical_mem_mb',
           'pending_vcpus_count', 'pending_vmem_size', 'mem_commited', 
'vm_active', 'vm_count',
           'vm_migrating', 'vms_cores_count', 'cpu_over_commit_time_stamp', 
'hypervisor_type',
diff --git a/backend/manager/dbscripts/vds_sp.sql 
b/backend/manager/dbscripts/vds_sp.sql
index 40ce2c4..9c535bc 100644
--- a/backend/manager/dbscripts/vds_sp.sql
+++ b/backend/manager/dbscripts/vds_sp.sql
@@ -320,20 +320,27 @@
 Create or replace FUNCTION InsertVdsStatic(
     v_vds_id UUID,
     v_host_name VARCHAR(255),
-       v_ip VARCHAR(255) ,
+    v_ip VARCHAR(255) ,
     v_vds_unique_id VARCHAR(128) ,
-       v_port INTEGER,
-       v_vds_group_id UUID,
-       v_vds_name VARCHAR(255),
-       v_server_SSL_enabled BOOLEAN ,
-       v_vds_type INTEGER,
-       v_vds_strength INTEGER,
+    v_port INTEGER,
+    v_vds_group_id UUID,
+    v_vds_name VARCHAR(255),
+    v_server_SSL_enabled BOOLEAN ,
+    v_vds_type INTEGER,
+    v_vds_strength INTEGER,
     v_pm_type VARCHAR(20) ,
-       v_pm_user VARCHAR(50) ,
+    v_pm_user VARCHAR(50) ,
     v_pm_password VARCHAR(50) ,
     v_pm_port INTEGER ,
     v_pm_options VARCHAR(4000) ,
     v_pm_enabled BOOLEAN,
+    v_pm_secondary_ip VARCHAR(255),
+    v_pm_secondary_type VARCHAR(20),
+    v_pm_secondary_user VARCHAR(50),
+    v_pm_secondary_password text,
+    v_pm_secondary_port INTEGER,
+    v_pm_secondary_options VARCHAR(4000),
+    v_pm_secondary_concurrent BOOLEAN,
     v_vds_spm_priority INTEGER,
     v_sshKeyFingerprint VARCHAR(128))
 RETURNS VOID
@@ -341,8 +348,15 @@
 BEGIN
    IF v_vds_unique_id IS NULL OR NOT EXISTS(SELECT vds_name FROM vds_static 
WHERE vds_unique_id = v_vds_unique_id) then
       BEGIN
-         INSERT INTO vds_static(vds_id,host_name, ip, vds_unique_id, port, 
vds_group_id, vds_name, 
server_SSL_enabled,vds_type,vds_strength,pm_type,pm_user,pm_password,pm_port,pm_options,pm_enabled,
 vds_spm_priority, sshKeyFingerprint)
-                       VALUES(v_vds_id,v_host_name, v_ip, v_vds_unique_id, 
v_port, v_vds_group_id, v_vds_name, 
v_server_SSL_enabled,v_vds_type,v_vds_strength,v_pm_type,v_pm_user,v_pm_password,v_pm_port,v_pm_options,v_pm_enabled,
 v_vds_spm_priority, v_sshKeyFingerprint);
+         INSERT INTO vds_static(vds_id,host_name, ip, vds_unique_id, port, 
vds_group_id, vds_name, server_SSL_enabled,vds_type,vds_strength,
+                               
pm_type,pm_user,pm_password,pm_port,pm_options,pm_enabled,
+                               pm_secondary_ip, pm_secondary_type, 
pm_secondary_user,
+                               pm_secondary_password, pm_secondary_port, 
pm_secondary_options, pm_secondary_concurrent,
+                               vds_spm_priority, sshKeyFingerprint)
+                       VALUES(v_vds_id,v_host_name, v_ip, v_vds_unique_id, 
v_port, v_vds_group_id, v_vds_name, 
v_server_SSL_enabled,v_vds_type,v_vds_strength,
+                               
v_pm_type,v_pm_user,v_pm_password,v_pm_port,v_pm_options,v_pm_enabled, 
v_pm_secondary_ip, v_pm_secondary_type, v_pm_secondary_user,
+                               v_pm_secondary_password, v_pm_secondary_port, 
v_pm_secondary_options, v_pm_secondary_concurrent,
+                               v_vds_spm_priority, v_sshKeyFingerprint);
       END;
    end if;
    RETURN;
@@ -356,19 +370,26 @@
 Create or replace FUNCTION UpdateVdsStatic(v_host_name VARCHAR(255),
        v_ip VARCHAR(255) ,
     v_vds_unique_id VARCHAR(128),
-       v_port INTEGER,
-       v_vds_group_id UUID,
-       v_vds_id UUID,
-       v_vds_name VARCHAR(255),
-       v_server_SSL_enabled BOOLEAN ,
-       v_vds_type INTEGER,
-       v_vds_strength INTEGER,
+    v_port INTEGER,
+    v_vds_group_id UUID,
+    v_vds_id UUID,
+    v_vds_name VARCHAR(255),
+    v_server_SSL_enabled BOOLEAN ,
+    v_vds_type INTEGER,
+    v_vds_strength INTEGER,
     v_pm_type VARCHAR(20) ,
-       v_pm_user VARCHAR(50) ,
+    v_pm_user VARCHAR(50) ,
     v_pm_password VARCHAR(50) ,
     v_pm_port INTEGER ,
     v_pm_options VARCHAR(4000) ,
     v_pm_enabled BOOLEAN,
+    v_pm_secondary_ip VARCHAR(255),
+    v_pm_secondary_type VARCHAR(20),
+    v_pm_secondary_user VARCHAR(50),
+    v_pm_secondary_password text,
+    v_pm_secondary_port INTEGER,
+    v_pm_secondary_options VARCHAR(4000),
+    v_pm_secondary_concurrent BOOLEAN,
     v_otp_validity BIGINT,
     v_vds_spm_priority INTEGER,
     v_sshKeyFingerprint VARCHAR(128))
@@ -385,7 +406,11 @@
       vds_type = v_vds_type,
       _update_date = LOCALTIMESTAMP,vds_strength = v_vds_strength,
       pm_type = v_pm_type,pm_user = v_pm_user,pm_password = v_pm_password,
-      pm_port = v_pm_port,pm_options = v_pm_options,pm_enabled = v_pm_enabled, 
otp_validity = v_otp_validity, vds_spm_priority = v_vds_spm_priority, 
sshKeyFingerprint = v_sshKeyFingerprint
+      pm_port = v_pm_port,pm_options = v_pm_options,pm_enabled = v_pm_enabled,
+      pm_secondary_ip = v_pm_secondary_ip, pm_secondary_type = 
v_pm_secondary_type,
+      pm_secondary_user = v_pm_secondary_user, pm_secondary_password = 
v_pm_secondary_password,
+      pm_secondary_port = v_pm_secondary_port, pm_secondary_options = 
v_pm_secondary_options, pm_secondary_concurrent = v_pm_secondary_concurrent,
+      otp_validity = v_otp_validity, vds_spm_priority = v_vds_spm_priority, 
sshKeyFingerprint = v_sshKeyFingerprint
       WHERE vds_id = v_vds_id;
    END;
 
@@ -641,28 +666,41 @@
 Create or replace FUNCTION InsertVds(
     v_vds_id UUID,
     v_host_name VARCHAR(255),
- v_ip VARCHAR(40) ,
+    v_ip VARCHAR(40) ,
     v_vds_unique_id VARCHAR(128) ,
- v_port INTEGER,
- v_vds_group_id UUID,
- v_vds_name VARCHAR(255),
- v_server_SSL_enabled BOOLEAN ,
- v_vds_type INTEGER,
- v_vds_strength INTEGER,
+    v_port INTEGER,
+    v_vds_group_id UUID,
+    v_vds_name VARCHAR(255),
+    v_server_SSL_enabled BOOLEAN ,
+    v_vds_type INTEGER,
+    v_vds_strength INTEGER,
     v_pm_type VARCHAR(20) ,
- v_pm_user VARCHAR(50) ,
+    v_pm_user VARCHAR(50) ,
     v_pm_password VARCHAR(50) ,
- v_pm_port INTEGER ,
+    v_pm_port INTEGER ,
     v_pm_options VARCHAR(4000) ,
     v_pm_enabled BOOLEAN,
+    v_pm_secondary_ip VARCHAR(255),
+    v_pm_secondary_type VARCHAR(20),
+    v_pm_secondary_user VARCHAR(50),
+    v_pm_secondary_password text,
+    v_pm_secondary_port INTEGER,
+    v_pm_secondary_options VARCHAR(4000),
+    v_pm_secondary_concurrent BOOLEAN,
     v_vds_spm_priority INTEGER)
 RETURNS VOID
    AS $procedure$
 BEGIN
 
    BEGIN
-      INSERT INTO vds_static(vds_id,host_name, ip, vds_unique_id, port, 
vds_group_id, vds_name, 
server_SSL_enabled,vds_type,vds_strength,pm_type,pm_user,pm_password, pm_port, 
pm_options, pm_enabled, vds_spm_priority)
-       VALUES(v_vds_id,v_host_name, v_ip, v_vds_unique_id, v_port, 
v_vds_group_id, v_vds_name, v_server_SSL_enabled,v_vds_type, 
v_vds_strength,v_pm_type,v_pm_user,v_pm_password,v_pm_port, v_pm_options, 
v_pm_enabled, v_vds_spm_priority);
+      INSERT INTO vds_static(vds_id,host_name, ip, vds_unique_id, port, 
vds_group_id, vds_name, server_SSL_enabled,vds_type,vds_strength,
+                             pm_type,pm_user,pm_password, pm_port, pm_options, 
pm_enabled,
+                             pm_secondary_ip, pm_secondary_type, 
pm_secondary_user,
+                             pm_secondary_password, pm_secondary_port, 
pm_secondary_options, pm_secondary_concurrent,
+                             vds_spm_priority)
+       VALUES(v_vds_id,v_host_name, v_ip, v_vds_unique_id, v_port, 
v_vds_group_id, v_vds_name, v_server_SSL_enabled,v_vds_type, v_vds_strength,
+               v_pm_type,v_pm_user,v_pm_password,v_pm_port, v_pm_options, 
v_pm_enabled,  v_pm_secondary_ip, v_pm_secondary_type, v_pm_secondary_user,
+               v_pm_secondary_password, v_pm_secondary_port, 
v_pm_secondary_options, v_pm_secondary_concurrent,v_vds_spm_priority);
 
       INSERT INTO vds_dynamic(vds_id, status) VALUES(v_vds_id, 0);
 


--
To view, visit http://gerrit.ovirt.org/10258
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iacc3b9abfcae4ebdbaaa4cc062c4bcc312e4b152
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to