Skip to content
This repository was archived by the owner on Oct 29, 2019. It is now read-only.

Support for cloud node removal#700

Open
jgleissner wants to merge 4 commits intoSUSE:masterfrom
jgleissner:jgleissner-remove-cloud-node
Open

Support for cloud node removal#700
jgleissner wants to merge 4 commits intoSUSE:masterfrom
jgleissner:jgleissner-remove-cloud-node

Conversation

@jgleissner
Copy link
Copy Markdown
Contributor

This adds support for removing cluster nodes in the public cloud. It uses salt-cloud to terminate the instance associated with the given minion, and uses a salt event processor to react on the salt-cloud destroyed event to remove the minion from the database.

This fixes https://bugzilla.suse.com/show_bug.cgi?id=1117152.

Use salt-cloud to terminate an instance when a minion is to be removed.
Added an event handler for cloud specific events; currently only used when an
instance is terminated, to remove the associated minion from the database.
This reverts commit 377e4fe. Node removal
is now supported in Public Clouds.
@jgleissner
Copy link
Copy Markdown
Contributor Author

jgleissner commented Nov 28, 2018

This requires SUSE/caasp-container-manifests#208 to work properly.

@flavio flavio requested review from ereslibre and mjura November 29, 2018 07:48
Copy link
Copy Markdown
Member

@flavio flavio left a comment

Choose a reason for hiding this comment

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

I didn't test the code with these changes. I'm not sure our CI has automated tests in place simulating node removal, that's something we should test to ensure no regression is introduced.

data: { client: "local_async",
tgt: "admin",
fun: "cloud.destroy",
arg: [ minion_id ] })
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I looked at the salt documentation and it's not clear to me whether this API call is going to drop the minion key as well.

I wonder if we shouldn't always execute the other branch of this if/else statement.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

cloud.destroy does remove the minion key.

fun: "key.delete",
match: minion_id })
end
JSON.parse(res.body)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This changed from parsing the res.code to parsing the whole body of the response. Doesn't it have side effects in other parts of the code?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think the return code is used at the moment, and actually even couldn't, as the existing code JSON.parse(res.code) throws an exception since res.code is not JSON (see also https://bugzilla.suse.com/show_bug.cgi?id=1117152).

@MalloZup
Copy link
Copy Markdown
Contributor

This GitHub PR is unactive since 30. Is this GitHub PR still needed? Please close or update it accordingly.
This reminder is autogenerated by https://github.com/MalloZup/blacktango

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants