BUG: Convert disk size from MB to GB for Aquilon#49
Merged
Conversation
b6b567d to
7e36616
Compare
An update in NetBox has changed the disk size to be stored in MB instead of GB. This results in the code setting the disk size in Aquilon to be too large e.g. if a disk is 1024 MB in NetBox, the disk is set for the device as 1024 GB in Aquilon. Added a line to convert the disk size to GB.
Member
|
I've tested this against a few of out VMs with more complex disk layouts and was surprised to see disk sizes coming out smaller than before, sure enough the transition script in NetBox v4.1.0 multiplied existing values by 1000 rather than 1024. I'm not sure whether we should follow this example or not. |
Member
|
Damn. Looks like it's purposeful, NetBox defines GB as SI/1000 and GiB as EIC/1024: |
Netbox defines GB as SI/1000 and GiB as EIC/1024. Correcting formula for converting from MB to GB.
jrha
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An update in NetBox has changed the disk size to be stored in MB instead of GB since v4.1.0 (https://github.com/netbox-community/netbox/releases/tag/v4.1.0). This results in the code setting the disk size in Aquilon to be too large e.g. if a disk is 1024 MB in NetBox, the disk is set for the device as 1024 GB in Aquilon.
This PR converts virtual disk and machine disk sizes from MB to GB and should fix #48.
The test data has also been updated to reflect the change in how the disk size is stored.
Note: This PR needs to be tested before it can be merged