Skip to content

Conversation

@r4victor
Copy link
Collaborator

@r4victor r4victor commented Feb 13, 2025

Closes #2278

This PR:

  • Adds Volume.attachments – the list of instances that the volume is attached to with attachment data.
  • Deprecates Volume.attachment_data in favor of Volume.attachments[n].attachment_data.
  • Replaces volumes<->instances many-to-many relationship with a many-to-one one-to-many relationship via an association object: basically extends volumes_attachments table with attachment_data column and replaces the implicit many-to-many via a secondary volumes_attachments with explicit relationship with volumes_attachments. This is necessary since attachment_data should belong to attachment and not to volume as before. A preliminary for multi-attach volumes with attachment data.
  • Adds ATTACHED column to the dstack volume -v output with fleet names the volume is attached to. Currently instance nums are not showed to keep output concise but they can be added if requested.
✗ dstack volume -v
 NAME             BACKEND  REGION             STATUS  ATTACHED  CREATED     ERROR 
 my-volume        aws      eu-west-1          active  my-dev    5 days ago        
                           (eu-west-1a)                                           
 my-gcp-volume-2  gcp      europe-west4       active  -         5 days ago        
                           (europe-west4-c)                                       

@r4victor r4victor marked this pull request as ready for review February 14, 2025 06:26
@r4victor r4victor requested a review from un-def February 14, 2025 06:26
@r4victor r4victor merged commit c4ddee1 into master Feb 14, 2025
24 checks passed
@r4victor r4victor deleted the issue_2278_volume_attachments branch February 14, 2025 10:40
pranitnaik43 pushed a commit to bahaal-tech/dstack that referenced this pull request Mar 4, 2025
* Add Volume.attachments

* Move attachment_data to volumes_attachments

* Show attachments in dstack volume list

* Rebase migrations
pranitnaik43 pushed a commit to bahaal-tech/dstack that referenced this pull request Mar 5, 2025
* Add Volume.attachments

* Move attachment_data to volumes_attachments

* Show attachments in dstack volume list

* Rebase migrations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make volume attachment info available in the API and CLI

3 participants