shwstppr commented on a change in pull request #4385:
URL: https://github.com/apache/cloudstack/pull/4385#discussion_r527630615
##########
File path:
vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
##########
@@ -2207,4 +2208,44 @@ public static void
createBaseFolderInDatastore(DatastoreMO dsMo, VmwareHyperviso
dsMo.makeDirectory(hiddenFolderPath,
hyperHost.getHyperHostDatacenter());
}
}
+
+ public static Integer getHostHardwareVersion(VmwareHypervisorHost host) {
+ Integer version = null;
+ HostMO hostMo = new HostMO(host.getContext(), host.getMor());
+ ComputeResourceConfigInfo info = null;
+ try {
+ info = hostMo.getHostConfigInfo();
+ } catch (Exception ignored) {}
+ if (info != null) {
+ version = Integer.valueOf(info.getDefaultHardwareVersionKey());
+ } else {
+ String hostApiVersion = "";
+ try {
+ hostApiVersion = hostMo.getHostAboutInfo().getApiVersion();
+ } catch (Exception ignored) {}
+ if (hostApiVersion == null) {
+ hostApiVersion = "";
+ }
+ if (hostApiVersion.equalsIgnoreCase("7.0")) {
+ version = 17;
+ } else if (hostApiVersion.equalsIgnoreCase("6.7")) {
+ version = 14;
+ } else if (hostApiVersion.equalsIgnoreCase("6.5")) {
+ version = 13;
+ } else if (hostApiVersion.equalsIgnoreCase("6.0")) {
+ version = 11;
+ } else if (hostApiVersion.equalsIgnoreCase("5.5")) {
+ version = 10;
+ } else if (hostApiVersion.equalsIgnoreCase("5.1")) {
+ version = 9;
+ } else if (hostApiVersion.equalsIgnoreCase("5.0")) {
+ version = 8;
+ } else if (hostApiVersion.startsWith("4.")) {
+ version = 7;
+ } else if (hostApiVersion.equalsIgnoreCase("3.5")) {
Review comment:
@nvazquez @rhtyd @sureshanaparti can you please comment if this is okay.
As per our interactions, I tried to get host harwdwareVersion using SDK but it
still returns null. By default, VMware is creating VM with highest available
hardwareVersion which creates an issue while migrating detached disks across
cluster
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]