get_data in DataSourceOpenStack.py can time out if metadata service is slow
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Medium
|
Unassigned | ||
cloud-init (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Xenial |
Fix Released
|
Medium
|
Unassigned | ||
Yakkety |
Fix Released
|
Medium
|
Unassigned |
Bug Description
=== Begin SRU Template ===
[Impact]
On heavily loaded openstack metadata services, cloud-init may hit a timeout
and not properly retry when waiting longer or retring would allow it to
succeed.
cloud-init contained a setting to configure this but it was not used in all
cases. The change here enabled usage of timeout and retry for.
[Test Case]
1. Launch an instance on openstack.
2. Verify inconsistent use of 'timeout' in /var/log/
$ grep http://
2017-03-03 16:51:23,824 - url_helper.
2017-03-03 16:51:24,384 - url_helper.
3. enable proposed, update, upgrade
4. clean
rm -Rf /var/lib/cloud /var/log/
5. reboot
6. re-check step 2, expect see 'timeout' is consistent.
[Regression Potential]
low chance for regression. Slower boot times but more reliable on a non-perform
ant metadata service.
=== End SRU Template ===
cloud-init sometimes times out and fails to fetch metadata in the OpenStack environment when the Controller node is under high workload.
The default timeout value is 5 seconds and it may be too small in some cases where the Controller node is too busy to respond to the metadata request from the instance in time.
There is a 'timeout' configuration setting, as in...
datasource:
OpenStack:
timeout: 30
...but this value is not used by the get_data method in cloudinit/
s = cls(sys_cfg, distro, paths)
if s.get_data():
Related branches
- Scott Moser: Needs Fixing
-
Diff: 92 lines (+16/-7)2 files modifiedcloudinit/sources/DataSourceOpenStack.py (+12/-3)
tests/unittests/test_datasource/test_openstack.py (+4/-4)
Changed in cloud-init: | |
importance: | Undecided → Medium |
status: | New → Fix Released |
Changed in cloud-init (Ubuntu): | |
status: | New → Confirmed |
status: | Confirmed → Fix Released |
importance: | Undecided → Medium |
Changed in cloud-init (Ubuntu Xenial): | |
status: | New → Confirmed |
Changed in cloud-init (Ubuntu Yakkety): | |
status: | New → Confirmed |
Changed in cloud-init (Ubuntu Xenial): | |
importance: | Undecided → Medium |
Changed in cloud-init (Ubuntu Yakkety): | |
importance: | Undecided → Medium |
Changed in cloud-init: | |
status: | Fix Released → Fix Committed |
description: | updated |
https:/ /code.launchpad .net/~larsks/ cloud-init/ +git/cloud- init/+merge/ 314912 has merged, which resolves this issue.