From 11ca5182ab4715cad7c9aee9c67b0828d4b6d884 Mon Sep 17 00:00:00 2001 From: Daan Hoogland Date: Mon, 13 Jan 2025 17:15:08 +0100 Subject: [PATCH] use host to list vms --- .../admin/zone/ListVmwareDcHostsCmd.java | 2 +- ui/public/locales/en.json | 1 + ui/src/views/tools/SelectVmwareVcenter.vue | 53 +++++++++++++++++-- 3 files changed, 52 insertions(+), 4 deletions(-) diff --git a/plugins/hypervisors/vmware/src/main/java/org/apache/cloudstack/api/command/admin/zone/ListVmwareDcHostsCmd.java b/plugins/hypervisors/vmware/src/main/java/org/apache/cloudstack/api/command/admin/zone/ListVmwareDcHostsCmd.java index b7588d4a4a07..76022d92c4cc 100644 --- a/plugins/hypervisors/vmware/src/main/java/org/apache/cloudstack/api/command/admin/zone/ListVmwareDcHostsCmd.java +++ b/plugins/hypervisors/vmware/src/main/java/org/apache/cloudstack/api/command/admin/zone/ListVmwareDcHostsCmd.java @@ -139,10 +139,10 @@ private HostResponse createHostResponse(HostMO hostInstance) throws InvalidPrope HostResponse response = new HostResponse(); response.setHypervisor(Hypervisor.HypervisorType.VMware.toString()); response.setName(hostInstance.getHostName()); + response.setObjectName("host"); return response; } - private void checkParameters() { if ((existingVcenterId == null && vcenter == null) || (existingVcenterId != null && vcenter != null)) { throw new ServerApiException(ApiErrorCode.PARAM_ERROR, diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index 8cc17bbb1286..c80f02938c05 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -3004,6 +3004,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.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 31e7499c75b0..294469cd97e4 100644 --- a/ui/src/views/tools/SelectVmwareVcenter.vue +++ b/ui/src/views/tools/SelectVmwareVcenter.vue @@ -119,11 +119,31 @@ /> +
+ + + + {{ 'ESXi: ' + opt.host + ' - DC: ' + opt.name }} + + + +
+ {{ $t('message.list.zone.vmware.hosts.empty') }} +
+