-
Notifications
You must be signed in to change notification settings - Fork 0
Adds nova-compute drain role #6
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
base: main
Are you sure you want to change the base?
Conversation
A utility role to migrate VMs from hypervisors.
e8dbebd
to
a874cf3
Compare
a874cf3
to
4e050f4
Compare
@@ -0,0 +1,4 @@ | |||
--- | |||
|
|||
nova_compute_drain_venv: "{{ virtualenv_path }}/openstack" |
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.
virtualenv_path is defined by kayobe. Should I add some default here? Something in the home directory maybe?
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.
Yeah that would be a better default
--- | ||
|
||
nova_compute_drain_venv: "{{ virtualenv_path }}/openstack" | ||
nova_compute_drain_delegate_host: "{{ groups['controllers'][0] }}" |
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.
Default doesn't make sense outside kayobe
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.
localhost as a reasonable 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.
Could use a little README
@@ -0,0 +1,4 @@ | |||
--- | |||
|
|||
nova_compute_drain_venv: "{{ virtualenv_path }}/openstack" |
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.
Yeah that would be a better default
--- | ||
|
||
nova_compute_drain_venv: "{{ virtualenv_path }}/openstack" | ||
nova_compute_drain_delegate_host: "{{ groups['controllers'][0] }}" |
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.
localhost as a reasonable default?
virtualenv: "{{ nova_compute_drain_venv }}" | ||
name: | ||
- python-openstackclient | ||
extra_args: "{% if pip_upper_constraints_file %}-c {{ pip_upper_constraints_file }}{% endif %}" |
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.
extra_args: "{% if pip_upper_constraints_file %}-c {{ pip_upper_constraints_file }}{% endif %}" | |
extra_args: "{% if nova_compute_drain_upper_constraints_file %}-c {{ nova_compute_drain_upper_constraints_file }}{% endif %}" |
And add to defaults?
- pip | ||
- setuptools | ||
state: latest | ||
virtualenv_command: /usr/bin/python3.6 -m venv |
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.
virtualenv_command: /usr/bin/python3.6 -m venv | |
virtualenv_command: /usr/bin/python3 -m venv |
vars: | ||
# NOTE: Without this, the delegate ansible_host variable will not | ||
# be respected when using delegate_to. | ||
ansible_host: "{{ hostvars[nova_compute_drain_delegate_host].ansible_host | default(nova_compute_drain_delegate_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.
run_once: true?
@@ -0,0 +1,17 @@ | |||
--- | |||
|
|||
- name: "Live migrate instance: {{ instance_uuid }}" # noqa no-changed-when |
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.
Add changed_when: true
, remove noqa
--- | ||
|
||
- block: | ||
- name: "Cold migrate instance: {{ instance_uuid }}" # noqa no-changed-when |
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.
Add changed_when: true
, remove noqa
retries: 10 | ||
delay: 30 | ||
|
||
- name: "Confirm resize: {{ instance_uuid }}" # noqa no-changed-when |
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.
Add changed_when: true
, remove noqa
vars: | ||
ansible_host: "{{ hostvars[nova_compute_drain_delegate_host].ansible_host }}" | ||
rescue: | ||
- meta: noop # noqa unnamed-task |
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 use a comment to explain why we're ignoring errors here.
@@ -0,0 +1,17 @@ | |||
--- | |||
|
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.
Do we need to ignore errors here, or is it an async API that does not generally fail?
A utility role to migrate VMs from hypervisors.