Skip to content

Commit 9d5cff2

Browse files
committed
Fix ovftool and version display - also display versions on host details view
1 parent d3d2716 commit 9d5cff2

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3772,6 +3772,8 @@ public StartupCommand[] initialize() {
37723772
cmd.getHostDetails().put(HOST_INSTANCE_CONVERSION, String.valueOf(instanceConversionSupported));
37733773
if (instanceConversionSupported) {
37743774
cmd.getHostDetails().put(HOST_VIRTV2V_VERSION, getHostVirtV2vVersion());
3775+
}
3776+
if (hostSupportsOvfExport()) {
37753777
cmd.getHostDetails().put(HOST_OVFTOOL_VERSION, getHostOvfToolVersion());
37763778
}
37773779
HealthCheckResult healthCheckResult = getHostHealthCheckResult();
@@ -5376,11 +5378,18 @@ public boolean hostSupportsOvfExport() {
53765378
}
53775379

53785380
public String getHostVirtV2vVersion() {
5381+
if (!hostSupportsInstanceConversion()) {
5382+
return "";
5383+
}
53795384
String cmd = String.format("%s | awk '{print $2}'", INSTANCE_CONVERSION_SUPPORTED_CHECK_CMD);
5380-
return Script.runSimpleBashScript(cmd);
5385+
String version = Script.runSimpleBashScript(cmd);
5386+
return StringUtils.isNotBlank(version) ? version.split(",")[0] : "";
53815387
}
53825388

53835389
public String getHostOvfToolVersion() {
5390+
if (!hostSupportsOvfExport()) {
5391+
return "";
5392+
}
53845393
return Script.runSimpleBashScript(OVF_EXPORT_TOOl_GET_VERSION_CMD);
53855394
}
53865395

ui/public/locales/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,9 @@
10891089
"label.host": "IP address",
10901090
"label.host.alerts": "Hosts in alert state",
10911091
"label.host.name": "Host name",
1092+
"label.host.ovftool.version": "OVFTool Version",
10921093
"label.host.tag": "Host tag",
1094+
"label.host.virtv2v.version": "Virt-v2v Version",
10931095
"label.hostcontrolstate": "Compute Resource Status",
10941096
"label.hostid": "Host",
10951097
"label.hostname": "Host",

ui/src/views/infra/HostInfo.vue

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,22 @@
5656
</div>
5757
</div>
5858
</a-list-item>
59+
<a-list-item v-if="host.details && host.details['host.virtv2v.version']">
60+
<div>
61+
<strong>{{ $t('label.host.virtv2v.version') }}</strong>
62+
<div>
63+
{{ host.details['host.virtv2v.version'] }}
64+
</div>
65+
</div>
66+
</a-list-item>
67+
<a-list-item v-if="host.details && host.details['host.ovftool.version']">
68+
<div>
69+
<strong>{{ $t('label.host.ovftool.version') }}</strong>
70+
<div>
71+
{{ host.details['host.ovftool.version'] }}
72+
</div>
73+
</div>
74+
</a-list-item>
5975
<a-list-item v-if="host.hosttags">
6076
<div>
6177
<strong>{{ $t('label.hosttags') }}</strong>

0 commit comments

Comments
 (0)