nova/roles/run-evacuate-hook/tasks/main.yaml
Lucas Alvares Gomes 20a7c98eff [OVN] Adapt the live-migration job scripts to work with OVN
There's no q-agt service in an OVN deployment.

Change-Id: Ia25c966c70542bcd02f5540b5b94896c17e49888
Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
2021-03-15 09:41:03 +00:00

93 lines
2.3 KiB
YAML

- name: Setup resources and mark the subnode as forced down
become: true
become_user: stack
shell: "/opt/stack/nova/roles/run-evacuate-hook/files/setup_evacuate_resources.sh"
environment:
SUBNODE_HOSTNAME: "{{ hostvars['compute1']['ansible_hostname'] }}"
- name: Fence subnode by stopping n-cpu
delegate_to: compute1
become: true
systemd:
name: devstack@n-cpu
state: stopped
- name: Check if q-agt exists
shell: sudo systemctl status devstack@q-agt
ignore_errors: true
register: qagtstatus
- name: Fence subnode by stopping q-agt (if exists)
delegate_to: compute1
become: true
systemd:
name: devstack@q-agt
state: stopped
when: qagtstatus.rc | int == 0
- name: Register running domains on subnode
delegate_to: compute1
become: true
virt:
command: list_vms
state: running
register: subnode_vms
- name: Destroy running domains on subnode
delegate_to: compute1
become: true
virt:
name: "{{ item }}"
state: destroyed
with_items: "{{ subnode_vms.list_vms }}"
- name: Stop libvirtd on "{{ inventory_hostname }}"
become: true
systemd:
name: "{{ item }}"
state: stopped
enabled: no
with_items:
- libvirtd.service
- libvirtd.socket
- libvirtd-admin.socket
- libvirtd-ro.socket
- virtlogd.service
- virtlogd-admin.socket
- virtlogd.socket
- virtlockd.service
- virtlockd-admin.socket
- virtlockd.socket
- name: Run negative evacuate tests
become: true
become_user: stack
shell: "/opt/stack/nova/roles/run-evacuate-hook/files/test_negative_evacuate.sh"
environment:
CONTROLLER_HOSTNAME: "{{ hostvars['controller']['ansible_hostname'] }}"
- name: Start libvirtd on "{{ inventory_hostname }}"
become: true
systemd:
name: "{{ item }}"
state: started
enabled: yes
with_items:
- libvirtd.service
- libvirtd.socket
- libvirtd-admin.socket
- libvirtd-ro.socket
- virtlogd.service
- virtlogd-admin.socket
- virtlogd.socket
- virtlockd.service
- virtlockd-admin.socket
- virtlockd.socket
- name: Run evacuate tests
become: true
become_user: stack
shell: "/opt/stack/nova/roles/run-evacuate-hook/files/test_evacuate.sh"
environment:
CONTROLLER_HOSTNAME: "{{ hostvars['controller']['ansible_hostname'] }}"