-
Notifications
You must be signed in to change notification settings - Fork 21
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
Adds support for cold migration to drain script #93
base: stackhpc/xena
Are you sure you want to change the base?
Conversation
43af6af
to
18ec478
Compare
@@ -5,68 +5,39 @@ | |||
tags: | |||
- nova-compute-drain | |||
vars: | |||
venv: "{{ virtualenv_path }}/openstack" | |||
live_migration_fatal: true | |||
nova_compute_migration_fatal: true | |||
tasks: |
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.
Would it make sense to put this in a main.yml, using include_tasks instead?
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.
Good call.
virtualenv: "{{ nova_compute_drain_venv }}" | ||
name: | ||
- python-openstackclient | ||
|
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.
Confusing blank line?
pip: | ||
virtualenv: "{{ nova_compute_drain_venv }}" | ||
name: | ||
- python-openstackclient |
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.
Should we pin it, or use upper constraints? (as was done 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.
Good point, In train where I was testing this we couldn't use: --os-compute-api-version 2.25
. So I needed to install a later version IIRC. I'll re-add constraints.
extra_args: "{% if pip_upper_constraints_file %}-c {{ pip_upper_constraints_file }}{% endif %}" | ||
- include_role: | ||
name: nova-compute-drain | ||
tasks_from: setup.yml | ||
run_once: true |
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.
nit: not required
ansible_host: "{{ hostvars[nova_compute_drain_delegate_host].ansible_host }}" | ||
register: result | ||
failed_when: | ||
- result is failed |
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.
Does it need delegate_to?
register: instances | ||
environment: "{{ openstack_auth_env }}" | ||
vars: | ||
ansible_host: "{{ hostvars[nova_compute_drain_delegate_host].ansible_host }}" |
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.
Does it need delegate_to?
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.
Hmm, yep looks like it. Not sure, how that got lost! I'll re-add.
until: result.stdout == 'SHUTOFF' | ||
retries: 10 | ||
delay: 30 | ||
environment: "{{ openstack_auth_env }}" |
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.
Does it need delegate_to?
environment: "{{ openstack_auth_env }}" | ||
vars: | ||
ansible_host: "{{ hostvars[nova_compute_drain_delegate_host].ansible_host }}" | ||
instance_uuid: "{{ item.ID | default }}" |
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.
It's a bit odd having this loop variable without a loop in this file.
virtualenv: "{{ nova_compute_drain_venv }}" | ||
name: | ||
- python-openstackclient | ||
|
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.
register: instances | ||
environment: "{{ openstack_auth_env }}" | ||
vars: | ||
ansible_host: "{{ hostvars[nova_compute_drain_delegate_host].ansible_host }}" |
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.
Hmm, yep looks like it. Not sure, how that got lost! I'll re-add.
- name: Query instances | ||
command: > | ||
{{ nova_compute_drain_venv }}/bin/openstack | ||
server list --host {{ ansible_facts.fqdn }} |
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.
server list --host {{ ansible_facts.fqdn }} | |
server list --host {{ ansible_facts.nodename }} |
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.
On the cloud I was testing on their was some funkiness around the compute host names. nodenmae
is the correct value to use.
@@ -5,68 +5,39 @@ | |||
tags: | |||
- nova-compute-drain | |||
vars: | |||
venv: "{{ virtualenv_path }}/openstack" | |||
live_migration_fatal: true | |||
nova_compute_migration_fatal: true | |||
tasks: |
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.
Good call.
Awaiting testing after refactoring |
Is this ready for another review? |
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.
Could we add this role to https://github.com/stackhpc/ansible-collection-openstack-ops instead?
Sounds good. I may have an opportunity to test this soon so will propose something. |
No description provided.