Azure / azure-init

A minimal provisioning agent designed for Azure Linux VMs.
MIT License
10 stars 11 forks source link

Get username either by IMDS or from a local OVF file #100

Closed dongsupark closed 2 months ago

dongsupark commented 3 months ago

Username can be obtained either via fetching instance metadata from IMDS or mounting a local device for OVF environment file. It should not fail immediately in a single failure, instead it should fall back to the other mechanism. So it is not a good idea to use ? for query() or get_environment().

Fixes https://github.com/Azure/azure-init/issues/99

dongsupark commented 2 months ago

Pushed commits to fix minor issues in the e2e tests script.

@SeanDougherty Could you please retest with this PR, to see if the issue of https://github.com/Azure/azure-init/issues/99 was gone?

I myself tried to run e2e tests with an Azure Linux gallery image, MicrosoftCBLMariner:azure-linux:azure-linux-gen2:3.20240510.01, and could not see the booting issue described. Though I am not sure if the current e2e test coverage would be enough for making the booting issue visible. (After booting I actually hit useradd issues as already known, which would be addressed in separate PRs.)

SeanDougherty commented 2 months ago

Pushed commits to fix minor issues in the e2e tests script.

@SeanDougherty Could you please retest with this PR, to see if the issue of #99 was gone?

I myself tried to run e2e tests with an Azure Linux gallery image, MicrosoftCBLMariner:azure-linux:azure-linux-gen2:3.20240510.01, and could not see the booting issue described. Though I am not sure if the current e2e test coverage would be enough for making the booting issue visible. (After booting I actually hit useradd issues as already known, which would be addressed in separate PRs.)

After retesting, I can confirm this has resolved the issue. Thank you Dongsu!

And, yes, as you had mentioned, there are other issues with useradd that are being addressed in this PR

LGTM