Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

equinix-metal: recycle existing instances #268

Merged
merged 7 commits into from
Dec 17, 2021
Merged

Conversation

tormath1
Copy link
Contributor

@tormath1 tormath1 commented Dec 14, 2021

In this PR, we add the ability to mantle test to reuse existing Equinix Metal instances and to keep them into a pool of devices in the Flight lifecycle.


Closes: flatcar/Flatcar#551

  • Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update)

@tormath1 tormath1 changed the title equinix/metal: recycle existing instances [wip] equinix/metal: recycle existing instances Dec 14, 2021
platform/api/packet/api.go Outdated Show resolved Hide resolved
@tormath1 tormath1 changed the title [wip] equinix/metal: recycle existing instances equinix/metal: recycle existing instances Dec 16, 2021
@tormath1 tormath1 changed the title equinix/metal: recycle existing instances equinix-metal: recycle existing instances Dec 16, 2021
platform/api/packet/api.go Outdated Show resolved Hide resolved
@tormath1 tormath1 marked this pull request as ready for review December 16, 2021 18:10
Copy link
Member

@pothos pothos left a comment

Choose a reason for hiding this comment

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

Looks good now, didn't test myself ;)

@tormath1
Copy link
Contributor Author

tormath1 commented Dec 17, 2021

@pothos

I just started a final test:

--parallel=2 cl.basic kubeadm.v1.22.0.calico.base cl.internet kubeadm.v1.22.0.flannel.base

we should have max 6 devices created (the kubeadm tests create 3 machines each, the others just one each).

Result:

We got a maximum of 5 instances created and 3 instances have been recycled.

we keep a trace of opened SSH client in order to close them properly later.

Signed-off-by: Mathieu Tortuyaux <[email protected]>
we can now open, keep a trace and delete properly a SSH client.

When the instance is created, its SSH client will be stored and closed
when the device is marked as available.

Signed-off-by: Mathieu Tortuyaux <[email protected]>
This devicesPool will be used to keep the devices _after_ being used in
order to create a pool of available device to be picked-up later instead
of creating a new device.

Signed-off-by: Mathieu Tortuyaux <[email protected]>
before creating a device we check if there are some available devices
into a created pool of device.

if one device is available this one will be updated in place in order to
boot with a new PXE configuration to load fresh configuration without
destroying the server.

Signed-off-by: Mathieu Tortuyaux <[email protected]>
since the mach.Destroy only adds devices to the pool, we don't need to
rely on it to actually remove a device.

Signed-off-by: Mathieu Tortuyaux <[email protected]>
we now define CreateOrUpdateDevice.

Signed-off-by: Mathieu Tortuyaux <[email protected]>
Signed-off-by: Mathieu Tortuyaux <[email protected]>
@tormath1 tormath1 merged commit 54f6daa into flatcar-master Dec 17, 2021
@tormath1 tormath1 deleted the tormath1/em branch December 17, 2021 13:32
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.

[RFE] Re-use servers on Equinix Metal during tests to ease pressure on server recycle back-end
2 participants