Add an image upload timeout to the openstack driver
Some uploads in opendev are taking hours. We used to wait 6 hours for this, but we ended up using the SDK default of 1 hour in recent versions. Since we're seeing so much disparity in time, make it user configurable. Remove the unused 6 hour constant. Change-Id: I9ca5fdbf7c66f176eb4f650fd287514708f46c16
This commit is contained in:
parent
3328e22d53
commit
3b434098c6
@ -205,6 +205,15 @@ Selecting the OpenStack driver adds the following options to the
|
||||
the cleanup interval has elapsed. This value can be reduced if the
|
||||
instance spawn time on the provider is reliably quicker.
|
||||
|
||||
.. attr:: image-upload-timeout
|
||||
:type: int seconds
|
||||
:default: 3600
|
||||
|
||||
How long to wait for an image upload. Note that in the case of a
|
||||
timeout, it may be possible to leak an image upload in a manner
|
||||
that Nodepool will be unable to detect and will require manual
|
||||
identification and cleanup.
|
||||
|
||||
.. attr:: diskimages
|
||||
:type: list
|
||||
|
||||
|
@ -39,9 +39,6 @@ from nodepool.version import get_version_string
|
||||
|
||||
MINS = 60
|
||||
HOURS = 60 * MINS
|
||||
# How long to wait for an image save
|
||||
IMAGE_TIMEOUT = 6 * HOURS
|
||||
|
||||
# How long to wait between checks for ZooKeeper connectivity if it disappears.
|
||||
SUSPEND_WAIT_TIME = 30
|
||||
|
||||
|
@ -566,6 +566,7 @@ class OpenStackAdapter(statemachine.Adapter):
|
||||
wait=True,
|
||||
md5=md5,
|
||||
sha256=sha256,
|
||||
timeout=self.provider.image_upload_timeout,
|
||||
**metadata)
|
||||
return image.id
|
||||
|
||||
|
@ -171,6 +171,7 @@ class OpenStackProviderConfig(ProviderConfig):
|
||||
self.rate = None
|
||||
self.boot_timeout = None
|
||||
self.launch_timeout = None
|
||||
self.image_upload_timeout = None
|
||||
self.clean_floating_ips = None
|
||||
self.port_cleanup_interval = None
|
||||
self.diskimages = {}
|
||||
@ -206,6 +207,8 @@ class OpenStackProviderConfig(ProviderConfig):
|
||||
self.boot_timeout = self.provider.get('boot-timeout', 60)
|
||||
self.launch_timeout = self.provider.get('launch-timeout', 3600)
|
||||
self.launch_retries = self.provider.get('launch-retries', 3)
|
||||
self.image_upload_timeout = self.provider.get(
|
||||
'image-upload-timeout', 3600)
|
||||
self.clean_floating_ips = self.provider.get('clean-floating-ips')
|
||||
self.port_cleanup_interval = self.provider.get(
|
||||
'port-cleanup-interval',
|
||||
@ -340,6 +343,7 @@ class OpenStackProviderConfig(ProviderConfig):
|
||||
'region-name': str,
|
||||
v.Required('cloud'): str,
|
||||
'boot-timeout': int,
|
||||
'image-upload-timeout': int,
|
||||
'launch-timeout': int,
|
||||
'launch-retries': int,
|
||||
'nodepool-id': str,
|
||||
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
An upload timeout can be configured on OpenStack providers for use
|
||||
in the case that image uploads to a provider take longer than the
|
||||
default of one hour.
|
Loading…
x
Reference in New Issue
Block a user