diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/internallb/StopInternalLBVMCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/internallb/StopInternalLBVMCmd.java index 1381f6705276..76ad4d438d28 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/admin/internallb/StopInternalLBVMCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/internallb/StopInternalLBVMCmd.java @@ -51,7 +51,7 @@ public class StopInternalLBVMCmd extends BaseAsyncCmd { @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = DomainRouterResponse.class, required = true, description = "the ID of the internal lb vm") private Long id; - @Parameter(name = ApiConstants.FORCED, type = CommandType.BOOLEAN, required = false, description = "Force stop the VM. The caller knows the VM is stopped.") + @Parameter(name = ApiConstants.FORCED, type = CommandType.BOOLEAN, required = false, description = "Force stop the VM (vm is marked as Stopped even when command fails to be send to the backend, otherwise a force poweroff is attempted). To be used if the caller knows the VM is stopped and should be marked as such.") private Boolean forced; // /////////////////////////////////////////////////// diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/router/StopRouterCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/router/StopRouterCmd.java index b9e156612686..2da38d904264 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/admin/router/StopRouterCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/router/StopRouterCmd.java @@ -49,7 +49,7 @@ public class StopRouterCmd extends BaseAsyncCmd { @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = DomainRouterResponse.class, required = true, description = "the ID of the router") private Long id; - @Parameter(name = ApiConstants.FORCED, type = CommandType.BOOLEAN, required = false, description = "Force stop the VM. The caller knows the VM is stopped.") + @Parameter(name = ApiConstants.FORCED, type = CommandType.BOOLEAN, required = false, description = "Force stop the VM (vm is marked as Stopped even when command fails to be send to the backend, otherwise a force poweroff is attempted). To be used if the caller knows the VM is stopped and should be marked as such.") private Boolean forced; // /////////////////////////////////////////////////// diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java index 755c8e462056..4bb533ce5b6a 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java @@ -54,7 +54,7 @@ public class StopSystemVmCmd extends BaseAsyncCmd { description = "The ID of the system virtual machine") private Long id; - @Parameter(name = ApiConstants.FORCED, type = CommandType.BOOLEAN, required = false, description = "Force stop the VM. The caller knows the VM is stopped.") + @Parameter(name = ApiConstants.FORCED, type = CommandType.BOOLEAN, required = false, description = "Force stop the VM (vm is marked as Stopped even when command fails to be send to the backend, otherwise a force poweroff is attempted). To be used if the caller knows the VM is stopped and should be marked as such.") private Boolean forced; ///////////////////////////////////////////////////// diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/StopVMCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/StopVMCmd.java index 529e09a0753a..113ba9ed25db 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/StopVMCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/StopVMCmd.java @@ -55,7 +55,8 @@ public class StopVMCmd extends BaseAsyncCmd implements UserCmd { private Long id; @Parameter(name = ApiConstants.FORCED, type = CommandType.BOOLEAN, required = false, description = "Force stop the VM " - + "(vm is marked as Stopped even when command fails to be send to the backend, otherwise a force poweroff is attempted). The caller knows the VM is stopped.") + + "(vm is marked as Stopped even when command fails to be send to the backend, otherwise a force poweroff is attempted)." + + " This option is to be used if the caller knows the VM is stopped and should be marked as such.") private Boolean forced; // /////////////////////////////////////////////////// diff --git a/plugins/network-elements/netscaler/src/main/java/com/cloud/api/commands/StopNetScalerVMCmd.java b/plugins/network-elements/netscaler/src/main/java/com/cloud/api/commands/StopNetScalerVMCmd.java index 5d754168e492..288e867277a4 100644 --- a/plugins/network-elements/netscaler/src/main/java/com/cloud/api/commands/StopNetScalerVMCmd.java +++ b/plugins/network-elements/netscaler/src/main/java/com/cloud/api/commands/StopNetScalerVMCmd.java @@ -56,7 +56,7 @@ public class StopNetScalerVMCmd extends BaseAsyncCmd { @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = DomainRouterResponse.class, required = true, description = "the ID of the NetScaler vm") private Long id; - @Parameter(name = ApiConstants.FORCED, type = CommandType.BOOLEAN, required = false, description = "Force stop the VM. The caller knows the VM is stopped.") + @Parameter(name = ApiConstants.FORCED, type = CommandType.BOOLEAN, required = false, description = "Force stop the VM (vm is marked as Stopped even when command fails to be send to the backend, otherwise a force poweroff is attempted). To be used if the caller knows the VM is stopped and should be marked as such.") private Boolean forced; // /////////////////////////////////////////////////// diff --git a/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java b/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java index 74367a09c53b..c28865943a96 100644 --- a/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java +++ b/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java @@ -3940,7 +3940,7 @@ private List applyPublicTemplateRestriction(List @Override public ListResponse listIsos(ListIsosCmd cmd) { Pair, Integer> result = searchForIsosInternal(cmd); - ListResponse response = new ListResponse(); + ListResponse response = new ListResponse<>(); ResponseView respView = ResponseView.Restricted; if (cmd instanceof ListIsosCmdByAdmin) { @@ -3967,11 +3967,11 @@ private Pair, Integer> searchForIsosInternal(ListIsosCmd cm listAll = true; } - List permittedAccountIds = new ArrayList(); - Ternary domainIdRecursiveListProject = new Ternary(cmd.getDomainId(), cmd.isRecursive(), null); + List permittedAccountIds = new ArrayList<>(); + Ternary domainIdRecursiveListProject = new Ternary<>(cmd.getDomainId(), cmd.isRecursive(), null); _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccountIds, domainIdRecursiveListProject, listAll, false); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); - List permittedAccounts = new ArrayList(); + List permittedAccounts = new ArrayList<>(); for (Long accountId : permittedAccountIds) { permittedAccounts.add(_accountMgr.getAccount(accountId)); } diff --git a/server/src/main/java/com/cloud/api/query/ViewResponseHelper.java b/server/src/main/java/com/cloud/api/query/ViewResponseHelper.java index ecfda39972ea..48031425bb8e 100644 --- a/server/src/main/java/com/cloud/api/query/ViewResponseHelper.java +++ b/server/src/main/java/com/cloud/api/query/ViewResponseHelper.java @@ -21,7 +21,6 @@ import java.util.Collections; import java.util.EnumSet; import java.util.HashMap; -import java.util.Hashtable; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -150,7 +149,7 @@ public static List createUserVmResponse(ResponseView view, Strin public static List createUserVmResponse(ResponseView view, String objectName, Set details, Boolean accumulateStats, Boolean showUserData, UserVmJoinVO... userVms) { Account caller = CallContext.current().getCallingAccount(); - Hashtable vmDataList = new Hashtable(); + LinkedHashMap vmDataList = new LinkedHashMap<>(); // Initialise the vmdatalist with the input data for (UserVmJoinVO userVm : userVms) { @@ -169,7 +168,7 @@ public static List createUserVmResponse(ResponseView view, Strin public static List createDomainRouterResponse(DomainRouterJoinVO... routers) { Account caller = CallContext.current().getCallingAccount(); - Hashtable vrDataList = new Hashtable(); + LinkedHashMap vrDataList = new LinkedHashMap<>(); // Initialise the vrdatalist with the input data for (DomainRouterJoinVO vr : routers) { DomainRouterResponse vrData = vrDataList.get(vr.getId()); @@ -187,7 +186,7 @@ public static List createDomainRouterResponse(DomainRouter public static List createSecurityGroupResponses(List securityGroups) { Account caller = CallContext.current().getCallingAccount(); - Hashtable vrDataList = new Hashtable(); + LinkedHashMap vrDataList = new LinkedHashMap<>(); // Initialise the vrdatalist with the input data for (SecurityGroupJoinVO vr : securityGroups) { SecurityGroupResponse vrData = vrDataList.get(vr.getId()); @@ -205,7 +204,7 @@ public static List createSecurityGroupResponses(List createProjectResponse(EnumSet details, ProjectJoinVO... projects) { - Hashtable prjDataList = new Hashtable(); + LinkedHashMap prjDataList = new LinkedHashMap<>(); // Initialise the prjdatalist with the input data for (ProjectJoinVO p : projects) { ProjectResponse pData = prjDataList.get(p.getId()); @@ -247,7 +246,7 @@ public static List createProjectInvitationResponse(Pr } public static List createHostResponse(EnumSet details, HostJoinVO... hosts) { - Hashtable vrDataList = new Hashtable(); + LinkedHashMap vrDataList = new LinkedHashMap<>(); // Initialise the vrdatalist with the input data for (HostJoinVO vr : hosts) { HostResponse vrData = ApiDBUtils.newHostResponse(vr, details); @@ -257,7 +256,7 @@ public static List createHostResponse(EnumSet details } public static List createHostForMigrationResponse(EnumSet details, HostJoinVO... hosts) { - Hashtable vrDataList = new Hashtable(); + LinkedHashMap vrDataList = new LinkedHashMap<>(); // Initialise the vrdatalist with the input data for (HostJoinVO vr : hosts) { HostForMigrationResponse vrData = ApiDBUtils.newHostForMigrationResponse(vr, details); @@ -267,7 +266,7 @@ public static List createHostForMigrationResponse(Enum } public static List createVolumeResponse(ResponseView view, VolumeJoinVO... volumes) { - Hashtable vrDataList = new Hashtable(); + LinkedHashMap vrDataList = new LinkedHashMap<>(); DecimalFormat df = new DecimalFormat("0.0%"); for (VolumeJoinVO vr : volumes) { VolumeResponse vrData = vrDataList.get(vr.getId()); @@ -308,7 +307,7 @@ public static List createVolumeResponse(ResponseView view, Volum } public static List createStoragePoolResponse(StoragePoolJoinVO... pools) { - Hashtable vrDataList = new Hashtable(); + LinkedHashMap vrDataList = new LinkedHashMap<>(); // Initialise the vrdatalist with the input data for (StoragePoolJoinVO vr : pools) { StoragePoolResponse vrData = vrDataList.get(vr.getId()); @@ -345,7 +344,7 @@ public static List createHostTagResponse(HostTagVO... hostTags) } public static List createImageStoreResponse(ImageStoreJoinVO... stores) { - Hashtable vrDataList = new Hashtable(); + LinkedHashMap vrDataList = new LinkedHashMap<>(); // Initialise the vrdatalist with the input data for (ImageStoreJoinVO vr : stores) { ImageStoreResponse vrData = vrDataList.get(vr.getId()); @@ -362,7 +361,7 @@ public static List createImageStoreResponse(ImageStoreJoinVO } public static List createStoragePoolForMigrationResponse(StoragePoolJoinVO... pools) { - Hashtable vrDataList = new Hashtable(); + LinkedHashMap vrDataList = new LinkedHashMap<>(); // Initialise the vrdatalist with the input data for (StoragePoolJoinVO vr : pools) { StoragePoolResponse vrData = vrDataList.get(vr.getId()); @@ -577,7 +576,7 @@ public static List createDataCenterResponse(ResponseView view, Boo } public static List createTemplateResponse(EnumSet detailsView, ResponseView view, TemplateJoinVO... templates) { - LinkedHashMap vrDataList = new LinkedHashMap(); + LinkedHashMap vrDataList = new LinkedHashMap<>(); for (TemplateJoinVO vr : templates) { TemplateResponse vrData = vrDataList.get(vr.getTempZonePair()); if (vrData == null) { @@ -594,7 +593,7 @@ public static List createTemplateResponse(EnumSet createTemplateUpdateResponse(ResponseView view, TemplateJoinVO... templates) { - Hashtable vrDataList = new Hashtable(); + LinkedHashMap vrDataList = new LinkedHashMap<>(); for (TemplateJoinVO vr : templates) { TemplateResponse vrData = vrDataList.get(vr.getId()); if (vrData == null) { @@ -610,7 +609,7 @@ public static List createTemplateUpdateResponse(ResponseView v } public static List createIsoResponse(ResponseView view, TemplateJoinVO... templates) { - Hashtable vrDataList = new Hashtable(); + LinkedHashMap vrDataList = new LinkedHashMap<>(); for (TemplateJoinVO vr : templates) { TemplateResponse vrData = vrDataList.get(vr.getTempZonePair()); if (vrData == null) { @@ -626,7 +625,7 @@ public static List createIsoResponse(ResponseView view, Templa } public static List createAffinityGroupResponses(List groups) { - Hashtable vrDataList = new Hashtable(); + LinkedHashMap vrDataList = new LinkedHashMap<>(); for (AffinityGroupJoinVO vr : groups) { AffinityGroupResponse vrData = vrDataList.get(vr.getId()); if (vrData == null) { diff --git a/services/console-proxy/server/src/main/java/com/cloud/consoleproxy/ConsoleProxyNoVncClient.java b/services/console-proxy/server/src/main/java/com/cloud/consoleproxy/ConsoleProxyNoVncClient.java index 6434dd6e42e0..2dfea2251fb6 100644 --- a/services/console-proxy/server/src/main/java/com/cloud/consoleproxy/ConsoleProxyNoVncClient.java +++ b/services/console-proxy/server/src/main/java/com/cloud/consoleproxy/ConsoleProxyNoVncClient.java @@ -114,6 +114,11 @@ public void run() { updateFrontEndActivityTime(); } connectionAlive = client.isVncOverWebSocketConnectionAlive(); + try { + Thread.sleep(1); + } catch (Exception e) { + s_logger.warn("Error on sleep for vnc over websocket", e); + } } else if (client.isVncOverNioSocket()) { byte[] bytesArr; int nextBytes = client.getNextBytes(); diff --git a/test/integration/smoke/test_vm_life_cycle.py b/test/integration/smoke/test_vm_life_cycle.py index 5c8f56099982..a9a554e19ad1 100644 --- a/test/integration/smoke/test_vm_life_cycle.py +++ b/test/integration/smoke/test_vm_life_cycle.py @@ -1556,7 +1556,7 @@ def setUp(self): self.skipTest("Requires at least two hosts for performing migration related tests") for host in self.hosts: - if host.details['Host.OS'] in ['CentOS']: + if host.details['Host.OS'] and host.details['Host.OS'].startswith('CentOS'): self.skipTest("live migration is not stabily supported on CentOS") def tearDown(self): diff --git a/ui/src/config/section/image.js b/ui/src/config/section/image.js index bf1083575ddd..c41ab9307a6a 100644 --- a/ui/src/config/section/image.js +++ b/ui/src/config/section/image.js @@ -213,7 +213,7 @@ export default { } return fields }, - details: ['name', 'id', 'displaytext', 'checksum', 'ostypename', 'size', 'bootable', 'isready', 'directdownload', 'isextractable', 'ispublic', 'isfeatured', 'crosszones', 'account', 'domain', 'created', 'userdatadetails', 'userdatapolicy'], + details: ['name', 'id', 'displaytext', 'checksum', 'ostypename', 'size', 'bootable', 'isready', 'directdownload', 'isextractable', 'ispublic', 'isfeatured', 'crosszones', 'account', 'domain', 'created', 'userdatadetails', 'userdatapolicy', 'url'], searchFilters: ['name', 'zoneid', 'tags'], related: [{ name: 'vm',