Skip to content

Commit

Permalink
Add max number of volumes that can be attached to an instance
Browse files Browse the repository at this point in the history
  • Loading branch information
bertinatto committed May 3, 2019
1 parent e539e1b commit 0b8bf4c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pkg/driver/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ const (

// default file system type to be used when it is not provided
defaultFsType = FSTypeExt4

// maxVolumesPerNode is the maximum number of volumes that an AWS instance can have attached.
// More info at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/volume_limits.html
maxVolumesPerNode = 39
)

var (
Expand Down Expand Up @@ -316,6 +320,7 @@ func (d *nodeService) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoReque

return &csi.NodeGetInfoResponse{
NodeId: m.GetInstanceID(),
MaxVolumesPerNode: maxVolumesPerNode,
AccessibleTopology: topology,
}, nil
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/driver/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,8 @@ func TestNodeGetInfo(t *testing.T) {
awsDriver := newTestNodeService(mockMetadata, NewFakeMounter())

expResp := &csi.NodeGetInfoResponse{
NodeId: expInstanceId,
NodeId: expInstanceId,
MaxVolumesPerNode: maxVolumesPerNode,
AccessibleTopology: &csi.Topology{
Segments: map[string]string{TopologyKey: mockMetadata.GetAvailabilityZone()},
},
Expand Down

0 comments on commit 0b8bf4c

Please sign in to comment.