diff --git a/sky/provision/aws/instance.py b/sky/provision/aws/instance.py index 6abc18795ac..c4de8397c7e 100644 --- a/sky/provision/aws/instance.py +++ b/sky/provision/aws/instance.py @@ -257,9 +257,9 @@ def _get_head_instance_id(instances: List) -> Optional[str]: logger.warning( 'There are multiple head nodes in the cluster ' f'(current head instance id: {head_instance_id}, ' - f'newly discovered id: {inst.id}). It is likely ' + f'newly discovered id: {inst.name}). It is likely ' f'that something goes wrong.') - head_instance_id = inst.id + head_instance_id = inst.name break return head_instance_id diff --git a/sky/provision/azure/instance.py b/sky/provision/azure/instance.py index 20b07cdfd37..c8c29dbf64c 100644 --- a/sky/provision/azure/instance.py +++ b/sky/provision/azure/instance.py @@ -429,8 +429,9 @@ def _create_instance_tag(target_instance, is_head: bool = True) -> str: head_instance_id = _create_instance_tag(instances_to_tag[0]) instances_to_tag = instances_to_tag[1:] else: - instances_to_tag = [inst for inst in instances_to_tag - if inst.name != head_instance_id] + instances_to_tag = [ + inst for inst in instances_to_tag if inst.name != head_instance_id + ] if instances_to_tag: # Tag the instances in case the old resumed instances are not correctly