mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 01:02:46 +01:00
Merge pull request #15248 from Security-Onion-Solutions/bravo
clarify hypervisor annotation
This commit is contained in:
@@ -489,7 +489,7 @@ def _ensure_hypervisor_host_dir(minion_id: str = None):
|
||||
log.error(f"Error creating hypervisor host directory: {str(e)}")
|
||||
return False
|
||||
|
||||
def _apply_dyanno_hypervisor_state(status='Initialized'):
|
||||
def _apply_dyanno_hypervisor_state(status):
|
||||
"""
|
||||
Apply the soc.dyanno.hypervisor state on the salt master.
|
||||
|
||||
@@ -671,11 +671,6 @@ def setup_environment(vm_name: str = 'sool9', disk_size: str = '220G', minion_id
|
||||
log.warning("Failed to apply salt.cloud.config state, continuing with setup")
|
||||
# We don't return an error here as we want to continue with the setup process
|
||||
|
||||
# Apply the soc.dyanno.hypervisor state on the salt master with PreInit status
|
||||
if not _apply_dyanno_hypervisor_state('PreInit'):
|
||||
log.warning("Failed to apply soc.dyanno.hypervisor state, continuing with setup")
|
||||
# We don't return an error here as we want to continue with the setup process
|
||||
|
||||
log.info("Starting setup_environment in setup_hypervisor runner")
|
||||
|
||||
# Check if environment is already set up
|
||||
@@ -689,6 +684,7 @@ def setup_environment(vm_name: str = 'sool9', disk_size: str = '220G', minion_id
|
||||
|
||||
# Handle image setup if needed
|
||||
if not image_valid:
|
||||
_apply_dyanno_hypervisor_state('ImageDownloadStart')
|
||||
log.info("Starting image download/validation process")
|
||||
if not _download_image():
|
||||
log.error("Image download failed")
|
||||
@@ -734,7 +730,7 @@ def setup_environment(vm_name: str = 'sool9', disk_size: str = '220G', minion_id
|
||||
|
||||
# Update hypervisor annotation with success status
|
||||
if success:
|
||||
_apply_dyanno_hypervisor_state('Initialized')
|
||||
_apply_dyanno_hypervisor_state('PreInit')
|
||||
else:
|
||||
_apply_dyanno_hypervisor_state('SetupFailed')
|
||||
|
||||
|
||||
@@ -43,6 +43,10 @@
|
||||
|
||||
No Virtual Machines Found
|
||||
{%- endif %}
|
||||
{%- elif baseDomainStatus == 'ImageDownloadStart' %}
|
||||
#### INFO
|
||||
|
||||
Base domain image download started.
|
||||
{%- elif baseDomainStatus == 'ImageDownloadFailed' %}
|
||||
#### ERROR
|
||||
|
||||
@@ -55,10 +59,10 @@ SSH key setup failed. Please check the salt-master log for details.
|
||||
#### WARNING
|
||||
|
||||
Setup failed. Please check the salt-master log for details.
|
||||
{%- else %}
|
||||
{%- elif baseDomainStatus == 'PreInit' %}
|
||||
#### WARNING
|
||||
|
||||
Base domain has not been initialized.
|
||||
Base domain has not been initialized. Waiting for hypervisor to highstate.
|
||||
{%- endif %}
|
||||
{%- endmacro -%}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user