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
Add support for Gen2 VM resource disks #1654
Add support for Gen2 VM resource disks #1654
Conversation
@jasonzio can I get a review as well? Thanks! |
Codecov Report
@@ Coverage Diff @@
## develop #1654 +/- ##
===========================================
+ Coverage 66.86% 67.05% +0.18%
===========================================
Files 78 78
Lines 11242 11272 +30
Branches 1572 1576 +4
===========================================
+ Hits 7517 7558 +41
+ Misses 3402 3383 -19
- Partials 323 331 +8
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionally adequate, but some refactoring, as described, would improve long-term maintainability.
@trstringer - FYI - The Py2 builds are failing. Could you please take a look? |
@vrdmr Yep I'll check that out and get it fixed up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More nits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now.
@anhvoms could I get a final review on this? |
yield vmbus, guid | ||
|
||
@staticmethod | ||
def search_for_resource_disk(gen1_device_prefix, gen2_device_id): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def search_for_resource_disk(gen1_device_prefix, gen2_device_id): [](start = 4, length = 65)
Is there an easy way to detect if this is a Gen2VM, if so would it make more sense to refactor this into a flow where we detect whether this is a Gen2 or Gen1, if it's Gen2 there is a different search_for_resource_disk function (sort of like function pointers, one for Gen1, one for Gen2).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, I'll see if I can find that answer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure you still need it, just for your reference.
if [ -d /sys/firmware/efi/ ]; then
os_GENERATION=2
else
os_GENERATION=1
fi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@narrieta let me know if you anything else from my end to get this PR merged in. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; running automation, will merge after that.
Automation OK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3, 3 of 3 files at r5, 1 of 1 files at r9.
Reviewable status: all files reviewed, 9 unresolved discussions (waiting on @anhvoms, @jasonzio, @larohra, @pgombar, and @trstringer)
Description
The current implementation for resource disks expects (requires) that the device ID has a prefix of
00000000-0001
. For Gen2 VMs, this is not the case. They have a device ID off8b3781a-1e82-4818-a1c3-63d806ec15bb
. Because of this, prior to this PR waagent does not find the resource disk and therefore doesn't mount it.Here is the output of
lsblk
:As you can see, there is no mountpoint for
sdb1
.This PR fixes that by looking first for a Gen1 VM resource disk device, and then trying a Gen2 VM resource disk device.
PR information
Quality of Code and Contribution Guidelines
This change is