When running Running Upgrade Automation preflight script a message is displayed
Verify free space available on the Orchestrator (24 GB required)]
DX NetOps Spectrum upgrade automation
Looking at the inventory-validation.yml playbook we are doing the following:
- name: Verify free space on the Orchestrator
block:
- name: Register available free space on the Orchestrator
ansible.builtin.raw: df ~/ --output\=avail | tail -1
register: freespace_output
changed_when: true
- name: Get available memory in GB
ansible.builtin.set_fact:
avail_mem_gb: "{{ freespace_output.stdout | float / 1000000 }}"
free_mem_required: "{{ free_mem_block_size * 4 }}"
- name: Verify free space available on the Orchestrator ({{ free_mem_required }} GB required)
ansible.builtin.assert:
that: (avail_mem_gb | float) is gt (free_mem_required | float )
success_msg: Sufficient free memory available on the Orchestrator ={{ avail_mem_gb }} GB.
fail_msg: "Orchestrator does not have the minimum space required to continue ({{ free_mem_required }} GB required)."
When running the following command df ~/ --output\=avail | tail -1 and calculating the free space on the / partition using the following command:
freespace_output.stdout | float / 1000000
The check this value against the free_mem_required. This is defined by the free_mem_block_size * 4. The free_mem_block_size is defined in the variables.yml file in the config directory with a value of 6.
The freespace_output has to be greater than 24GB.
Currently we are only checking the / partition for the disk space.
The following code in the inventory-validation.yml playbook can be commented out.
- name: Verify free space on the Orchestrator
block:
- name: Register available free space on the Orchestrator
ansible.builtin.raw: df ~/ --output\=avail | tail -1
register: freespace_output
changed_when: true
- name: Get available memory in GB
ansible.builtin.set_fact:
avail_mem_gb: "{{ freespace_output.stdout | float / 1000000 }}"
free_mem_required: "{{ free_mem_block_size * 4 }}"
- name: Verify free space available on the Orchestrator ({{ free_mem_required }} GB required)
ansible.builtin.assert:
that: (avail_mem_gb | float) is gt (free_mem_required | float )
success_msg: Sufficient free memory available on the Orchestrator ={{ avail_mem_gb }} GB.
fail_msg: "Orchestrator does not have the minimum space required to continue ({{ free_mem_required }} GB required)."
An ER has been created to check other partitions for the space required.