server: double check host capacity when start/migrate a vm#3728
Conversation
…city in Starting/Migrating a vm
DaanHoogland
left a comment
There was a problem hiding this comment.
I am usually very picky on the subject of logging and stacktraces, and I made one remark on it, but looking at the whole change I think the logging will be enough for maintainer and?or operator. A little comment in this respect wouldn't hurt.
| } catch (final NoTransitionException e3) { | ||
| s_logger.warn(e3.getMessage()); | ||
| } | ||
| throw new CloudRuntimeException("Migration cancelled because " + e2.getMessage()); |
There was a problem hiding this comment.
can we add the cause or log its stack-trace before abandoning it here?
|
build failed, wiped the env. |
|
Trillian test result (tid-697)
|
|
@andrijapanicsb this one looks good. Want to have a look? (cc @borisstoyanov ) |
|
@rhtyd @nvazquez @wido @GabrielBrascher is this alright? |
When start a vm or migrate a vm (away from a host in host maintenance), cloudstack will check capacity of all hosts and choose one. If there are hundreds of hosts on the platform, it will take some seconds. When cloudstack choose a host and start/migrate vm to it, the resource consumption of the host might have been changed. This normally happens when we start/migrate multiple vms. It would be better to double check the host capacity when start vm on a host. This PR includes the fix for cpucore capacity when start/migrate a vm.
Description
When start a vm or migrate a vm (away from a host in host maintenance), cloudstack will check capacity of all hosts and choose one. If there are hundreds of hosts on the platform, it will take some seconds. When cloudstack choose a host and start/migrate vm to it, the resource consumption of the host might have been changed. This normally happens when we start/migrate multiple vms.
It would be better to double check the host capacity when start vm on a host.
This PR includes the fix for cpucore capacity when start/migrate a vm.
Types of changes
Screenshots (if appropriate):
How Has This Been Tested?
start multiple vms on a host
put a host to maintenance so multiple vms will be migrated at same time
check the resource count of cpucore, all looks good.