Merge pull request #14848 from Security-Onion-Solutions/vlb2

hosted image. sos hw support
This commit is contained in:
Josh Patterson
2025-07-16 15:43:14 -04:00
committed by GitHub
4 changed files with 114 additions and 39 deletions

View File

@@ -165,7 +165,7 @@ def _validate_image_checksum(path, expected_sha256):
return True return True
# Constants # Constants
IMAGE_URL = "https://yum.oracle.com/templates/OracleLinux/OL9/u5/x86_64/OL9U5_x86_64-kvm-b253.qcow2" IMAGE_URL = "https://download.securityonion.net/file/securityonion/OL9U5_x86_64-kvm-b253.qcow2"
IMAGE_SHA256 = "3b00bbbefc8e78dd28d9f538834fb9e2a03d5ccdc2cadf2ffd0036c0a8f02021" IMAGE_SHA256 = "3b00bbbefc8e78dd28d9f538834fb9e2a03d5ccdc2cadf2ffd0036c0a8f02021"
IMAGE_PATH = "/nsm/libvirt/boot/OL9U5_x86_64-kvm-b253.qcow2" IMAGE_PATH = "/nsm/libvirt/boot/OL9U5_x86_64-kvm-b253.qcow2"
MANAGER_HOSTNAME = socket.gethostname() MANAGER_HOSTNAME = socket.gethostname()

View File

@@ -17,42 +17,109 @@ hypervisor:
6: pci_0000_02_00_1 6: pci_0000_02_00_1
7: pci_0000_41_00_0 7: pci_0000_41_00_0
8: pci_0000_41_00_1 8: pci_0000_41_00_1
model1: SOSSNNV:
hardware: hardware:
cpu: 128 cpu: 128
memory: 128 memory: 256
disk: disk:
1: pci_0000_c7_00_0 1: pci_0000_42_00_0
2: pci_0000_c8_00_0 2: pci_0000_43_00_0
3: pci_0000_44_00_0
4: pci_0000_45_00_0
copper: copper:
1: pci_0000_c4_00_0 sfp:
2: pci_0000_c4_00_1 1: pci_0000_02_00_0
3: pci_0000_c4_00_2 2: pci_0000_02_00_1
4: pci_0000_c4_00_3 3: pci_0000_41_00_0
4: pci_0000_41_00_1
SOSSNNV-DE02:
hardware:
cpu: 128
memory: 384
disk:
1: pci_0000_41_00_0
2: pci_0000_42_00_0
3: pci_0000_81_00_0
4: pci_0000_82_00_0
5: pci_0000_83_00_0
6: pci_0000_84_00_0
copper:
1: pci_0000_85_00_0
2: pci_0000_85_00_1
3: pci_0000_85_00_2
4: pci_0000_85_00_3
sfp:
5: pci_0000_c4_00_0
6: pci_0000_c4_00_1
7: pci_0000_c5_00_0
8: pci_0000_c5_00_1
9: pci_0000_c5_00_2
10: pci_0000_c5_00_3
SOSSN7200:
hardware:
cpu: 128
memory: 256
copper:
1: pci_0000_03_00_0
2: pci_0000_03_00_1
3: pci_0000_03_00_2
4: pci_0000_03_00_3
sfp: sfp:
5: pci_0000_02_00_0 5: pci_0000_02_00_0
6: pci_0000_02_00_1 6: pci_0000_02_00_1
7: pci_0000_41_00_0 7: pci_0000_81_00_0
8: pci_0000_41_00_1 8: pci_0000_81_00_1
model2: 9: pci_0000_81_00_2
cpu: 256 10: pci_0000_81_00_3
memory: 256 SOSSN7200-DE02:
disk: hardware:
1: pci_0000_c7_00_0 cpu: 128
2: pci_0000_c8_00_0 memory: 384
3: pci_0000_c9_00_0
4: pci_0000_c10_00_0
copper: copper:
1: pci_0000_c4_00_0 1: pci_0000_82_00_0
2: pci_0000_c4_00_1 2: pci_0000_82_00_1
3: pci_0000_c4_00_2 3: pci_0000_82_00_2
4: pci_0000_c4_00_3 4: pci_0000_82_00_3
5: pci_0000_c5_00_0
6: pci_0000_c5_00_1
7: pci_0000_c5_00_2
8: pci_0000_c5_00_3
sfp: sfp:
9: pci_0000_02_00_0 5: pci_0000_c4_00_0
10: pci_0000_02_00_1 6: pci_0000_c4_00_1
11: pci_0000_41_00_0 7: pci_0000_c5_00_0
12: pci_0000_41_00_1 8: pci_0000_c5_00_1
9: pci_0000_c6_00_0
10: pci_0000_c6_00_1
11: pci_0000_c6_00_2
12: pci_0000_c6_00_3
SOS4000:
hardware:
cpu: 128
memory: 256
copper:
1: pci_0000_03_00_0
2: pci_0000_03_00_1
3: pci_0000_03_00_2
4: pci_0000_03_00_3
sfp:
5: pci_0000_02_00_0
6: pci_0000_02_00_1
7: pci_0000_81_00_0
8: pci_0000_81_00_1
9: pci_0000_81_00_2
10: pci_0000_81_00_3
SOS5000-DE02:
hardware:
cpu: 128
memory: 384
copper:
1: pci_0000_82_00_0
2: pci_0000_82_00_1
3: pci_0000_82_00_2
4: pci_0000_82_00_3
sfp:
5: pci_0000_c4_00_0
6: pci_0000_c4_00_1
7: pci_0000_c5_00_0
8: pci_0000_c5_00_1
9: pci_0000_c6_00_0
10: pci_0000_c6_00_1
11: pci_0000_c6_00_2
12: pci_0000_c6_00_3

View File

@@ -48,6 +48,7 @@ manage_userdata_sool9:
file.managed: file.managed:
- name: /nsm/libvirt/images/sool9/user-data - name: /nsm/libvirt/images/sool9/user-data
- source: salt://libvirt/images/sool9/user-data - source: salt://libvirt/images/sool9/user-data
- show_changes: False
# Manage qcow2 image # Manage qcow2 image
manage_qcow2_sool9: manage_qcow2_sool9:

View File

@@ -22,7 +22,7 @@
| | CPU Cores | Memory (GB) | Disk | Copper | SFP | | | CPU Cores | Memory (GB) | Disk | Copper | SFP |
|-----------|-----------|-------------|-------------|-------------|-------------| |-----------|-----------|-------------|-------------|-------------|-------------|
| Available | {{ cpu_free }} | {{ mem_free }} | {{ disk_free | replace('\n', ',') if disk_free else 'None' }} | {{ copper_free | replace('\n', ',') if copper_free else 'None' }} | {{ sfp_free | replace('\n', ',') if sfp_free else 'None' }} | | Available | {{ cpu_free }} | {{ mem_free }} | {{ disk_free | replace('\n', ',') if disk_free else 'None' }} | {{ copper_free | replace('\n', ',') if copper_free else 'None' }} | {{ sfp_free | replace('\n', ',') if sfp_free else 'None' }} |
| Total | {{ cpu_total }} | {{ mem_total }} | {{ disk_total | replace('\n', ',') }} | {{ copper_total | replace('\n', ',') }} | {{ sfp_total | replace('\n', ',') }} | | Total | {{ cpu_total }} | {{ mem_total }} | {{ disk_total | replace('\n', ',') if disk_total else 'None' }} | {{ copper_total | replace('\n', ',') if copper_total else 'None' }} | {{ sfp_total | replace('\n', ',') if sfp_total else 'None' }} |
{%- if baseDomainStatus == 'Initialized' %} {%- if baseDomainStatus == 'Initialized' %}
{%- if vm_list %} {%- if vm_list %}
@@ -60,7 +60,8 @@ Base domain has not been initialized.
{%- macro get_available_pci(hw_config, device_type, used_indices) -%} {%- macro get_available_pci(hw_config, device_type, used_indices) -%}
{%- set available = [] -%} {%- set available = [] -%}
{%- for idx in hw_config.get(device_type, {}).keys() -%} {%- set device_config = hw_config.get(device_type, {}) or {} -%}
{%- for idx in device_config.keys() -%}
{%- if idx | string not in used_indices -%} {%- if idx | string not in used_indices -%}
{%- do available.append(idx) -%} {%- do available.append(idx) -%}
{%- endif -%} {%- endif -%}
@@ -155,9 +156,9 @@ Base domain has not been initialized.
{# Get total resources #} {# Get total resources #}
{%- set cpu_total = hw_config.cpu -%} {%- set cpu_total = hw_config.cpu -%}
{%- set mem_total = hw_config.memory -%} {%- set mem_total = hw_config.memory -%}
{%- set disk_total = hw_config.disk.keys() | join('\n') -%} {%- set disk_total = (hw_config.get('disk', {}) or {}).keys() | join('\n') if hw_config.get('disk', {}) else '' -%}
{%- set copper_total = hw_config.copper.keys() | join('\n') -%} {%- set copper_total = (hw_config.get('copper', {}) or {}).keys() | join('\n') if hw_config.get('copper', {}) else '' -%}
{%- set sfp_total = hw_config.sfp.keys() | join('\n') -%} {%- set sfp_total = (hw_config.get('sfp', {}) or {}).keys() | join('\n') if hw_config.get('sfp', {}) else '' -%}
{# Update field labels with total and free values #} {# Update field labels with total and free values #}
{%- set updated_template = TEMPLATE.copy() -%} {%- set updated_template = TEMPLATE.copy() -%}
@@ -170,20 +171,26 @@ Base domain has not been initialized.
{%- do update_resource_field(updated_field, mem_free, mem_total, 'GB') -%} {%- do update_resource_field(updated_field, mem_free, mem_total, 'GB') -%}
{%- elif field.field == 'disk' -%} {%- elif field.field == 'disk' -%}
{%- set disk_free_list = disk_free.split(',') if disk_free else [] -%} {%- set disk_free_list = disk_free.split(',') if disk_free else [] -%}
{%- set disk_free_safe = disk_free if disk_free is defined else '' -%}
{%- set disk_total_safe = disk_total if disk_total is defined else '' -%}
{%- do updated_field.update({ {%- do updated_field.update({
'label': field.label | replace('FREE', disk_free) | replace('TOTAL', disk_total | replace('\n', ',')), 'label': field.label | replace('FREE', disk_free_safe) | replace('TOTAL', disk_total_safe | replace('\n', ',')),
'options': disk_free_list 'options': disk_free_list
}) -%} }) -%}
{%- elif field.field == 'copper' -%} {%- elif field.field == 'copper' -%}
{%- set copper_free_list = copper_free.split(',') if copper_free else [] -%} {%- set copper_free_list = copper_free.split(',') if copper_free else [] -%}
{%- set copper_free_safe = copper_free if copper_free is defined else '' -%}
{%- set copper_total_safe = copper_total if copper_total is defined else '' -%}
{%- do updated_field.update({ {%- do updated_field.update({
'label': field.label | replace('FREE', copper_free) | replace('TOTAL', copper_total | replace('\n', ',')), 'label': field.label | replace('FREE', copper_free_safe) | replace('TOTAL', copper_total_safe | replace('\n', ',')),
'options': copper_free_list 'options': copper_free_list
}) -%} }) -%}
{%- elif field.field == 'sfp' -%} {%- elif field.field == 'sfp' -%}
{%- set sfp_free_list = sfp_free.split(',') if sfp_free else [] -%} {%- set sfp_free_list = sfp_free.split(',') if sfp_free else [] -%}
{%- set sfp_free_safe = sfp_free if sfp_free is defined else '' -%}
{%- set sfp_total_safe = sfp_total if sfp_total is defined else '' -%}
{%- do updated_field.update({ {%- do updated_field.update({
'label': field.label | replace('FREE', sfp_free) | replace('TOTAL', sfp_total | replace('\n', ',')), 'label': field.label | replace('FREE', sfp_free_safe) | replace('TOTAL', sfp_total_safe | replace('\n', ',')),
'options': sfp_free_list 'options': sfp_free_list
}) -%} }) -%}
{%- endif -%} {%- endif -%}