Describe:
Cannot dispatch VM to any Host. Possible reasons: Not enough capacity in Host or System DS, dispatch limit reached, or limit of free leases reached.
Front-end can ssh to kvm-node and itself without encryption.
Versions of the related components and OS:
OS:Ubuntu 20.04.6 LTS
Front-end 6.6
KVM Node: libvirtd (libvirt) 6.0.0
VMs_template:
CPU = "4"
DISK = [
IMAGE = "Windows2016-CDROM",
IMAGE_UNAME = "oneadmin" ]
DISK = [
DEV_PREFIX = "vd",
IMAGE = "windows2016-OS",
IMAGE_UNAME = "oneadmin" ]
GRAPHICS = [
LISTEN = "0.0.0.0",
TYPE = "VNC" ]
INPUT = [
BUS = "usb",
TYPE = "tablet" ]
MEMORY = "8192"
MEMORY_UNIT_COST = "MB"
NIC = [
NETWORK = "net-bjxd",
NETWORK_UNAME = "oneadmin",
SECURITY_GROUPS = "0" ]
NIC_DEFAULT = [
MODEL = "virtio" ]
OS = [
BOOT = "disk0" ]
VCPU = "4"
When the VM is instantiated, it’s instance template will get several attributes defining the placement policy that the scheduler will have to process in order to select an adequate host and system datastore for the VM.
These attributes are expressions that get evaluated and the message
Cannot dispatch VM to any Host. Possible reasons: Not enough capacity in Host or System DS, dispatch limit reached, or limit of free leases reached.
means that no resource was compatible with the whole expression. In order to figure out why
increase the debugging level to 5 in sched.conf
restart the scheduler
try to reproduce the problem again
You should know get more informative logs about the problem
You should get more information about the decision process further on the logfile. When a VM is instantiated, there will be a bunch of automatic scheduling requirements generated for such VM.
That expression is then evaluated according to the HOST attributes.
With level 5 you’ll get the result of the expression evaluation for each host in the host pool until a suitable host is found. Something like this, for example
Mon Jul 26 14:13:25 2021 [Z0][SCHED][D]: Setting VM groups placement constraints. Total time: 0.00s
Mon Jul 26 14:13:25 2021 [Z0][SCHED][D]: Host 30 discarded for VM 224. Not enough memory: 9345024/8149924
Mon Jul 26 14:13:25 2021 [Z0][SCHED][D]: Host 31 discarded for VM 224. Not enough memory: 9345024/8149900
Mon Jul 26 14:13:26 2021 [Z0][SCHED][D]: Match-making results for VM 224:
Cannot schedule VM, there is no suitable host.
or
Mon Jul 26 14:16:42 2021 [Z0][SCHED][D]: Host 30 discarded for VM 225. It does not fulfill SCHED_REQUIREMENTS: (CLUSTER_ID = 0 | CLUSTER_ID = 122) & !(PUBLIC_CLOUD = YES) & !(PIN_POLICY = PINNED) & ( HYPERVISOR!="vcenter" & QOS = GOLD )
Mon Jul 26 14:16:42 2021 [Z0][SCHED][D]: Host 31 discarded for VM 225. It does not fulfill SCHED_REQUIREMENTS: (CLUSTER_ID = 0 | CLUSTER_ID = 122) & !(PUBLIC_CLOUD = YES) & !(PIN_POLICY = PINNED) & ( HYPERVISOR!="vcenter" & QOS = GOLD )
Mon Jul 26 14:16:42 2021 [Z0][SCHED][D]: Match-making results for VM 225:
Cannot schedule VM, there is no suitable host.
onehost list
ID NAME CLUSTER TVM ALLOCATED_CPU ALLOCATED_MEM STAT
0 bjxd-ap-10-16-16-12 default 0 0 / 6400 (0%) 0K / 62.5G (0%) on
root@bjxd-ap-10-16-16-11:/etc/one# ID NAME CLUSTER TVM AL
I don’t know how to troubleshoot this problem, provided the configuration file for sched.conf and the information for the onehost list.
Is it possible to provide a sched.conf and template that can be instantiated by normal templates for debugging? Thank you very much.
As mentioned before, your sched.log should contain more information about the decision making process of the scheduler based on the VMs on PENDING state + their requirements vs the infrastructure available. Your log contained the initial information (detected VMs, detected hosts and datastores) it should have been populated with more information like the example shown.
Are you not getting any more logging information ?
In any case you can also manually figure out the problems by checking out the VM instance SCHED_REQUIREMENTS, SCHED_DS_REQUIREMENTS and AUTOMATIC_REQUIREMENTS attributes on the VM template. Then match those vs what the host attributes have. The logging approach mentioned before helps with showcasing this expression evaluation process from the scheduler perspective.
The virtual machine has been successfully instantiated, the use of the new version and the old version of the function has changed greatly, did not carefully look for, thank you very much for your help, best wishes.