mirror of https://github.com/apache/cloudstack.git
Bug-ID:CS-27160: Restore VM (Re-install VM) with enable.storage.migration set to false fails, later fails to start up VM too
Reviewed-By: Anthony Changes: - Try to reuse the storage pools for READY disks if the pool fits the deployment plan - Try to use the last_host if it has free capacity but no reserved capacity Signed-off-by: Maneesha.P <maneesha.papireddygari@citrix.com>
This commit is contained in:
parent
3df847dfbb
commit
a3e87cfa95
|
|
@ -400,10 +400,21 @@ StateListener<State, VirtualMachine.Event, VirtualMachine> {
|
|||
"memoryOvercommitRatio");
|
||||
Float cpuOvercommitRatio = Float.parseFloat(cluster_detail_cpu.getValue());
|
||||
Float memoryOvercommitRatio = Float.parseFloat(cluster_detail_ram.getValue());
|
||||
if (_capacityMgr.checkIfHostHasCapacity(host.getId(), cpu_requested, ram_requested, true,
|
||||
cpuOvercommitRatio, memoryOvercommitRatio, true)
|
||||
&& _capacityMgr.checkIfHostHasCpuCapability(host.getId(), offering.getCpu(),
|
||||
offering.getSpeed())) {
|
||||
|
||||
boolean hostHasCpuCapability, hostHasCapacity = false;
|
||||
hostHasCpuCapability = _capacityMgr.checkIfHostHasCpuCapability(host.getId(), offering.getCpu(), offering.getSpeed());
|
||||
|
||||
if (hostHasCpuCapability) {
|
||||
// first check from reserved capacity
|
||||
hostHasCapacity = _capacityMgr.checkIfHostHasCapacity(host.getId(), cpu_requested, ram_requested, true, cpuOvercommitRatio, memoryOvercommitRatio, true);
|
||||
|
||||
// if not reserved, check the free capacity
|
||||
if (!hostHasCapacity)
|
||||
hostHasCapacity = _capacityMgr.checkIfHostHasCapacity(host.getId(), cpu_requested, ram_requested, false, cpuOvercommitRatio, memoryOvercommitRatio, true);
|
||||
}
|
||||
|
||||
if (hostHasCapacity
|
||||
&& hostHasCpuCapability) {
|
||||
s_logger.debug("The last host of this VM is UP and has enough capacity");
|
||||
s_logger.debug("Now checking for suitable pools under zone: " + host.getDataCenterId()
|
||||
+ ", pod: " + host.getPodId() + ", cluster: " + host.getClusterId());
|
||||
|
|
|
|||
Loading…
Reference in New Issue