-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
after ffu all created vms resides on the same compute added playbooks to move back all vms to original compute Change-Id: I96f0238b06858533d17f551df2b50305dab5f7a1
- Loading branch information
eshulman2
committed
Dec 30, 2021
1 parent
9222bbe
commit 5f144a6
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
|
||
- name: Tempest deployment and execution | ||
hosts: "{{ tester | default('undercloud') }}" | ||
gather_facts: False | ||
tasks: | ||
|
||
- name: Read old vms locations | ||
command: cat /tmp/vms_locations | ||
delegate_to: hypervisor | ||
register: locations | ||
|
||
- name: Migrate instances back to place | ||
shell: | | ||
source /home/stack/overcloudrc ; | ||
openstack server migrate --live-migration \ | ||
--host "{{ item.split(':')[1] }}" --block-migration \ | ||
"{{ item.split(':')[0] }}" --wait | ||
loop: "{{ locations.stdout_lines }}" | ||
|
||
- name: Remove vms locations file | ||
file: | ||
state: absent | ||
path: /tmp/vms_locations | ||
delegate_to: hypervisor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
- name: Tempest deployment and execution | ||
hosts: "{{ tester | default('undercloud') }}" | ||
gather_facts: False | ||
tasks: | ||
|
||
- name: Collect info about deployed instances | ||
os_server_info: | ||
cloud: overcloud | ||
server: instance* | ||
filters: | ||
vm_state: active | ||
all_projects: yes | ||
register: result | ||
|
||
- name: Touch file for vm locations | ||
file: | ||
state: touch | ||
path: /tmp/vms_locations | ||
mode: '0664' | ||
delegate_to: hypervisor | ||
|
||
- name: save vm locations data to file | ||
lineinfile: | ||
path: /tmp/vms_locations | ||
line: "{{ item.id }}:{{ item.properties['OS-EXT-SRV-ATTR:host'] }}" | ||
owner: stack | ||
group: stack | ||
mode: '0644' | ||
loop: "{{ result.openstack_servers }}" | ||
delegate_to: hypervisor |