ISSUE TYPE
COMPONENT NAME
LibvirtStartCommandWrapper.java
CLOUDSTACK VERSION
CONFIGURATION
N/A
OS / ENVIRONMENT
N/A
SUMMARY
I found error in getFreeMemory() of https://github.com/apache/cloudstack/blob/4.11/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtStartCommandWrapper.java#L170
When I create a new VM we take a list of all VMs from libvirt via getFreeMemory(). After that we iterate by this list. If amount of VMs so large(or libvirt response longer than always) this may take some time. At that time one or more VMs, which has "Running" state can start stopping by another process(job) and not displayed in libvirt anymore. So it bring to exception with "libvirt.libvirtError: Domain not found: no domain with matching id 157124." message and we move on catch with wrong error message(Failed to get free memory).
STEPS TO REPRODUCE
1. Start one proces which will create VMs.
2. When we have 100(create more if not reproduce) VMs on host should start another process which will destroy VMs.
3. Still some time we will see error message "Failed to get free memory" in logs with free memory resources on host.
management-server.log https://yadi.sk/d/wzyZVeTKS2kkDQ
EXPECTED RESULTS
Correct creation of VM without exceptions.
ACTUAL RESULTS
INFO message "Failed to get free memory" and ERROR with InsufficientCapacityEception.
ISSUE TYPE
COMPONENT NAME
CLOUDSTACK VERSION
CONFIGURATION
N/A
OS / ENVIRONMENT
N/A
SUMMARY
I found error in getFreeMemory() of https://github.com/apache/cloudstack/blob/4.11/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtStartCommandWrapper.java#L170
When I create a new VM we take a list of all VMs from libvirt via getFreeMemory(). After that we iterate by this list. If amount of VMs so large(or libvirt response longer than always) this may take some time. At that time one or more VMs, which has "Running" state can start stopping by another process(job) and not displayed in libvirt anymore. So it bring to exception with "libvirt.libvirtError: Domain not found: no domain with matching id 157124." message and we move on catch with wrong error message(Failed to get free memory).
STEPS TO REPRODUCE
management-server.log https://yadi.sk/d/wzyZVeTKS2kkDQ
EXPECTED RESULTS
ACTUAL RESULTS