This adds QuotaSupport to all the drivers that don't have it, and
also updates their tests so there is at least one test which exercises
the new tenant quota feature.
Since this is expected to work across all drivers/providers/etc, we
should start including at least rudimentary quota support in every
driver.
Change-Id: I891ade226ba588ecdda835b143b7897bb4425bd8
The launcher implements deletes using threads, and unlike with
launches, does not give drivers an opportunity to override that
and handle them without threads (as we want to do in the state
machine driver).
To correct this, we move the NodeDeleter class from the launcher
to driver utils, and add a new driver Provider method that returns
the NodeDeleter thread. This is added in the base Provider class
so all drivers get this behavior by default.
In the state machine driver, we override the method so that instead
of returning a thread, we start a state machine and add it to a list
of state machines that our internal state machine runner thread
should drive.
Change-Id: Iddb7ed23c741824b5727fe2d89c9ddbfc01cd7d7
When an instance is not found by AWS API during cleanup, this leads
to an infinite error loop because the execption raised is not catched
correctly
```
"2020-08-19 15:33:05,893 ERROR nodepool.NodeDeleter: Exception deleting instance i-xxxxxxxxxxxxxxxxx from XXXXXXXXXXXXXX:"
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/nodepool/launcher.py", line 78, in delete
manager.cleanupNode(node.external_id)
File "/usr/local/lib/python3.7/dist-packages/nodepool/driver/aws/provider.py", line 157, in cleanupNode
instance.terminate()
File "/usr/local/lib/python3.7/dist-packages/boto3/resources/factory.py", line 520, in do_action
response = action(self, *args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/boto3/resources/action.py", line 83, in __call__
response = getattr(parent.meta.client, operation_name)(**params)
File "/usr/local/lib/python3.7/dist-packages/botocore/client.py", line 357, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/local/lib/python3.7/dist-packages/botocore/client.py", line 661, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (InvalidInstanceID.NotFound) when calling the TerminateInstances operation: The instance ID 'i-xxxxxxxxxxxxxxxxx' does not exist
```
Change-Id: I776f2d32d7b07b665f90cb71e9dbc018775e1062
At the moment nodepools aws driver uses the label to set the instance
name in aws and fails to launch the instance if "Name" is supplied
as a tag.
This makes it possible to supply name as a tag.
Change-Id: I9585db8fe4b4ad6f5b588fb67a7201296c2fc954
When running nodepool against private cloud rooms it can be desirable
that the nodes don't get a public ip address. Let the user specify
this on pool level.
Change-Id: I3d636517837fd8a6593c12e4309372da5c062b06
Max-servers has been ignored up until now. This implements the basic
checks so that AWS users can limit the number of instances they launch.
Change-Id: I73296bde1cdde80c52b6b5b725f268a17562060d
The AWS term is instance-type, not flavor-name. Rename this while
we don't have a huge userbase.
While we're in there, rename a variable from image_name to image_id
since we use image_id everywhere else.
Change-Id: I1f7f16d2873982626d2434cf5ca1f6280adf739c
This change adds an experimental AWS driver. It lacks some of the deeper
features of the openstack driver, such as quota management and image
building, but is highly functional for running tests on a static AMI.
Note that the test base had to be refactored to allow fixtures to be
customized in a more flexible way.
Change-Id: I313f9da435dfeb35591e37ad0bec921c8b5bc2b5
Co-Authored-By: Tristan Cacqueray <tdecacqu@redhat.com>
Co-Authored-By: David Moreau-Simard <dmsimard@redhat.com>
Co-AUthored-By: Clint Byrum <clint@fewbar.com>