diff --git a/salt/_runners/setup_hypervisor.py b/salt/_runners/setup_hypervisor.py index 7d521bd62..182a9b2c8 100644 --- a/salt/_runners/setup_hypervisor.py +++ b/salt/_runners/setup_hypervisor.py @@ -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') diff --git a/salt/soc/dyanno/hypervisor/soc_hypervisor.yaml.jinja b/salt/soc/dyanno/hypervisor/soc_hypervisor.yaml.jinja index 97170a55f..f23fdb5d9 100644 --- a/salt/soc/dyanno/hypervisor/soc_hypervisor.yaml.jinja +++ b/salt/soc/dyanno/hypervisor/soc_hypervisor.yaml.jinja @@ -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 -%}