-
Notifications
You must be signed in to change notification settings - Fork 49
Changes from 500 VMs Hybrid work #733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
afcollins
wants to merge
6
commits into
redhat-performance:main
Choose a base branch
from
afcollins:hv-hugepages
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
69b8036
Changes from 500 VMs Hybrid work
afcollins e5a7d64
Feedback from PR
afcollins a0d87ff
Revert ocp-scale-out-csr changes
afcollins 4a22cd2
Revert set_hostname_role
afcollins e3db4bd
Revert ansible.cfg
afcollins ffa0dce
Added note about VM NICs into the docs
afcollins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,4 +16,5 @@ out | |
| gen | ||
| .idea/ | ||
| .idea/workspace.xml | ||
|
|
||
| *.log | ||
| *.orig | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| smcipmitool.tar.gz | ||
| *.sw* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| # Copy pull secret playbook | ||
| # | ||
| # This playbook is used to copy the pull secret to the nodes in the cluster. | ||
| # It is used to updae the pull secret on nodes to pull images from the Red Hat registry. | ||
| # | ||
| # Example Usage: | ||
| # | ||
| # ansible-playbook ansible/copy-pull-secret.yml | ||
| # | ||
|
|
||
| - name: Copies pull secret to nodes | ||
| hosts: hv_vm | ||
| roles: | ||
| - copy-pull-secret |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| - name: start one VMs | ||
| gather_facts: false | ||
| hosts: hv | ||
| roles: | ||
| - hv-vm-start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| - name: destroy all VMs | ||
| hosts: hv | ||
| roles: | ||
| - hv-vm-destroy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| --- | ||
| # Create and deploy a cluster with the Assisted Installer | ||
| # | ||
| # Example Usage: | ||
| # | ||
| # ansible-playbook -i ansible/inventory/cloud42.local ansible/mno-deploy.yml | ||
| # | ||
|
|
||
| - name: Prep cluster to add hosts | ||
| hosts: bastion | ||
| vars_files: | ||
| - vars/lab.yml | ||
| - vars/all.yml | ||
| gather_facts: false | ||
| tasks: | ||
| - name: Set assisted installer connection | ||
| set_fact: | ||
| assisted_installer_host: "{{ groups['bastion'][0] }}" | ||
| assisted_installer_port: "8090" | ||
|
|
||
| - name: Get cluster status | ||
| uri: | ||
| url: "http://{{ assisted_installer_host }}:{{ assisted_installer_port }}/api/assisted-install/v2/clusters/{{ ai_cluster_id }}" | ||
| method: GET | ||
| body_format: json | ||
| status_code: [200] | ||
| return_content: true | ||
| register: cluster_data | ||
| failed_when: cluster_data.json.status not in ['installed', 'adding-hosts'] | ||
|
|
||
| - name: Set cluster status to adding-hosts | ||
| uri: | ||
| url: "http://{{ assisted_installer_host }}:{{ assisted_installer_port }}/api/assisted-install/v2/clusters/{{ ai_cluster_id }}/actions/allow-add-workers" | ||
| method: POST | ||
| body_format: json | ||
| status_code: [201, 202] | ||
| when: cluster_data.json.status == 'installed' | ||
|
|
||
| - name: Get infra-env | ||
| uri: | ||
| url: "http://{{ assisted_installer_host }}:{{ assisted_installer_port }}/api/assisted-install/v2/clusters/{{ ai_cluster_id }}" | ||
| method: GET | ||
| body_format: json | ||
| status_code: [200] | ||
| return_content: true | ||
| register: infra_env_return | ||
|
|
||
| - name: Set ai_infraenv_id | ||
| set_fact: | ||
| ai_infraenv_id: "{{ infra_env_return.json.hosts[0].infra_env_id }}" | ||
|
|
||
| - name: Get infra-env static_network_config | ||
| uri: | ||
| url: "http://{{ assisted_installer_host }}:{{ assisted_installer_port }}/api/assisted-install/v2/infra-envs/{{ ai_infraenv_id }}" | ||
| method: GET | ||
| body_format: json | ||
| status_code: [200] | ||
| return_content: true | ||
| register: infra_env_return | ||
|
|
||
| - name: Set ai_infraenv_static_config | ||
| set_fact: | ||
| ai_infraenv_static_config: "{{ infra_env_return.json.static_network_config }}" | ||
|
|
||
| - name: Set empty static network configuration | ||
| set_fact: | ||
| static_network_config: [] | ||
|
|
||
| - name: Generate Static Network Config for VMs | ||
| ansible.builtin.include_role: | ||
| name: create-ai-cluster | ||
| tasks_from: static_network_config | ||
| vars: | ||
| hybrid_worker_count: "{{ add_worker_count }}" | ||
| loop: "{{ groups['hv_vm'][:hybrid_worker_count | int] }}" | ||
|
|
||
| - name: show ai_infraenv_static_config | ||
| debug: | ||
| var: ai_infraenv_static_config | ||
|
|
||
| - name: show static_network_config | ||
| debug: | ||
| var: static_network_config | ||
|
|
||
| - name: Set static network composite | ||
| set_fact: | ||
| static_network_config_comp: "{{ static_network_config + ai_infraenv_static_config }}" | ||
|
|
||
| - name: show static_network_config composite | ||
| debug: | ||
| var: static_network_config_comp | ||
|
|
||
| - name: Update static config | ||
| uri: | ||
| url: "http://{{ assisted_installer_host }}:{{ assisted_installer_port }}/api/assisted-install/v2/infra-envs/{{ ai_infraenv_id }}" | ||
| body: { | ||
| "static_network_config": "{{ static_network_config + ai_infraenv_static_config }}" | ||
| } | ||
| method: PATCH | ||
| body_format: json | ||
| status_code: [201] | ||
| return_content: true | ||
|
|
||
|
|
||
| - name: Boot / Install VMs | ||
| hosts: bastion | ||
| vars_files: | ||
| - vars/lab.yml | ||
| - vars/all.yml | ||
| roles: | ||
| - generate-discovery-iso | ||
| - role: boot-iso | ||
| vars: | ||
| inventory_group: hv_vm | ||
| index: "{{ add_worker_count }}" | ||
| virtual_media_iso: "discovery.iso" | ||
| - role: wait-hosts-discovered | ||
| vars: | ||
| inventory_nodes: "{{ groups['hv_vm'][:add_worker_count|int] }}" | ||
| discover_nodes: "{{ groups['hv_vm'][:add_worker_count|int] }}" | ||
| - add-hosts-install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| - name: Copy pull secret | ||
| copy: | ||
| src: pull-secret.json | ||
| dest: "/var/lib/kubelet/config.json" | ||
| become: true | ||
| - name: touch force update | ||
| file: | ||
| path: /run/machine-config-daemon-force | ||
| state: touch | ||
| become: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| --- | ||
| # hv-install default vars | ||
|
|
||
| # Hugepages configuration for hypervisors | ||
| enable_hugepages: false | ||
|
|
||
| # Hugepage size: 2M or 1G | ||
| hugepage_size: "1G" | ||
|
|
||
| # Number of hugepages to allocate (e.g., 32 for 32GB of 1G hugepages) | ||
| hugepage_count: 32 | ||
|
|
||
| # Additional kernel parameters for performance tuning | ||
| additional_kernel_params: [] | ||
|
|
||
| # Number of hugepages per node (e.g. total / 2) | ||
| hugepages_count_per_node: 190 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
ansible/roles/hv-install/templates/hugetlb-reserve-pages.sh.j2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/bin/sh | ||
|
|
||
| nodes_path=/sys/devices/system/node/ | ||
| if [ ! -d $nodes_path ]; then | ||
| echo "ERROR: $nodes_path does not exist" | ||
| exit 1 | ||
| fi | ||
|
|
||
| reserve_pages() | ||
| { | ||
| echo $1 > $nodes_path/$2/hugepages/hugepages-1048576kB/nr_hugepages | ||
| } | ||
|
|
||
| reserve_pages {{ hugepages_count_per_node }} node0 | ||
| reserve_pages {{ hugepages_count_per_node }} node1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.