mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge branch '4.14'
This commit is contained in:
commit
492962238e
@ -128,10 +128,19 @@ public class HostForMigrationResponse extends BaseResponse {
|
|||||||
@Param(description = "the outgoing network traffic on the host")
|
@Param(description = "the outgoing network traffic on the host")
|
||||||
private Long networkKbsWrite;
|
private Long networkKbsWrite;
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
@SerializedName("memoryallocated")
|
@SerializedName("memoryallocated")
|
||||||
@Param(description = "the amount of the host's memory currently allocated")
|
@Param(description = "the amount of the host's memory currently allocated")
|
||||||
private String memoryAllocated;
|
private String memoryAllocated;
|
||||||
|
|
||||||
|
@SerializedName("memoryallocatedpercentage")
|
||||||
|
@Param(description = "the amount of the host's memory currently allocated in percentage")
|
||||||
|
private String memoryAllocatedPercentage;
|
||||||
|
|
||||||
|
@SerializedName("memoryallocatedbytes")
|
||||||
|
@Param(description = "the amount of the host's memory currently allocated in bytes")
|
||||||
|
private Long memoryAllocatedBytes;
|
||||||
|
|
||||||
@SerializedName("memoryused")
|
@SerializedName("memoryused")
|
||||||
@Param(description = "the amount of the host's memory currently used")
|
@Param(description = "the amount of the host's memory currently used")
|
||||||
private Long memoryUsed;
|
private Long memoryUsed;
|
||||||
@ -314,6 +323,14 @@ public class HostForMigrationResponse extends BaseResponse {
|
|||||||
this.memoryAllocated = memoryAllocated;
|
this.memoryAllocated = memoryAllocated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setMemoryAllocatedPercentage(String memoryAllocatedPercentage) {
|
||||||
|
this.memoryAllocatedPercentage = memoryAllocatedPercentage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMemoryAllocatedBytes(Long memoryAllocatedBytes) {
|
||||||
|
this.memoryAllocatedBytes = memoryAllocatedBytes;
|
||||||
|
}
|
||||||
|
|
||||||
public void setMemoryUsed(Long memoryUsed) {
|
public void setMemoryUsed(Long memoryUsed) {
|
||||||
this.memoryUsed = memoryUsed;
|
this.memoryUsed = memoryUsed;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -136,10 +136,19 @@ public class HostResponse extends BaseResponse {
|
|||||||
@Param(description = "the amount of the host's memory after applying the mem.overprovisioning.factor")
|
@Param(description = "the amount of the host's memory after applying the mem.overprovisioning.factor")
|
||||||
private String memWithOverprovisioning;
|
private String memWithOverprovisioning;
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
@SerializedName("memoryallocated")
|
@SerializedName("memoryallocated")
|
||||||
@Param(description = "the amount of the host's memory currently allocated")
|
@Param(description = "the amount of the host's memory currently allocated")
|
||||||
private long memoryAllocated;
|
private long memoryAllocated;
|
||||||
|
|
||||||
|
@SerializedName("memoryallocatedpercentage")
|
||||||
|
@Param(description = "the amount of the host's memory currently allocated in percentage")
|
||||||
|
private String memoryAllocatedPercentage;
|
||||||
|
|
||||||
|
@SerializedName("memoryallocatedbytes")
|
||||||
|
@Param(description = "the amount of the host's memory currently allocated in bytes")
|
||||||
|
private Long memoryAllocatedBytes;
|
||||||
|
|
||||||
@SerializedName("memoryused")
|
@SerializedName("memoryused")
|
||||||
@Param(description = "the amount of the host's memory currently used")
|
@Param(description = "the amount of the host's memory currently used")
|
||||||
private Long memoryUsed;
|
private Long memoryUsed;
|
||||||
@ -608,6 +617,14 @@ public class HostResponse extends BaseResponse {
|
|||||||
return memoryAllocated;
|
return memoryAllocated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setMemoryAllocatedPercentage(String memoryAllocatedPercentage) {
|
||||||
|
this.memoryAllocatedPercentage = memoryAllocatedPercentage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMemoryAllocatedBytes(Long memoryAllocatedBytes) {
|
||||||
|
this.memoryAllocatedBytes = memoryAllocatedBytes;
|
||||||
|
}
|
||||||
|
|
||||||
public Long getMemoryUsed() {
|
public Long getMemoryUsed() {
|
||||||
return memoryUsed;
|
return memoryUsed;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -170,9 +170,12 @@ public class HostJoinDaoImpl extends GenericDaoBase<HostJoinVO, Long> implements
|
|||||||
Long cpu = host.getCpuReservedCapacity() + host.getCpuUsedCapacity();
|
Long cpu = host.getCpuReservedCapacity() + host.getCpuUsedCapacity();
|
||||||
|
|
||||||
hostResponse.setMemoryTotal(host.getTotalMemory());
|
hostResponse.setMemoryTotal(host.getTotalMemory());
|
||||||
Float totalMemorywithOverprovisioning = host.getTotalMemory() * ApiDBUtils.getMemOverprovisioningFactor(host.getClusterId());
|
Float memWithOverprovisioning = host.getTotalMemory() * ApiDBUtils.getMemOverprovisioningFactor(host.getClusterId());
|
||||||
hostResponse.setMemWithOverprovisioning(decimalFormat.format(totalMemorywithOverprovisioning));
|
hostResponse.setMemWithOverprovisioning(decimalFormat.format(memWithOverprovisioning));
|
||||||
hostResponse.setMemoryAllocated(mem);
|
hostResponse.setMemoryAllocated(mem);
|
||||||
|
hostResponse.setMemoryAllocatedBytes(mem);
|
||||||
|
String memoryAllocatedPercentage = decimalFormat.format((float) mem / memWithOverprovisioning * 100.0f) +"%";
|
||||||
|
hostResponse.setMemoryAllocatedPercentage(memoryAllocatedPercentage);
|
||||||
|
|
||||||
String hostTags = host.getTag();
|
String hostTags = host.getTag();
|
||||||
hostResponse.setHostTags(host.getTag());
|
hostResponse.setHostTags(host.getTag());
|
||||||
@ -321,7 +324,10 @@ public class HostJoinDaoImpl extends GenericDaoBase<HostJoinVO, Long> implements
|
|||||||
hostResponse.setMemoryTotal(host.getTotalMemory());
|
hostResponse.setMemoryTotal(host.getTotalMemory());
|
||||||
Float memWithOverprovisioning = host.getTotalMemory() * ApiDBUtils.getMemOverprovisioningFactor(host.getClusterId());
|
Float memWithOverprovisioning = host.getTotalMemory() * ApiDBUtils.getMemOverprovisioningFactor(host.getClusterId());
|
||||||
hostResponse.setMemWithOverprovisioning(decimalFormat.format(memWithOverprovisioning));
|
hostResponse.setMemWithOverprovisioning(decimalFormat.format(memWithOverprovisioning));
|
||||||
hostResponse.setMemoryAllocated(decimalFormat.format((float) mem / memWithOverprovisioning * 100.0f) +"%");
|
String memoryAllocatedPercentage = decimalFormat.format((float) mem / memWithOverprovisioning * 100.0f) +"%";
|
||||||
|
hostResponse.setMemoryAllocated(memoryAllocatedPercentage);
|
||||||
|
hostResponse.setMemoryAllocatedPercentage(memoryAllocatedPercentage);
|
||||||
|
hostResponse.setMemoryAllocatedBytes(mem);
|
||||||
|
|
||||||
String hostTags = host.getTag();
|
String hostTags = host.getTag();
|
||||||
hostResponse.setHostTags(host.getTag());
|
hostResponse.setHostTags(host.getTag());
|
||||||
|
|||||||
@ -1019,10 +1019,6 @@ def main(argv):
|
|||||||
# The "GLOBAL" Configuration object
|
# The "GLOBAL" Configuration object
|
||||||
config = CsConfig()
|
config = CsConfig()
|
||||||
|
|
||||||
logging.basicConfig(filename=config.get_logger(),
|
|
||||||
level=config.get_level(),
|
|
||||||
format=config.get_format())
|
|
||||||
|
|
||||||
# Load stored ip addresses from disk to CsConfig()
|
# Load stored ip addresses from disk to CsConfig()
|
||||||
config.set_address()
|
config.set_address()
|
||||||
|
|
||||||
|
|||||||
@ -14,3 +14,12 @@
|
|||||||
# KIND, either express or implied. See the License for the
|
# KIND, either express or implied. See the License for the
|
||||||
# specific language governing permissions and limitations
|
# specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import logging
|
||||||
|
from cs.CsConfig import CsConfig
|
||||||
|
|
||||||
|
config = CsConfig()
|
||||||
|
|
||||||
|
logging.basicConfig(filename=config.get_logger(),
|
||||||
|
level=config.get_level(),
|
||||||
|
format=config.get_format())
|
||||||
|
|||||||
@ -26,8 +26,6 @@ import os.path
|
|||||||
import configure
|
import configure
|
||||||
import json
|
import json
|
||||||
|
|
||||||
logging.basicConfig(filename='/var/log/cloud.log', level=logging.INFO, format='%(asctime)s %(filename)s %(funcName)s:%(lineno)d %(message)s')
|
|
||||||
|
|
||||||
# first commandline argument should be the file to process
|
# first commandline argument should be the file to process
|
||||||
argc = len(sys.argv)
|
argc = len(sys.argv)
|
||||||
if argc != 2 and argc != 3:
|
if argc != 2 and argc != 3:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user