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

DataSourceAzure: fix bug where reported ready marker file is being written before report ready in preprovisioning #590

Merged

Conversation

johnsonshi
Copy link
Contributor

@johnsonshi johnsonshi commented Oct 1, 2020

Proposed Commit Message

DataSourceAzure: Write reported ready marker file after report ready in preprovisioning

DataSourceAzure previously writes the preprovisioning
reported ready marker file before it goes through the
report ready workflow. On certain VM instances, the
marker file is successfully written but then reporting
ready fails.

Upon rare VM reboots by the platform, cloud-init sees
that the report ready marker file already exists.
The existence of this marker file tells cloud-init
not to report ready again (because it mistakenly
assumes that it already reported ready in
preprovisioning).

In this scenario, cloud-init instead erroneously
takes the reprovisioning workflow instead of
reporting ready again.

Additional Context

Additional context is already in the proposed commit message.

Test Steps

  • Create an Azure VM from the latest Ubuntu 18.04 LTS image.
  • Apply this PR's patch.
  • Capture the Azure VM into a custom image.
  • Successful deployment from this captured custom image.

Checklist:

  • My code follows the process laid out in the documentation
  • I have updated or added any unit tests accordingly
  • I have updated or added any documentation accordingly

@johnsonshi
Copy link
Contributor Author

@anhvoms for awareness

@johnsonshi johnsonshi changed the title Azure fix bug reported ready marker file DataSourceAzure: fix bug where reported ready marker file is being written before report ready in preprovisioning Oct 1, 2020
Copy link
Collaborator

@OddBloke OddBloke 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 good, thanks! A few style/logging Qs inline.

tests/unittests/test_datasource/test_azure.py Outdated Show resolved Hide resolved
tests/unittests/test_datasource/test_azure.py Outdated Show resolved Hide resolved
cloudinit/sources/DataSourceAzure.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@OddBloke OddBloke left a comment

Choose a reason for hiding this comment

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

Thanks Johnson, this looks good to me. I particularly appreciate the clear and complete testing code, it made it much easier to determine whether or not you had modified behaviour intentionally!

tests/unittests/test_datasource/test_azure.py Show resolved Hide resolved
@OddBloke OddBloke merged commit 8766784 into canonical:master Oct 16, 2020
@johnsonshi johnsonshi deleted the azure-fix-bug-reported-ready-marker-file branch October 16, 2020 17:08
This was referenced May 12, 2023
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.

None yet

2 participants