@@ -878,10 +878,10 @@ def inject_periodic_to_finish_resize(*args, **kwargs):
878
878
879
879
dst_host = server ['OS-EXT-SRV-ATTR:host' ]
880
880
881
- # This is a resource accounting bug, we should have 2 cpus pinned on
882
- # both computes. The source should have it due to the outbound
883
- # migration and the destination due to the instance running there
884
- self ._assert_pinned_cpus (src_host , 0 )
881
+ # we have 2 cpus pinned on both computes. The source should have it
882
+ # due to the outbound migration and the destination due to the
883
+ # instance running there
884
+ self ._assert_pinned_cpus (src_host , 2 )
885
885
self ._assert_pinned_cpus (dst_host , 2 )
886
886
887
887
return server , src_host , dst_host
@@ -893,30 +893,17 @@ def test_resize_confirm_bug_1944759(self):
893
893
# Now confirm the resize
894
894
post = {'confirmResize' : None }
895
895
896
- # FIXME(gibi): This is bug 1944759 where during resize, on the source
897
- # node the resize_instance() call at the point of calling finish_resize
898
- # overlaps with a update_available_resources() periodic job. This
899
- # causes that the periodic job will not track the migration nor the
900
- # instance and therefore freeing the resource allocation. Then when
901
- # later the resize is confirmed the confirm_resize on the source
902
- # compute also wants to free up the resources, the pinned CPUs, and it
903
- # fails as they are already freed.
904
- exc = self .assertRaises (
905
- client .OpenStackApiException ,
906
- self .api .post_server_action , server ['id' ], post
907
- )
908
- self .assertEqual (500 , exc .response .status_code )
909
- self .assertIn ('CPUUnpinningInvalid' , str (exc ))
896
+ self .api .post_server_action (server ['id' ], post )
897
+ self ._wait_for_state_change (server , 'ACTIVE' )
910
898
911
- # confirm failed above but the resource allocation reflects that the
912
- # VM is running on the dest node
899
+ # the resource allocation reflects that the VM is running on the dest
900
+ # node
913
901
self ._assert_pinned_cpus (src_host , 0 )
914
902
self ._assert_pinned_cpus (dst_host , 2 )
915
903
904
+ # and running periodics does not break it either
916
905
self ._run_periodics ()
917
906
918
- # and such allocation situation is stable so as a recovery the VM
919
- # can be reset-state to ACTIVE without problem.
920
907
self ._assert_pinned_cpus (src_host , 0 )
921
908
self ._assert_pinned_cpus (dst_host , 2 )
922
909
@@ -932,15 +919,14 @@ def test_resize_revert_bug_1944759(self):
932
919
self .api .post_server_action (server ['id' ], post )
933
920
self ._wait_for_state_change (server , 'ACTIVE' )
934
921
935
- # This is a resource accounting bug. After the revert the source host
936
- # should have 2 cpus pinned due to the instance.
937
- self ._assert_pinned_cpus (src_host , 0 )
922
+ # After the revert the source host should have 2 cpus pinned due to
923
+ # the instance.
924
+ self ._assert_pinned_cpus (src_host , 2 )
938
925
self ._assert_pinned_cpus (dst_host , 0 )
939
926
940
- # running the periodic job will fix the resource accounting
927
+ # running the periodic job will not break it either
941
928
self ._run_periodics ()
942
929
943
- # this is now correct
944
930
self ._assert_pinned_cpus (src_host , 2 )
945
931
self ._assert_pinned_cpus (dst_host , 0 )
946
932
0 commit comments