Browse Source

opensm changes in infiniband container

Signed-off-by: abhishek-sa1 <abhishek.sa3@dell.com>
abhishek-sa1 3 years ago
parent
commit
b4ca25fe53

+ 9 - 2
control_plane/roles/control_plane_ib/files/infiniband_container_configure.yml

@@ -19,5 +19,12 @@
   gather_facts: false
   tasks:
   - name: Start dhcpd services
-    command: dhcpd {{ ib_nic }}
-    changed_when: false
+    service:
+      name: dhcpd
+      state: started
+      enabled: yes
+
+  - name: Run opensm
+    shell: nohup /usr/sbin/opensm -F /etc/rdma/opensm.conf &
+    changed_when: true
+    failed_when: false

+ 2 - 2
control_plane/roles/control_plane_ib/files/k8s_infiniband.yml

@@ -35,8 +35,8 @@ spec:
         - name: infiniband-container
           image: 'localhost/infiniband-container:latest'
           imagePullPolicy: Never
-          command: [ "/start.sh" ]
-          args: [ "/sbin/init" ]
+          command:
+            - /sbin/init
           volumeMounts:
             - name: omnia-storage
               mountPath: /root/omnia

+ 0 - 2
control_plane/roles/control_plane_ib/files/start.sh

@@ -1,5 +1,3 @@
 #!/bin/bash
 
-/usr/libexec/rdma-init-kernel
-
 exec /usr/sbin/opensm -F /etc/rdma/opensm.conf

+ 1 - 4
control_plane/roles/control_plane_ib/tasks/check_prerequisites.yml

@@ -17,9 +17,6 @@
   set_fact:
     infiniband_container_status: false
     infiniband_container_image_status: false
-    infiniband_container_config_status: false
-    infiniband_backup_map_status: false
-    infiniband_new_node_status: false
 
 - name: Inspect the infiniband_container image
   command: "buildah images"
@@ -72,4 +69,4 @@
 - name: Update infiniband_container container status
   set_fact:
     infiniband_container_status: true
-  when: "'infiniband-container' in infiniband_container_result.stdout"
+  when: "'infiniband-container' in infiniband_container_result.stdout"

+ 2 - 13
control_plane/roles/control_plane_ib/tasks/configure_infiniband_container.yml

@@ -1,4 +1,4 @@
-# Copyright 2021 Dell Inc. or its subsidiaries. All Rights Reserved.
+# Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -13,17 +13,6 @@
 # limitations under the License.
 ---
 
-- name: Check infiniband pod status
-  command: kubectl get pods -n network-config
-  changed_when: false
-  register: infiniband_pod_status
-  failed_when: false
-
-- name: Deploy infiniband pod
-  command: "kubectl apply -f {{ role_path }}/files/k8s_infiniband.yml"
-  changed_when: true
-  when: infiniband_container_status and  (not infiniband_container_config_status)
-
 - name: Wait for infiniband pod to come to ready state
   command: kubectl wait --for=condition=ready -n network-config pod -l app=infiniband
   changed_when: false
@@ -35,5 +24,5 @@
 
 - name: Configuring infiniband container
   command: 'kubectl exec --stdin --tty -n network-config {{ infiniband_pod_name.stdout }} \
-    -- ansible-playbook /root/omnia/control_plane/roles/control_plane_ib/files/infiniband_container_configure.yml -e ib_nic="{{ ib_network_nic }}"'
+    -- ansible-playbook /root/omnia/control_plane/roles/control_plane_ib/files/infiniband_container_configure.yml'
   changed_when: false

+ 9 - 1
control_plane/roles/control_plane_ib/tasks/infiniband_container_image.yml

@@ -18,7 +18,8 @@
   changed_when: true
   args:
     chdir: "{{ role_path }}/files/"
-
+  when: not infiniband_container_image_status
+  
 - name: Update image name in k8s_infiniband.yml
   replace:
     path: "{{ ib_kube_config_file }}"
@@ -55,6 +56,13 @@
     regexp: "        - name: opensm-logs\n          hostPath:\n            path:.*"
     replace: "        - name: opensm-logs\n          hostPath:\n            path: {{ subnet_manager.log_directory }} "
 
+- name: Check infiniband pod status
+  command: kubectl get pods -n network-config
+  changed_when: false
+  register: infiniband_pod_status
+  failed_when: false
+
 - name: Deploy infiniband pod
   command: "kubectl apply -f {{ ib_kube_config_file }}"
   changed_when: true
+  when: not infiniband_container_status

+ 1 - 2
control_plane/roles/control_plane_ib/tasks/main.yml

@@ -56,5 +56,4 @@
           when: not infiniband_container_status
   when:
     - device_support_status
-    - ib_switch_support
-    - mgmt_os in os_supported_rocky
+    - ib_switch_support

+ 1 - 2
control_plane/roles/control_plane_ib/vars/main.yml

@@ -25,5 +25,4 @@ mount_path: /root/omnia
 infiniband_message_skipped: "The container is already present"
 infiniband_message_installed: "The container is installed"
 ib_kube_config_file: "{{ role_path }}/files/k8s_infiniband.yml"
-ib_container_name: infiniband-container
-infiniband_message_installed: "The container is installed"
+ib_container_name: infiniband-container