December 2016
Intermediate to advanced
230 pages
4h 48m
English
Let's jump right into examining the role we created, named instance-migrate. The completed role and file, named main.yml, located in the instance-migrate/tasks directory, looks like this:
--- - name: Retrieve hypervisor list shell: openstack --os-cloud="{{ CLOUD_NAME }}" hypervisor list | awk 'NR > 3' | awk '$4 != "{{ desthype }}" { print $4 }' register: hypelist - name: Collect pre-migration instance details shell: openstack --os-cloud="{{ CLOUD_NAME }}" server list --name "{{ instance }}" --long | awk 'NR > 3' | awk '{ print $16 }' register: preinststat - name: Disable unselected hypervisors command: nova "{{ AUTH_S }}" service-disable "{{ item }}" nova-compute --reason '{{ migreason }}' with_items: "{{hypelist.stdout_lines}}" ...Read now
Unlock full access