Skip to content

Add retries to DataSourceGCE.py when connecting to GCE#1005

Merged
blackboxsw merged 6 commits into
canonical:mainfrom
vteratipally:add-retries
Sep 21, 2021
Merged

Add retries to DataSourceGCE.py when connecting to GCE#1005
blackboxsw merged 6 commits into
canonical:mainfrom
vteratipally:add-retries

Conversation

@vteratipally
Copy link
Copy Markdown
Contributor

@vteratipally vteratipally commented Aug 31, 2021

Add retries to DataSourceGCE.py when connecting to GCE

summary: 

Add retries to DatasourceGCE when connecting to GCE. Sometimes when the trying to fetch the metadata, the cloud-init fails and the fallback datasource NoCloud is used which is not expected. So adding retries to ensure loading of the data source. 

Additional Context

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

Copy link
Copy Markdown
Collaborator

@blackboxsw blackboxsw left a comment

Choose a reason for hiding this comment

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

Thanks you for this submission @vteratipally. I've confirmed that you have signed the cloud-init Contributor Agreement.

I've provided a couple of comments about how we can best add this retry logic to GCE in a way that aligns with how other datasources instrument this setting in a more flexible way.

Please also add the following:

  1. your github username alphabetically in ./tools/.github-cla-signers
  2. unit test coverage of these changes if you can in tests/unittests/test_datasource/test_gce.py
  3. documentation update to doc/rtd/topics/datasources/gce.rst with a new section called
Configuration                                                                   
-------------  
The following configuration can be set for the datasource in system             
configuration (in `/etc/cloud/cloud.cfg` or `/etc/cloud/cloud.cfg.d/`).         
                                                                                
The settings that may be configured are:                                        
...

See either doc/rtd/topics/datasources/openstack.rst or doc/rtd/topics/datasources/ec2.rst for examples of the markdown in this section.

Comment thread cloudinit/sources/DataSourceGCE.py Outdated
@blackboxsw blackboxsw self-assigned this Sep 3, 2021
Copy link
Copy Markdown
Collaborator

@blackboxsw blackboxsw left a comment

Choose a reason for hiding this comment

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

Changes, docs and tests look good to me. will test this tomorrow and approve if no other concerns. Much thanks @vteratipally

Copy link
Copy Markdown
Collaborator

@blackboxsw blackboxsw left a comment

Choose a reason for hiding this comment

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

After long delay, finally got round to validating behavior on GCP. Thank you, thank you for this change and your patience.

@blackboxsw blackboxsw merged commit e27c307 into canonical:main Sep 21, 2021
@vteratipally
Copy link
Copy Markdown
Contributor Author

thank you @blackboxsw

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.

2 participants