Skip to content

Conversation

@S0okJu
Copy link
Collaborator

@S0okJu S0okJu commented Oct 12, 2025

Overview

  • Add get_attachments tool

Key Changes

  • Add get_attachmets tools that return attachment list
  • Tests are updated and passing

Related Issues

Additional context

image

S0okJu and others added 6 commits September 25, 2025 17:33
- Add get_attachmet_id that return attchement details
- Tests are updated and passing
- Add get attachments tool
- Tests are updated and passing
- Add get attachments tool
- Tests are updated and passing
- Add get attachments tool
- Tests are updated and passing
@S0okJu S0okJu requested review from jja6312 and platanus-kr October 12, 2025 13:17
Copy link
Collaborator

@platanus-kr platanus-kr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재 구현하신 정도의 volume attachment 정보는 get_volume_details()get_servers() 수준에서 제공하는 정보로 커버가 되지 않나 생각이 듭니다.

attachment가 생각보다 넓은 범위의 정보를 제공하고 있는데 혹시 찾아보셨나요? 우연(?)하게도 OSSCA 활동하면서 테스트 코드 기여항목중에 하나가 volume attachment 기능이였어요.

간단하고 짧게 정리하자면 volume attachments는 인스턴스-볼륨 간 연결 정보 보다는 Manila, Ironic, Magnum 과 같이 볼륨 리소스를 사용하지만 볼륨 attach/detach에 직접 관여하지 않는 컴포넌트를 위한 관리 목적을 갖고 있습니다.
그리고 하방으로는 Cinder 백엔드인 NFS, SAN iSCSI, ceph에서 제공하는 볼륨을 관리하는 내용도 있습니다.

만약 '연결' 자체를 목록으로 보고 싶은거라면 괜찮은 것 같습니다.
다만 조회시 리소스 ID 로만 매핑을 반환하기 때문에 추후에 tools 최적화를 하면서 대외적으로 노출하는 정보 보다는 tools 내부에서 활용하는 기능으로 사용하면 좋을것 같다는 의견 남겨드립니다.

조사하면서 찾아본 정보인데 시간 나실때 한번 훑어보시면 좋을것 같아요. 정리 글은 여기 입니다.

@S0okJu
Copy link
Collaborator Author

S0okJu commented Oct 13, 2025

@platanus-kr
attachments를 단순히 서버 - 블록 스토리지 간의 연결 정보로만 이해했습니다.
그러나 의견을 들어보니 다양한 백엔드를 관리하는데도 사용되네요.

간단하고 짧게 정리하자면 volume attachments는 인스턴스-볼륨 간 연결 정보 보다는 Manila, Ironic, Magnum 과 같이 볼륨 리소스를 사용하지만 볼륨 attach/detach에 직접 관여하지 않는 컴포넌트를 위한 관리 목적을 갖고 있습니다. 그리고 하방으로는 Cinder 백엔드인 NFS, SAN iSCSI, ceph에서 제공하는 볼륨을 관리하는 내용도 있습니다.

만약 '연결' 자체를 목록으로 보고 싶은거라면 괜찮은 것 같습니다. 다만 리소스 ID 로만 매핑을 반환해서 추후에 tools 최적화를 하면서 대외적으로 노출하는 정보 보다는 tools 내부에서 활용하는 기능으로 사용하면 좋을것 같다는 의견 남겨드립니다.

말씀대로 단순히 연결 정보만 확인하고 싶다면 server tool 내에서 해결할 수 있을 것 같습니다.
attachment 기능을 제대로 제공하고 싶다면 nova를 거치지 않는 백엔드 관리에 대한 내용이 포함되어야겠네요.

현재로써는 다양한 백엔드에 대해 테스트하기 어려우므로 get_attachments 도구 제작은 보류하겠습니다.

좋은 정보 감사합니다.

@S0okJu
Copy link
Collaborator Author

S0okJu commented Oct 14, 2025

@platanus-kr
관련해서 Discussion에 올릴게요.

@S0okJu S0okJu added the feature Request for new feature or functionality enhancement label Oct 14, 2025
@S0okJu
Copy link
Collaborator Author

S0okJu commented Oct 14, 2025

@platanus-kr

이전에 보류한다고 말씀 드렸는데, get_attachments 도구를 제작하겠습니다.
이유는 다른 attachment 도구를 제작하는데 기준점을 잡기 어려워졌기 때문입니다.

다만 attachments 도구를 모두 제작한 이후부터 말씀주신대로
다양한 백엔드 관점이나 최적화 관점에서 생략하는 방법을 고안하겠습니다.

관련 Discussion은 닫겠습니다.

Copy link
Collaborator

@jja6312 jja6312 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코멘트를 달긴 했지만 생산성을 위해 Approve로 올립니다! 코멘트를 보시고 동의하시면 수정후 merge하셔도 좋을것같아요.

Get the list of attachments.
:param volume_id: The ID of the volume.
:param instance: The ID of the instance.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

제가 보기엔 거의 훌륭하게 작성해주셨는데요,

@platanus-kr 님 comment를 보고 생각해본 바로는
docstring에 instance에 대해 instance id 대신 공식문서의 표현을 차용하는것은어떨까요?("volume attachments like nova, glance, ironic etc." 라는 구절이 있으니.. 이러한 것들의 id다 정도로요.)

Copy link
Collaborator Author

@S0okJu S0okJu Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

일부 백엔드의 경우에는 instance id가 필요해요.
말씀해주신대로 다양한 백엔드를 지원하려면 백엔드 종류에 해당되는 인자를 추가하는 것이 좋을 것 같아요.
현재로써는 다양한 환경에서 테스트를 못하다보니 해당 기능은 보류하게 되었어요.

관련해서 이슈를 작성하겠습니다.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

음..인자를 추가하신다는게 제가 잘 이해가 안가는데요!
instance 인자가 nova뿐만아니라 다양한 block volume의 소비 주체를 포괄하고있다고 저는 이해했는데,
그 말인 즉슨 다양한 백엔드를 커버하기 위해서는 다른 인자를 추가하지 않아도 현재 코드가 이미 완성형이고, 나중에 추가되는 툴마다 테스트만 추가하면 되지않나 하는 의견이었습니다!
@S0okJu 님 의견은 get_attachments가 지금 구현하지 않은 백엔드툴들을 포괄하는 기능 구현이므로 테스트를 충분히 할 수 없으니 보류하겠다는 말씀이신거죠?!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jja6312 말씀이 맞습니다.
해당 응답값은 완성형이며, 응답값만으로도 다양한 백엔드를 지원할 수 있습니다.

말씀해주신 것처럼 instacne_id 를 다른 변수 이름으로 바꾼다면 사용자 측면에서 좋을 것 같습니다.
다만, 백엔드에 따라 어떤 형태로 반환되는지 직접 확인하고 변경하고 싶습니다.

@S0okJu 님 의견은 get_attachments가 지금 구현하지 않은 백엔드툴들을 포괄하는 기능 구현이므로 테스트를 충분히 할 수 없으니 보류하겠다는 말씀이신거죠?!

네, 직접 확인한 후에 이 사안에 대해서 반영하겠습니다.

@S0okJu
Copy link
Collaborator Author

S0okJu commented Oct 15, 2025

@platanus-kr
시간 있으실때 확인 부탁드려요.

@S0okJu S0okJu requested a review from platanus-kr October 15, 2025 07:11
Copy link
Collaborator

@platanus-kr platanus-kr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

알겠습니다 👍

Comment on lines 252 to 260
for attachment in conn.block_storage.attachments(**filter):
attachments.append(
AttachmentSummary(
id=attachment.id,
instance=attachment.instance,
volume_id=attachment.volume_id,
status=attachment.status,
)
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

반환 필드 중에 아래 3가지는 추가되면 좋을것 같습니다.

  • attach_mode
  • mountpoint
  • connection_info

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AttachmentSummary 대신 Attachment로 응답값을 반환해서 사용하도록 했습니다.

API 응답값을 기준으로 코드를 작성했는데, 실제로 sdk에서는 Attachment 객체로 반환되네요.

image

@S0okJu S0okJu merged commit 1b64f2b into develop Oct 16, 2025
6 checks passed
halucinor pushed a commit that referenced this pull request Oct 23, 2025
halucinor pushed a commit that referenced this pull request Oct 24, 2025
@S0okJu S0okJu linked an issue Oct 25, 2025 that may be closed by this pull request
5 tasks
@halucinor halucinor deleted the feat/volume-attachment branch October 30, 2025 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Request for new feature or functionality enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Add volume connection related tools to mcp

4 participants