Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/azure-cli/azure/cli/command_modules/vm/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -1452,6 +1452,15 @@ def _validate_generation_version_and_trusted_launch(cmd, namespace):
namespace.os_offer, namespace.os_sku)
vm_image_info = client.get(namespace.location, namespace.os_publisher, namespace.os_offer,
namespace.os_sku, os_version)

if vm_image_info.image_deprecation_status.image_state == 'ScheduledForDeprecation':
logger.warning(
'Warning: This image %s is scheduled for deprecation and will be blocked after %s.\n'
'VM / VMSS creation is allowed temporarily, but future deployments, redeployments, or '
'scale‑out operations may fail after this date.\n'
'Consider switching to a supported image now.', namespace.image,
vm_image_info.image_deprecation_status.scheduled_deprecation_time.strftime("%B %d, %Y"))

generation_version = vm_image_info.hyper_v_generation if hasattr(vm_image_info,
'hyper_v_generation') else None
features = vm_image_info.features if hasattr(vm_image_info, 'features') and vm_image_info.features else []
Expand Down