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