Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Azure compute driver to allow adding maximum number of disks when LUN is unspecified #1372

Merged
merged 1 commit into from Nov 22, 2019

Conversation

palashgandhi
Copy link
Contributor

@palashgandhi palashgandhi commented Nov 19, 2019

Fix Azure compute driver to allow adding maximum number of disks when LUN is unspecified

Description

When the LUN is unspecified in the attach_volume method, it finds the lowest available number to attach the volume to. The maximum number of data disks on an Azure VM is 64, which means LUNs can range from 0 to 63.

The current logic to figure out the LUN iterates from 0 to 62: for lun in range(0, 63). When you try to add the Nth device where N = maximum number of data disks allowed for that instance size, this code raises LibcloudError("No LUN available to attach new disk.").

This PR fixes this to ensure the last LUN is usable.

Status

  • done, ready for review

Checklist (tick everything that applies)

  • Code linting (required, can be done after the PR checks)
  • Documentation
  • Tests
  • ICLA (required for bigger changes)

@codecov-io
Copy link

codecov-io commented Nov 19, 2019

Codecov Report

Merging #1372 into trunk will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##            trunk    #1372      +/-   ##
==========================================
+ Coverage   86.34%   86.34%   +<.01%     
==========================================
  Files         372      372              
  Lines       76190    76198       +8     
  Branches     6974     6975       +1     
==========================================
+ Hits        65784    65792       +8     
  Misses       7609     7609              
  Partials     2797     2797
Impacted Files Coverage Δ
libcloud/test/compute/test_azure_arm.py 98.63% <100%> (+0.03%) ⬆️
libcloud/compute/drivers/azure_arm.py 55.92% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d65d776...202b86f. Read the comment docs.

@Kami
Copy link
Member

Kami commented Nov 20, 2019

Thanks for the contribution.

LGTM, but it would also be good to add a test case for this change.

/cc @c-w

@palashgandhi
Copy link
Contributor Author

@Kami I have extended test_attach_volume, although I think the travis build is hung again.

Copy link
Member

@c-w c-w left a comment

Choose a reason for hiding this comment

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

LGTM

@asfgit asfgit merged commit 202b86f into apache:trunk Nov 22, 2019
@Kami
Copy link
Member

Kami commented Nov 22, 2019

Merged.

Thanks for the contribution 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants