server: reapply checkVmProfileAndHost to check guest os preference (#6000)

This commit is contained in:
Wei Zhou 2022-02-17 09:55:13 +01:00 committed by GitHub
parent e0a5df50ce
commit c543f5f546
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -424,14 +424,7 @@ StateListener<State, VirtualMachine.Event, VirtualMachine>, Configurable {
}
} else {
if (host.getStatus() == Status.Up) {
boolean hostTagsMatch = true;
if(offering.getHostTag() != null){
_hostDao.loadHostTags(host);
if (!(host.getHostTags() != null && host.getHostTags().contains(offering.getHostTag()))) {
hostTagsMatch = false;
}
}
if (hostTagsMatch) {
if (checkVmProfileAndHost(vmProfile, host)) {
long cluster_id = host.getClusterId();
ClusterDetailsVO cluster_detail_cpu = _clusterDetailsDao.findDetail(cluster_id,
"cpuOvercommitRatio");