diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json
index 944a24f4219..666d2a31e39 100644
--- a/ui/public/locales/en.json
+++ b/ui/public/locales/en.json
@@ -1591,6 +1591,8 @@
"label.prepare.for.shutdown": "Prepare for Shutdown",
"label.prepareformaintenance": "Prepare for Maintenance",
"label.presetup": "PreSetup",
+"label.press.enter": "Press enter when done.",
+"label.press.enter.tooltip": "On leaving a any of these fields above, when they all contain values, or on pressing enter, ESXi hosts will be retrieved. If this is successful, a dropdown will appear with the list of ESXi hosts.",
"label.prev": "Prev",
"label.previous": "Previous",
"label.primera.username.tooltip": "The username with edit privileges",
@@ -3006,7 +3008,7 @@
"message.license.agreements.not.accepted": "License agreements not accepted.",
"message.linstor.resourcegroup.description": "Linstor resource group to use for primary storage.",
"message.list.zone.vmware.datacenter.empty": "No VMware Datacenter exists in the selected Zone",
-"message.list.zone.vmware.hosts.empty": "No VMware hosts were found in the selected Datacenter",
+"message.list.zone.vmware.hosts.empty": "No EXSi hosts were found in the selected Datacenter.\nAre the entered credentials correct?\n",
"message.listnsp.not.return.providerid": "error: listNetworkServiceProviders API doesn't return VirtualRouter provider ID.",
"message.load.host.failed": "Failed to load hosts.",
"message.loadbalancer.stickypolicy.configuration": "Customize the load balancer stickiness policy:",
diff --git a/ui/src/views/tools/SelectVmwareVcenter.vue b/ui/src/views/tools/SelectVmwareVcenter.vue
index 1d25657b11b..e93d893e9fc 100644
--- a/ui/src/views/tools/SelectVmwareVcenter.vue
+++ b/ui/src/views/tools/SelectVmwareVcenter.vue
@@ -89,7 +89,8 @@
@@ -99,7 +100,8 @@
@@ -109,7 +111,8 @@
@@ -119,13 +122,16 @@
+
+
-
+
+ {{ }}
{{ 'ESXi: ' + opt.name }}
@@ -283,7 +290,7 @@ export default {
this.loading = false
})
},
- listZoneVmwareDcHosts () {
+ loadZoneVmwareDcHosts (doNotify) {
this.loading = true
const params = {}
if (this.vcenterSelectedOption === 'new') {
@@ -299,18 +306,23 @@ export default {
this.hosts = response.listvmwaredchostsresponse.host
}
}).catch(error => {
- this.$notifyError(error)
+ if (doNotify) {
+ this.$notifyError(error)
+ }
+ this.hosts = []
+ return false
}).finally(() => {
this.loading = false
+ return true
})
},
onSelectExistingVmwareDatacenter (value) {
this.selectedExistingVcenterId = value
- this.listZoneVmwareDcHosts()
+ this.loadZoneVmwareDcHosts(true)
},
onSelectExternalVmwareDatacenter (value) {
if (this.vcenterSelectedOption === 'new' && !(this.vcenter === '' || this.datacentername === '' || this.username === '' || this.password === '')) {
- this.listZoneVmwareDcHosts()
+ this.loadZoneVmwareDcHosts(false)
}
},
onSelectExistingVmwareHost (value) {
diff --git a/vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/BaseMO.java b/vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/BaseMO.java
index 15fc4ab8b2e..27ca6396a47 100644
--- a/vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/BaseMO.java
+++ b/vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/BaseMO.java
@@ -33,6 +33,7 @@ import com.vmware.vim25.ObjectContent;
import com.vmware.vim25.RetrieveResult;
import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
import java.util.List;
public class BaseMO {
@@ -65,6 +66,9 @@ public class BaseMO {
if (s_logger.isDebugEnabled()) {
s_logger.debug("vmware result : " + ReflectionToStringBuilderUtils.reflectCollection(result));
}
+ if (result == null) {
+ return new Pair<>(null, new ArrayList<>());
+ }
String tokenForRetrievingNewResults = result.getToken();
List listOfObjects = result.getObjects();
return new Pair<>(tokenForRetrievingNewResults, listOfObjects);