Skip to content

Commit

Permalink
only delete image when termination happens
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaelvll committed Jun 24, 2023
1 parent deac524 commit 7230966
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sky/backends/cloud_vm_ray_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -3535,7 +3535,9 @@ def post_teardown_cleanup(self,
cluster_name=handle.cluster_name,
stdout=tpu_stdout,
stderr=tpu_stderr))
if handle.launched_resources.is_image_managed:
if handle.launched_resources.is_image_managed and terminate:
# Delete the image when terminating the cluster and the image is
# created by SkyPilot (--clone-disk-from)
logger.debug(f'Deleting image {handle.launched_resources.image_id}')
cluster_resources = handle.launched_resources
cluster_cloud = cluster_resources.cloud
Expand Down

0 comments on commit 7230966

Please sign in to comment.