Browse Source

Merge "Enable staging-ovirt (fence_rhevm) fencing agent." into stable/queens

tags/8.7.1
Zuul 3 weeks ago
parent
commit
52e039848e

+ 14
- 0
tripleo_common/actions/parameters.py View File

@@ -390,6 +390,20 @@ class GenerateFencingParametersAction(base.TripleOAction):
390 390
                      "bm_name": hostmap[mac_addr]["baremetal_name"]})
391 391
                 if self.delay:
392 392
                     params["delay"] = self.delay
393
+            elif (node['pm_type'] in {'staging-ovirt'}):
394
+                # fence_rhevm
395
+                node_data["agent"] = "fence_rhevm"
396
+                params["ipaddr"] = node["pm_addr"]
397
+                params["passwd"] = node["pm_password"]
398
+                params["login"] = node["pm_user"]
399
+                params["port"] = node["pm_vm_name"]
400
+                params["ssl"] = 1
401
+                params["ssl_insecure"] = 1
402
+                if hostmap:
403
+                    params["pcmk_host_list"] = \
404
+                        hostmap[mac_addr]["compute_name"]
405
+                if self.delay:
406
+                    params["delay"] = self.delay
393 407
             elif (node['pm_type'] == 'ipmi' or node["pm_type"].split('_')[1] in
394 408
                   ("ipmitool", "ilo", "drac")):
395 409
                 # IPMI fencing driver

+ 30
- 1
tripleo_common/tests/actions/test_parameters.py View File

@@ -874,6 +874,10 @@ class GenerateFencingParametersActionTestCase(base.TestCase):
874 874
             "11:22:33:44:55:66": {
875 875
                 "compute_name": "compute_name_1",
876 876
                 "baremetal_name": "baremetal_name_1"
877
+                },
878
+            "bb:cc:dd:ee:ff:gg": {
879
+                "compute_name": "compute_name_5",
880
+                "baremetal_name": "baremetal_name_5"
877 881
                 }
878 882
             }
879 883
         mock_generate_hostmap.return_value = test_hostmap
@@ -897,6 +901,17 @@ class GenerateFencingParametersActionTestCase(base.TestCase):
897 901
             "mac": [
898 902
                 "11:22:33:44:55:66"
899 903
             ]
904
+        }, {
905
+            # This is an extra node on oVirt/RHV
906
+            "name": "control-3",
907
+            "pm_password": "ovirt-password",
908
+            "pm_type": "staging-ovirt",
909
+            "pm_user": "admin@internal",
910
+            "pm_addr": "3.4.5.6",
911
+            "pm_vm_name": "control-3",
912
+            "mac": [
913
+                "bb:cc:dd:ee:ff:gg"
914
+            ]
900 915
         }, {
901 916
             # This is an extra node that is not in the hostmap, to ensure we
902 917
             # cope with unprovisioned nodes
@@ -926,7 +941,7 @@ class GenerateFencingParametersActionTestCase(base.TestCase):
926 941
         result = action.run(mock_ctx)["parameter_defaults"]
927 942
 
928 943
         self.assertTrue(result["EnableFencing"])
929
-        self.assertEqual(len(result["FencingConfig"]["devices"]), 2)
944
+        self.assertEqual(len(result["FencingConfig"]["devices"]), 3)
930 945
         self.assertEqual(result["FencingConfig"]["devices"][0], {
931 946
                          "agent": "fence_ipmilan",
932 947
                          "host_mac": "00:11:22:33:44:55",
@@ -953,6 +968,20 @@ class GenerateFencingParametersActionTestCase(base.TestCase):
953 968
                              "pcmk_host_map": "compute_name_1:baremetal_name_1"
954 969
                              }
955 970
                          })
971
+        self.assertEqual(result["FencingConfig"]["devices"][2], {
972
+                         "agent": "fence_rhevm",
973
+                         "host_mac": "bb:cc:dd:ee:ff:gg",
974
+                         "params": {
975
+                             "delay": 28,
976
+                             "ipaddr": "3.4.5.6",
977
+                             "login": "admin@internal",
978
+                             "passwd": "ovirt-password",
979
+                             "port": "control-3",
980
+                             "ssl": 1,
981
+                             "ssl_insecure": 1,
982
+                             "pcmk_host_list": "compute_name_5"
983
+                             }
984
+                         })
956 985
 
957 986
 
958 987
 class GetFlattenedParametersActionTest(base.TestCase):

Loading…
Cancel
Save