From 894330bd5455e8b6739a5c22abdee2529f5fe282 Mon Sep 17 00:00:00 2001 From: Tian Xia Date: Sun, 24 Nov 2024 23:57:48 -0800 Subject: [PATCH] Fix Spot instance on Azure (#4408) --- sky/provision/azure/instance.py | 3 ++- sky/templates/azure-ray.yml.j2 | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sky/provision/azure/instance.py b/sky/provision/azure/instance.py index 60159232787..c54199bd25d 100644 --- a/sky/provision/azure/instance.py +++ b/sky/provision/azure/instance.py @@ -305,7 +305,8 @@ def _create_vm( network_profile=network_profile, identity=compute.VirtualMachineIdentity( type='UserAssigned', - user_assigned_identities={provider_config['msi']: {}})) + user_assigned_identities={provider_config['msi']: {}}), + priority=node_config['azure_arm_parameters']['priority']) vm_poller = compute_client.virtual_machines.begin_create_or_update( resource_group_name=provider_config['resource_group'], vm_name=vm_name, diff --git a/sky/templates/azure-ray.yml.j2 b/sky/templates/azure-ray.yml.j2 index 7b9737748d3..1140704a708 100644 --- a/sky/templates/azure-ray.yml.j2 +++ b/sky/templates/azure-ray.yml.j2 @@ -75,9 +75,6 @@ available_node_types: {%- if use_spot %} # optionally set priority to use Spot instances priority: Spot - # set a maximum price for spot instances if desired - # billingProfile: - # maxPrice: -1 {%- endif %} cloudInitSetupCommands: |- {%- for cmd in cloud_init_setup_commands %}