kishankavala commented on code in PR #7976:
URL: https://github.com/apache/cloudstack/pull/7976#discussion_r1400119338
##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java:
##########
@@ -5179,4 +5205,100 @@ public void setInterfaceDefQueueSettings(Map<String,
String> details, Integer cp
}
}
}
+
+ public HashMap<String, UnmanagedInstanceTO> getStoppedVms(final Connect
conn) {
+ final List<String> stoppedVms = new ArrayList<>();
+
+ String[] vms;
+
+ try {
+ vms = conn.listDefinedDomains();
+ } catch (final LibvirtException e) {
+ s_logger.warn("Unable to listDomains", e);
+ return null;
+ }
+
+ HashMap<String, UnmanagedInstanceTO> unmanagedInstances = new
HashMap<>();
+ Domain dm = null;
+ for (String vm : vms) {
+ try {
+ dm = conn.domainLookupByName(vm);
+
+ final DomainState ps = dm.getInfo().state;
+
+ final PowerState state = convertToPowerState(ps);
+
+ s_logger.debug("VM " + dm.getName() + ": powerstate = " + ps +
"; vm state=" + state.toString());
+ final String vmName = dm.getName();
+
+ if (state == PowerState.PowerOff) {
+ UnmanagedInstanceTO unmanagedInstanceTO = new
UnmanagedInstanceTO();
+ unmanagedInstanceTO.setName(vmName);
+
unmanagedInstanceTO.setPowerState(UnmanagedInstanceTO.PowerState.PowerOff);
+ unmanagedInstanceTO.setCpuCores(getCpuShares(dm));
+ //unmanagedInstanceTO.setMemory(new
Long(dm.getMaxMemory()).intValue());
+ unmanagedInstanceTO.setMemory(131072);
Review Comment:
Removed fixed value
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]