From 2edd3d5ff1400346eb5ec06f4b45981e4bd3046c Mon Sep 17 00:00:00 2001 From: Veerabhadrarao Damisetti Date: Mon, 20 Jan 2025 18:31:32 +0530 Subject: [PATCH] feat: HCP - Support for booting DPM LPAR ans attaching as compute node (#372) Support for booting DPM LPAR ans attaching as compute node Network modes: OSA , RoCE Storage: FCP DASD Updated documentation --------- Signed-off-by: root Co-authored-by: root --- docs/set-variables-group-vars.md | 1 + inventories/default/group_vars/hcp.yaml.template | 13 +++++++++---- roles/boot_LPAR/templates/boot_lpar.py | 2 ++ roles/boot_LPAR_hcp/tasks/main.yaml | 3 ++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/set-variables-group-vars.md b/docs/set-variables-group-vars.md index 16c551b6..0e2b34de 100644 --- a/docs/set-variables-group-vars.md +++ b/docs/set-variables-group-vars.md @@ -367,6 +367,7 @@ **hcp.data_plane.lpar.nodes.dasd.disk_id** | Disk id for dasd disk to be used for zVM node | 4404 **hcp.data_plane.lpar.nodes.lun** | Disk details of fcp disk to be used for zVM node | 0.0.4404 **hcp.data_plane.lpar.nodes.live_disk.disk_type** | Live disk type for booting LPAR | scsi +**hcp.data_plane.lpar.nodes.live_disk.uuid** | UUID for the live disk | 600507000000000000xxxx **hcp.data_plane.lpar.nodes.live_disk.devicenr** | devicenr for the live disk | 8001 **hcp.data_plane.lpar.nodes.live_disk.lun** | lun id for the live disk | 40xxxxxxxxxxxxx **hcp.data_plane.lpar.nodes.live_disk.wwpn** | wwpn for the live disk | 500507630xxxxxxx diff --git a/inventories/default/group_vars/hcp.yaml.template b/inventories/default/group_vars/hcp.yaml.template index 38a1939c..401335ff 100644 --- a/inventories/default/group_vars/hcp.yaml.template +++ b/inventories/default/group_vars/hcp.yaml.template @@ -170,10 +170,15 @@ hcp: # Live disk details live_disk: disk_type: - devicenr: - lun: - wwpn: - password: + password: '' + + uuid: '' # Required only in case of DPM LPAR + + # following paramaters are required only in case of classical LPAR + devicenr: '' + lun: '' + wwpn: '' + diff --git a/roles/boot_LPAR/templates/boot_lpar.py b/roles/boot_LPAR/templates/boot_lpar.py index b3ddbbc6..c5a23fe1 100644 --- a/roles/boot_LPAR/templates/boot_lpar.py +++ b/roles/boot_LPAR/templates/boot_lpar.py @@ -20,6 +20,7 @@ def list_of_strings(arg): #live disk info parser.add_argument("--livedisktype", type=str, help="Can be of type dasd or scsi", required=True, default='') +parser.add_argument("--livediskuuid", type=str, help="UUID for the live disk image") parser.add_argument("--devicenr", type=str, help="deviceenr for the live disk image") parser.add_argument("--netset_ip", type=str, help="network setup ip for the live image") parser.add_argument("--netset_gateway", type=str) @@ -62,6 +63,7 @@ def list_of_strings(arg): lpar_parameters = { "boot_params": { "boot_method" : args.livedisktype.lower(), + "uuid" : args.livediskuuid, "devicenr": args.devicenr, 'netsetup': { "mac": None, diff --git a/roles/boot_LPAR_hcp/tasks/main.yaml b/roles/boot_LPAR_hcp/tasks/main.yaml index cf433604..b5ef0c38 100644 --- a/roles/boot_LPAR_hcp/tasks/main.yaml +++ b/roles/boot_LPAR_hcp/tasks/main.yaml @@ -24,6 +24,7 @@ --initrd http://"{{ hcp.bastion_params.ip }}":8080/initrd.img \ --livedisktype "{{ hcp.data_plane.lpar.nodes[item].live_disk.disk_type }}" \ --devicenr "{{ hcp.data_plane.lpar.nodes[item].live_disk.devicenr }}" \ + --livediskuuid "{{ hcp.data_plane.lpar.nodes[item].live_disk.uuid }}" \ --livedisklun "{{ hcp.data_plane.lpar.nodes[item].live_disk.lun }}" \ --livediskwwpn "{{ hcp.data_plane.lpar.nodes[item].live_disk.wwpn }}" \ --netset_ip "{{ hcp.data_plane.lpar.nodes[item].interface.ip }}" \ @@ -47,4 +48,4 @@ register: agent_name - name: Approve agents - shell: oc -n {{ hcp.control_plane.hosted_cluster_name }}-agents patch agent {{ agent_name.stdout.split(' ')[0] }} -p '{"spec":{"approved":true,"hostname":"compute-{{ item }}.{{hcp.control_plane.hosted_cluster_name }}.{{ hcp.control_plane.basedomain }}"}}' --type merge \ No newline at end of file + shell: oc -n {{ hcp.control_plane.hosted_cluster_name }}-agents patch agent {{ agent_name.stdout.split(' ')[0] }} -p '{"spec":{"approved":true,"hostname":"compute-{{ item }}.{{hcp.control_plane.hosted_cluster_name }}.{{ hcp.control_plane.basedomain }}"}}' --type merge