mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-5162 Usage details are not getting populated when using dynamic offerings.
Signed-off-by: Koushik Das <koushik@apache.org>
This commit is contained in:
parent
58fd6f0603
commit
ef40e156ed
@ -83,6 +83,11 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering
|
||||
@Transient
|
||||
Map<String, String> details;
|
||||
|
||||
// This flag is required to tell if the offering is dynamic once the cpu, memory and speed are set.
|
||||
// In some cases cpu, memory and speed are set to non-null values even if the offering is dynamic.
|
||||
@Transient
|
||||
boolean isDynamic;
|
||||
|
||||
protected ServiceOfferingVO() {
|
||||
super();
|
||||
}
|
||||
@ -297,7 +302,10 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering
|
||||
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return cpu == null || speed == null || ramSize == null;
|
||||
return cpu == null || speed == null || ramSize == null || isDynamic;
|
||||
}
|
||||
|
||||
public void setDynamicFlag(boolean isdynamic) {
|
||||
this.isDynamic = isdynamic;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2593,6 +2593,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
|
||||
details.add(new UserVmDetailVO(id, ServiceOfferingVO.DynamicParameters.cpuSpeed.toString(), cpuSpeed.toString()));
|
||||
details.add(new UserVmDetailVO(id, ServiceOfferingVO.DynamicParameters.memory.toString(), memory.toString()));
|
||||
offering = _serviceOfferingDao.getcomputeOffering(serviceOffering.getId(), cpuNumber, cpuSpeed, memory);
|
||||
offering.setDynamicFlag(true);
|
||||
}
|
||||
if (hostName != null) {
|
||||
// Check is hostName is RFC compliant
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user