Add PreferSameShardOnResizeWeigher.#316
Conversation
ebe01f0 to
f0c83be
Compare
joker-at-work
left a comment
There was a problem hiding this comment.
Please rename to shard, as it doesn't allow to configure the aggregate and thus the more generic "PreferSameAggregate" is not telling the story correctly.
e0d116c to
89d5b25
Compare
89d5b25 to
3ed14b8
Compare
Done. Tested on qa-de-1. |
3ed14b8 to
996f266
Compare
There was a problem hiding this comment.
There's a test missing that actually tests the same shard part of the weigher. Please add an additional host to your tests that's in the same shard as one of the existing hosts. This host should have the same weight given by the weigher as the other host in that shard in every test.
I assume this test with then show a bug in your weigher, as the weigher returns 0.0 if the instance is not on the currently-checked host through the first if.
There was a problem hiding this comment.
Why does a new instance have _nova_check_type: ['resize'] set?
There was a problem hiding this comment.
just to tell that even if resize is triggered with new instance it wont work since instance is new and "source_host" is missing
There was a problem hiding this comment.
This is not clear from the code, as a new instance normally wouldn't have resize set. Please add a comment that explains why, so anybody reading the code later on can understand it.
996f266 to
db8fe1a
Compare
There was a problem hiding this comment.
Why do we need a set() here?
Why do we need the iterator here instead of directly using host_shard_aggr.host?
Wouldn't if instance_host in host_shard_aggr.hosts: do the same in just one line with the same readability?
There was a problem hiding this comment.
This is not clear from the code, as a new instance normally wouldn't have resize set. Please add a comment that explains why, so anybody reading the code later on can understand it.
nova/tests/unit/scheduler/weights/test_weights_resize_same_shard.py
Outdated
Show resolved
Hide resolved
This filter enable to select same host-aggregate/shard/VC for instance resize because it could take more time to migrate the volumes over other shards.
db8fe1a to
fd4c33b
Compare
This filter enable to select same host-aggregate/shard/VC for instance
resize because it could take more time to migrate the volumes over other
shards.