Adds support for cold migration to drain script#93
Adds support for cold migration to drain script#93jovial wants to merge 4 commits intostackhpc/xenafrom
Conversation
43af6af to
18ec478
Compare
| venv: "{{ virtualenv_path }}/openstack" | ||
| live_migration_fatal: true | ||
| nova_compute_migration_fatal: true | ||
| tasks: |
There was a problem hiding this comment.
Would it make sense to put this in a main.yml, using include_tasks instead?
| virtualenv: "{{ nova_compute_drain_venv }}" | ||
| name: | ||
| - python-openstackclient | ||
|
|
| pip: | ||
| virtualenv: "{{ nova_compute_drain_venv }}" | ||
| name: | ||
| - python-openstackclient |
There was a problem hiding this comment.
Should we pin it, or use upper constraints? (as was done before)
There was a problem hiding this comment.
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.
| - include_role: | ||
| name: nova-compute-drain | ||
| tasks_from: setup.yml | ||
| run_once: true |
| ansible_host: "{{ hostvars[nova_compute_drain_delegate_host].ansible_host }}" | ||
| register: result | ||
| failed_when: | ||
| - result is failed |
There was a problem hiding this comment.
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.
Does it need delegate_to?
There was a problem hiding this comment.
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.
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.
It's a bit odd having this loop variable without a loop in this file.
| virtualenv: "{{ nova_compute_drain_venv }}" | ||
| name: | ||
| - python-openstackclient | ||
|
|
| register: instances | ||
| environment: "{{ openstack_auth_env }}" | ||
| vars: | ||
| ansible_host: "{{ hostvars[nova_compute_drain_delegate_host].ansible_host }}" |
There was a problem hiding this comment.
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.
| server list --host {{ ansible_facts.fqdn }} | |
| server list --host {{ ansible_facts.nodename }} |
There was a problem hiding this comment.
On the cloud I was testing on their was some funkiness around the compute host names. nodenmae is the correct value to use.
| venv: "{{ virtualenv_path }}/openstack" | ||
| live_migration_fatal: true | ||
| nova_compute_migration_fatal: true | ||
| tasks: |
|
Awaiting testing after refactoring |
|
Is this ready for another review? |
markgoddard
left a comment
There was a problem hiding this comment.
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. |
|
@jovial do you want to add to this or can I close it? |
Lets close and re-propose to openstack-ops. |
No description provided.