commit 938b499b1f427c3464602a28a63fe96056f1df25
Author: Matt Riedemann <email address hidden>
Date: Thu Dec 19 13:29:50 2019 -0500
Ensure source service is up before resizing/migrating
If the source compute service is down when a resize or
cold migrate is initiated the prep_resize cast from the
selected destination compute service to the source will
fail/hang. The API can validate the source compute service
is up or fail the operation with a 409 response if the
source service is down. Note that a host status of
"MAINTENANCE" means the service is up but disabled by
an administrator which is OK for resize/cold migrate.
The solution here works the validation into the
check_instance_host decorator which surprisingly isn't
used in more places where the source host is involved
like reboot, rebuild, snapshot, etc. This change just
handles the resize method but is done in such a way that
the check_instance_host decorator could be applied to
those other methods and perform the is-up check as well.
The decorator is made backward compatible by default.
Note that Instance._save_services is added because during
resize the Instance is updated and the services field
is set but not actually changed, but Instance.save()
handles object fields differently so we need to implement
the no-op _save_services method to avoid a failure.
NOTE(lyarwood): Conflicts as I8c96b337f32148f8f5899c9b87af331b1fa41424,
I711e56bcb4b72605253fa63be230a68e03e45b84,
I098f91d8c498e5a85266e193ad37c08aca4792b2 and
I19db48bd03855d1a1edbeff5adf15a28abcb5d92 are not in stable/train.
Change-Id: I85423c7bcacff3bc465c22686d0675529d211b59
Closes-Bug: #1856925
(cherry picked from commit ea2ea492a3d046d53d44039206fff69fe7e3ac61)
Reviewed: https:/ /review. opendev. org/701757 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=938b499b1f4 27c3464602a28a6 3fe96056f1df25
Committed: https:/
Submitter: Zuul
Branch: stable/train
commit 938b499b1f427c3 464602a28a63fe9 6056f1df25
Author: Matt Riedemann <email address hidden>
Date: Thu Dec 19 13:29:50 2019 -0500
Ensure source service is up before resizing/migrating
If the source compute service is down when a resize or
cold migrate is initiated the prep_resize cast from the
selected destination compute service to the source will
fail/hang. The API can validate the source compute service
is up or fail the operation with a 409 response if the
source service is down. Note that a host status of
"MAINTENANCE" means the service is up but disabled by
an administrator which is OK for resize/cold migrate.
The solution here works the validation into the instance_ host decorator which surprisingly isn't
check_
used in more places where the source host is involved
like reboot, rebuild, snapshot, etc. This change just
handles the resize method but is done in such a way that
the check_instance_host decorator could be applied to
those other methods and perform the is-up check as well.
The decorator is made backward compatible by default.
Note that Instance. _save_services is added because during
resize the Instance is updated and the services field
is set but not actually changed, but Instance.save()
handles object fields differently so we need to implement
the no-op _save_services method to avoid a failure.
Conflicts:
nova/api/ openstack/ compute/ migrate_ server. py
nova/api/ openstack/ compute/ servers. py
nova/tests/ unit/compute/ test_compute_ api.py
nova/tests/ functional/ wsgi/test_ servers. py
NOTE(lyarwood): Conflicts as I8c96b337f32148 f8f5899c9b87af3 31b1fa41424, b72605253fa63be 230a68e03e45b84 , 98e5a85266e193a d37c08aca4792b2 and 855d1a1edbeff5a df15a28abcb5d92 are not in stable/train.
I711e56bcb4
I098f91d8c4
I19db48bd03
Change-Id: I85423c7bcacff3 bc465c22686d067 5529d211b59 53d44039206fff6 9fe7e3ac61)
Closes-Bug: #1856925
(cherry picked from commit ea2ea492a3d046d