-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add undeploy commands #61
Conversation
4883df3
to
d276687
Compare
esiclient/v1/orchestrator/cluster.py
Outdated
"""Undeploy a cluster from ESI nodes""" | ||
|
||
log = logging.getLogger(__name__ + ".Undeploy") | ||
REQUIRED_FIELDS = ['nodes', 'private_network_name', 'api_vip', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think REQUIRED_FIELDS is not used to check fields in config file in this class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good point - removed!
if len(non_uuid_node_configs) > 0: | ||
print("* %s node configs were skipped, as they do not" | ||
" specify specific nodes" % len(non_uuid_node_configs)) | ||
print(" * these nodes and ports will have to be removed" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can user keep track of these unspecified nodes? Should we provide detailed instructions here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They'll just have to use existing CLI commands; there's no real good way to do this except openstack baremetal node list
for node in node_uuids: | ||
print(" * %s" % node) | ||
ironic_client.node.set_provision_state(node, 'deleted') | ||
print(" * waiting for nodes to start undeploy before" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will you get an error if deleting a port while a node is still under deleting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope - but it takes ~10 seconds for Ironic to detach the port itself, so I figure there's no harm in waiting!
These undeploy commands allow users to cleanup orchestrated clusters.
@DanNiESh thanks for your comments! Answers in-line. Longer-term, I'm hoping to implement some changes to add some cluster metadata so that removing resources should be much easier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks!
These undeploy commands allow users to cleanup orchestrated clusters.