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

Add support for Azure gen2 VMs #1241

Merged
merged 3 commits into from
Jul 28, 2021

Conversation

sohankunkerkar
Copy link
Member

Fixes #1194

This patch adds support for Azure gen2 VMs in Ignition. For the safer side, this PR also handles a case where a bunch of block devices has the FSTYPE set to udf, and accordingly, pick the right device that has an ignition config.

With gen2 settings:

[    5.661976] systemd[1]: Finished Ignition (setup user config).
[    5.665860] systemd[1]: Starting Ignition (fetch-offline)...
[    5.672347] ignition[570]: Ignition v2.10.1-51-g3679fd11
[    5.676259] ignition[570]: Stage: fetch-offline
[    5.679908] ignition[570]: reading system config file "/usr/lib/ignition/base.d/00-core.ign"
[    5.684961] ignition[570]: reading system config file "/usr/lib/ignition/base.d/30-afterburn-sshkeys-core.ign"
[    5.690933] ignition[570]: reading system config file "/usr/lib/ignition/base.platform.d/azure/20-azure-nm-cloud-setup.ign"
[    5.697446] ignition[570]: no config URL provided
[    5.701096] ignition[570]: reading system config file "/usr/lib/ignition/user.ign"
[    5.706075] ignition[570]: no config at "/usr/lib/ignition/user.ign"
[    5.846085] ignition[575]: VM configured with gen2 settings
[    5.846251] ignition[570]: drive status: OK
[    5.856919] ignition[570]: op(1): [started]  mounting "/dev/sr0" at "/tmp/ignition-azure924173817"
[    5.875422] UDF-fs: INFO Mounting volume 'UDF Volume', timestamp 2021/07/01 00:00 (1000)
[    5.881968] ignition[570]: op(1): [finished] mounting "/dev/sr0" at "/tmp/ignition-azure924173817"
[    5.889419] systemd[1]: tmp-ignition\x2dazure924173817.mount: Deactivated successfully.

internal/exec/util/blkid.c Outdated Show resolved Hide resolved
internal/exec/util/blkid.go Outdated Show resolved Hide resolved
internal/exec/util/blkid.go Outdated Show resolved Hide resolved
internal/exec/util/blkid.go Outdated Show resolved Hide resolved
internal/exec/util/blkid.c Outdated Show resolved Hide resolved
internal/exec/util/blkid.c Outdated Show resolved Hide resolved
internal/exec/util/blkid.go Show resolved Hide resolved
internal/exec/util/blkid.h Outdated Show resolved Hide resolved
internal/providers/azure/azure.go Outdated Show resolved Hide resolved
internal/providers/azure/azure.go Outdated Show resolved Hide resolved
@sohankunkerkar sohankunkerkar force-pushed the azure-gen2-test branch 4 times, most recently from 8caf981 to bf0bb42 Compare July 9, 2021 23:19
@sohankunkerkar sohankunkerkar changed the title [WIP] Add support for Azure gen2 VMs Add support for Azure gen2 VMs Jul 9, 2021
internal/exec/util/blkid.c Outdated Show resolved Hide resolved
internal/exec/util/blkid.c Outdated Show resolved Hide resolved
internal/exec/util/blkid.c Outdated Show resolved Hide resolved
internal/exec/util/blkid.c Outdated Show resolved Hide resolved
internal/exec/util/blkid.c Outdated Show resolved Hide resolved
internal/providers/azure/azure.go Show resolved Hide resolved
internal/providers/azure/azure.go Show resolved Hide resolved
internal/providers/azure/azure.go Show resolved Hide resolved
internal/providers/azure/azure.go Outdated Show resolved Hide resolved
internal/providers/azure/azure.go Show resolved Hide resolved
@sohankunkerkar sohankunkerkar force-pushed the azure-gen2-test branch 7 times, most recently from c2a9a80 to 48c7949 Compare July 13, 2021 20:25
internal/exec/util/blkid.c Outdated Show resolved Hide resolved
internal/exec/util/blkid.c Outdated Show resolved Hide resolved
internal/exec/util/blkid.c Outdated Show resolved Hide resolved
internal/providers/azure/azure.go Outdated Show resolved Hide resolved
internal/providers/azure/azure.go Outdated Show resolved Hide resolved
internal/providers/azure/azure.go Outdated Show resolved Hide resolved
internal/providers/azure/azure.go Outdated Show resolved Hide resolved
internal/providers/azure/azure.go Show resolved Hide resolved
internal/providers/azure/azure.go Outdated Show resolved Hide resolved
internal/providers/azure/azure.go Outdated Show resolved Hide resolved
internal/exec/util/blkid.c Outdated Show resolved Hide resolved
internal/exec/util/blkid.c Outdated Show resolved Hide resolved
internal/providers/azure/azure.go Outdated Show resolved Hide resolved
internal/providers/azure/azure.go Outdated Show resolved Hide resolved
internal/providers/azure/azure.go Outdated Show resolved Hide resolved
internal/providers/azure/azure.go Outdated Show resolved Hide resolved
internal/providers/azure/azure.go Outdated Show resolved Hide resolved
internal/providers/azure/azure.go Outdated Show resolved Hide resolved
internal/providers/azure/azure.go Outdated Show resolved Hide resolved
internal/providers/azure/azure.go Outdated Show resolved Hide resolved
This change adds a blkid API to query block devices based on
the particular filesystem.
Copy link
Contributor

@bgilbert bgilbert left a comment

Choose a reason for hiding this comment

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

This looks better. 👍 The retry logic just needs a bit more adjustment.

internal/providers/azure/azure.go Outdated Show resolved Hide resolved
internal/providers/azure/azure.go Outdated Show resolved Hide resolved
@sohankunkerkar sohankunkerkar force-pushed the azure-gen2-test branch 3 times, most recently from f7be440 to 0d3b0a1 Compare July 23, 2021 17:17
Copy link
Contributor

@bgilbert bgilbert left a comment

Choose a reason for hiding this comment

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

👍 🎉

internal/providers/azure/azure.go Outdated Show resolved Hide resolved
Fixes coreos#1194
This change uses the same devicepath for gen1 and gen2 VMs because
they can't easily be distinguished at runtime.
Azure was the only user of `DiskByIDDir` and since we're using the
different approach to get the device details for azure instances,
this code is not required anymore.
@sohankunkerkar sohankunkerkar enabled auto-merge July 28, 2021 02:32
@sohankunkerkar sohankunkerkar merged commit 25d6d05 into coreos:main Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Azure generation 2 VMs
3 participants