-
Notifications
You must be signed in to change notification settings - Fork 41
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
Hybrid deployments #563
base: main
Are you sure you want to change the base?
Hybrid deployments #563
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
--- | ||
# Libvirt tasks for booting an iso | ||
# Couldn't use ansible redfish_command it requires username and password to be used. | ||
# URLs modeled from http://docs.openstack.org/sushy-tools/latest/user/dynamic-emulator.html | ||
|
||
- name: Libvirt - Power down machine prior to booting iso | ||
uri: | ||
url: "http://{{ hostvars[item]['ansible_host'] }}:9000/redfish/v1/Systems/{{ hostvars[item]['domain_uuid'] }}/Actions/ComputerSystem.Reset" | ||
method: POST | ||
headers: | ||
content-type: application/json | ||
Accept: application/json | ||
body: {"ResetType":"ForceOff"} | ||
body_format: json | ||
validate_certs: no | ||
status_code: 204 | ||
return_content: yes | ||
register: redfish_forceoff | ||
|
||
- name: Libvirt - Pause for power down | ||
pause: | ||
seconds: 1 | ||
when: not redfish_forceoff.failed | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be able to use a "check for powered down" type of task here instead of a sleep. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was able to remove this entirely on my tested deployments (3, 27, and 54 VMs) |
||
|
||
- name: Libvirt - Set OneTimeBoot VirtualCD | ||
uri: | ||
url: "http://{{ hostvars[item]['ansible_host'] }}:9000/redfish/v1/Systems/{{ hostvars[item]['domain_uuid'] }}" | ||
method: PATCH | ||
headers: | ||
content-type: application/json | ||
Accept: application/json | ||
body: { "Boot": { "BootSourceOverrideTarget": "Cd", "BootSourceOverrideMode": "UEFI", "BootSourceOverrideEnabled": "Continuous" } } | ||
body_format: json | ||
validate_certs: no | ||
status_code: 204 | ||
return_content: yes | ||
|
||
- name: Libvirt - Check for Virtual Media | ||
uri: | ||
url: "http://{{ hostvars[item]['ansible_host'] }}:9000/redfish/v1/Managers/{{ hostvars[item]['domain_uuid'] }}/VirtualMedia/Cd" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had to change |
||
method: Get | ||
headers: | ||
content-type: application/json | ||
Accept: application/json | ||
body: {} | ||
body_format: json | ||
validate_certs: no | ||
status_code: 200 | ||
return_content: yes | ||
register: check_virtual_media | ||
|
||
- name: Libvirt - Eject any CD Virtual Media | ||
uri: | ||
url: "http://{{ hostvars[item]['ansible_host'] }}:9000/redfish/v1/Managers/{{ hostvars[item]['domain_uuid'] }}/VirtualMedia/Cd/Actions/VirtualMedia.EjectMedia" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here with |
||
method: POST | ||
headers: | ||
content-type: application/json | ||
Accept: application/json | ||
body: {} | ||
body_format: json | ||
validate_certs: no | ||
status_code: 204 | ||
return_content: yes | ||
when: check_virtual_media.json.Image | ||
|
||
- name: Libvirt - Insert virtual media | ||
uri: | ||
url: "http://{{ hostvars[item]['ansible_host'] }}:9000/redfish/v1/Managers/{{ hostvars[item]['domain_uuid'] }}/VirtualMedia/Cd/Actions/VirtualMedia.InsertMedia" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here with |
||
method: POST | ||
headers: | ||
content-type: application/json | ||
Accept: application/json | ||
body: {"Image":"http://{{ http_store_host }}:{{ http_store_port }}/{{ hostvars[item]['boot_iso'] }}", "Inserted": true} | ||
body_format: json | ||
validate_certs: no | ||
status_code: 204 | ||
return_content: yes | ||
|
||
- name: Libvirt - Power on | ||
uri: | ||
url: "http://{{ hostvars[item]['ansible_host'] }}:9000/redfish/v1/Systems/{{ hostvars[item]['domain_uuid'] }}/Actions/ComputerSystem.Reset" | ||
method: POST | ||
headers: | ||
content-type: application/json | ||
Accept: application/json | ||
body: {"ResetType":"On"} | ||
body_format: json | ||
validate_certs: no | ||
status_code: 204 | ||
return_content: yes |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,13 @@ | |
- cluster_type == "mno" | ||
loop: "{{ groups['worker'] }}" | ||
|
||
- name: MNO / Hybrid (VM Workers) - Populate static network configuration with VM worker nodes | ||
include_tasks: static_network_config.yml | ||
when: | ||
- cluster_type == "mno" | ||
- hybrid_worker_count > 0 | ||
loop: "{{ groups['hv_vm'][:hybrid_worker_count] }}" | ||
|
||
# - debug: | ||
# msg: "{{ static_network_config }}" | ||
|
||
|
@@ -52,7 +59,10 @@ | |
"pull_secret": "{{ pull_secret | to_json }}", | ||
"ssh_public_key": "{{ lookup('file', ssh_public_key_file) }}", | ||
"vip_dhcp_allocation": "{{ vip_dhcp_allocation }}", | ||
"additional_ntp_source": "{{ bastion_controlplane_ip if use_bastion_registry else labs[lab]['ntp_server'] }}" | ||
"additional_ntp_source": "{{ bastion_controlplane_ip if use_bastion_registry else labs[lab]['ntp_server'] }}", | ||
"api_vips": [{"ip": "{{ controlplane_network_api }}"}], | ||
"ingress_vips": [{"ip": "{{ controlplane_network_ingress }}"}], | ||
"network_type": "{{ networktype }}" | ||
Comment on lines
+62
to
+65
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe we need to revert this. |
||
} | ||
register: create_cluster_return | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
|
||
- name: MNO - Create list of nodes to be discovered | ||
set_fact: | ||
inventory_nodes: "{{ groups['controlplane'] + groups['worker'] }}" | ||
inventory_nodes: "{{ groups['controlplane'] + groups['worker'] + groups['hv_vm'][:hybrid_worker_count] }}" | ||
when: cluster_type == "mno" | ||
|
||
- name: SNO - Create list of nodes to be discovered | ||
|
@@ -55,44 +55,6 @@ | |
loop_control: | ||
loop_var: discovered_host | ||
|
||
- name: Patch cluster network settings | ||
uri: | ||
url: "http://{{ assisted_installer_host }}:{{ assisted_installer_port }}/api/assisted-install/v2/clusters/{{ ai_cluster_id }}" | ||
method: PATCH | ||
status_code: [201] | ||
return_content: true | ||
body_format: json | ||
body: { | ||
"cluster_networks": [ | ||
{ | ||
"cidr": "{{ cluster_network_cidr }}", | ||
"cluster_id": "{{ ai_cluster_id }}", | ||
"host_prefix": "{{ cluster_network_host_prefix }}" | ||
} | ||
], | ||
"service_networks": [ | ||
{ | ||
"cidr": "{{ service_network_cidr }}", | ||
"cluster_id": "{{ ai_cluster_id }}", | ||
} | ||
] | ||
} | ||
|
||
- name: Patch cluster ingress/api vip addresses | ||
uri: | ||
url: "http://{{ assisted_installer_host }}:{{ assisted_installer_port }}/api/assisted-install/v2/clusters/{{ ai_cluster_id }}" | ||
method: PATCH | ||
status_code: [201] | ||
return_content: true | ||
body_format: json | ||
body: { | ||
"cluster_network_host_prefix": "{{ cluster_network_host_prefix }}", | ||
"vip_dhcp_allocation": "{{ vip_dhcp_allocation }}", | ||
"ingress_vips": [{"ip": "{{ controlplane_network_ingress }}"}], | ||
"api_vips": [{"ip": "{{ controlplane_network_api }}"}], | ||
"network_type": "{{ networktype }}" | ||
} | ||
|
||
Comment on lines
-58
to
-95
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this needs to be reverted as I was unable to make a cluster without including this. |
||
- name: Wait for cluster to be ready | ||
uri: | ||
url: "http://{{ assisted_installer_host }}:{{ assisted_installer_port }}/api/assisted-install/v2/clusters/{{ ai_cluster_id }}" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the context of someone running an ACM scale test where all of the hv_vm entries are actually say SNOs, does this task dump thousands of lines of skipped tasks or does it just skip the role? If it dumps thousands of lines, I think we should revisit how this is performed perhaps using a different inventory group.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right it does dump thousands of lines. I had looked at adding a loop_var in this at one point to make the output more meaningful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we could instead of including another boot-iso role here over hv_vm workers, maybe we just copy the desired number of hv_vm we want to use under workers instead. I will think of a more automated way to accomplish this as well. WDYT?