When receiving a 404 from user_data attempts, cloud-init should not attempt to retry the errant user_data file as it is wasted effort. If the metadata service is already up, then any user-data should already be present, so a 404 at this time means that no user data exists so retries will not result in finding user-data at a later time.
Excerpt of logs indicating metadata is up but user-data does not exist:
2017-07-03 18:26:50,408 - __init__.py[DEBUG]: Seeing if we can get any data from <class 'cloudinit.sources.DataSourceOpenStack.DataSourceOpenStack'>
2017-07-03 18:26:50,558 - url_helper.py[DEBUG]: [0/1] open 'http://169.254.169.254/openstack' with {'timeout': 10.0, 'method': 'GET', 'allow_redirects': True, 'headers': {'User-Agent': 'Cloud-Init/0.7.9'}, 'url': 'http://169.254.169.254/openstack'} configuration
2017-07-03 18:26:51,434 - url_helper.py[DEBUG]: Read from http://169.254.169.254/openstack (200, 83b) after 1 attempts
...
2017-07-03 18:26:51,445 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/openstack/latest/user_data' with {'timeout': 10.0, 'method': 'GET', 'allow_redirects': True, 'headers': {'User-Agent': 'Cloud-Init/0.7.9'}, 'url': 'http://169.254.169.254/openstack/latest/user_data'} configuration
2017-07-03 18:26:52,514 - url_helper.py[DEBUG]: Please wait 1 seconds while we wait to try again
...2017-07-03 18:26:53,957 - url_helper.py[DEBUG]: Please wait 1 seconds while we wait to try again
2017-07-03 18:26:59,989 - openstack.py[DEBUG]: Failed reading optional path http://169.254.169.254/openstack/latest/user_data due to: 404 Client Error: Not Found for url: http://169.254.169.254/openstack/latest/user_data
When receiving a 404 from user_data attempts, cloud-init should not attempt to retry the errant user_data file as it is wasted effort. If the metadata service is already up, then any user-data should already be present, so a 404 at this time means that no user data exists so retries will not result in finding user-data at a later time.
Excerpt of logs indicating metadata is up but user-data does not exist:
2017-07-03 18:26:50,408 - __init__.py[DEBUG]: Seeing if we can get any data from <class 'cloudinit. sources. DataSourceOpenS tack.DataSource OpenStack' > py[DEBUG] : [0/1] open 'http:// 169.254. 169.254/ openstack' with {'timeout': 10.0, 'method': 'GET', 'allow_redirects': True, 'headers': {'User-Agent': 'Cloud- Init/0. 7.9'}, 'url': 'http:// 169.254. 169.254/ openstack'} configuration py[DEBUG] : Read from http:// 169.254. 169.254/ openstack (200, 83b) after 1 attempts py[DEBUG] : [0/6] open 'http:// 169.254. 169.254/ openstack/ latest/ user_data' with {'timeout': 10.0, 'method': 'GET', 'allow_redirects': True, 'headers': {'User-Agent': 'Cloud- Init/0. 7.9'}, 'url': 'http:// 169.254. 169.254/ openstack/ latest/ user_data'} configuration py[DEBUG] : Please wait 1 seconds while we wait to try again py[DEBUG] : Please wait 1 seconds while we wait to try again py[DEBUG] : Failed reading optional path http:// 169.254. 169.254/ openstack/ latest/ user_data due to: 404 Client Error: Not Found for url: http:// 169.254. 169.254/ openstack/ latest/ user_data
2017-07-03 18:26:50,558 - url_helper.
2017-07-03 18:26:51,434 - url_helper.
...
2017-07-03 18:26:51,445 - url_helper.
2017-07-03 18:26:52,514 - url_helper.
...2017-07-03 18:26:53,957 - url_helper.
2017-07-03 18:26:59,989 - openstack.