mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +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)}")
|
log.error(f"Error creating hypervisor host directory: {str(e)}")
|
||||||
return False
|
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.
|
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")
|
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
|
# 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")
|
log.info("Starting setup_environment in setup_hypervisor runner")
|
||||||
|
|
||||||
# Check if environment is already set up
|
# 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
|
# Handle image setup if needed
|
||||||
if not image_valid:
|
if not image_valid:
|
||||||
|
_apply_dyanno_hypervisor_state('ImageDownloadStart')
|
||||||
log.info("Starting image download/validation process")
|
log.info("Starting image download/validation process")
|
||||||
if not _download_image():
|
if not _download_image():
|
||||||
log.error("Image download failed")
|
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
|
# Update hypervisor annotation with success status
|
||||||
if success:
|
if success:
|
||||||
_apply_dyanno_hypervisor_state('Initialized')
|
_apply_dyanno_hypervisor_state('PreInit')
|
||||||
else:
|
else:
|
||||||
_apply_dyanno_hypervisor_state('SetupFailed')
|
_apply_dyanno_hypervisor_state('SetupFailed')
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,10 @@
|
|||||||
|
|
||||||
No Virtual Machines Found
|
No Virtual Machines Found
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
{%- elif baseDomainStatus == 'ImageDownloadStart' %}
|
||||||
|
#### INFO
|
||||||
|
|
||||||
|
Base domain image download started.
|
||||||
{%- elif baseDomainStatus == 'ImageDownloadFailed' %}
|
{%- elif baseDomainStatus == 'ImageDownloadFailed' %}
|
||||||
#### ERROR
|
#### ERROR
|
||||||
|
|
||||||
@@ -55,10 +59,10 @@ SSH key setup failed. Please check the salt-master log for details.
|
|||||||
#### WARNING
|
#### WARNING
|
||||||
|
|
||||||
Setup failed. Please check the salt-master log for details.
|
Setup failed. Please check the salt-master log for details.
|
||||||
{%- else %}
|
{%- elif baseDomainStatus == 'PreInit' %}
|
||||||
#### WARNING
|
#### WARNING
|
||||||
|
|
||||||
Base domain has not been initialized.
|
Base domain has not been initialized. Waiting for hypervisor to highstate.
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endmacro -%}
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user