This is an automated email from the ASF dual-hosted git repository.

shwstppr pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/main by this push:
     new 514d2c2a26c schema,engine-schema: explicit VMware 8.0.0.2, 8.0.0.3 
support, logs (#8444)
514d2c2a26c is described below

commit 514d2c2a26c6713899bef601d8ba6f295c7ad78b
Author: Abhishek Kumar <[email protected]>
AuthorDate: Tue Jan 9 14:43:04 2024 +0530

    schema,engine-schema: explicit VMware 8.0.0.2, 8.0.0.3 support, logs (#8444)
    
    Fixes #8412
    
    Add support for 8.0.0.2 explicitly to prevent falling over to the parent 
version
    Adds log when hypervisor capabilities fail over to the parent version
    
    ---------
    
    Signed-off-by: Abhishek Kumar <[email protected]>
---
 .../cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java    | 10 ++++++++--
 .../src/main/resources/META-INF/db/schema-41810to41900.sql     |  4 ++++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git 
a/engine/schema/src/main/java/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java
 
b/engine/schema/src/main/java/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java
index e8272825213..a4ec0a66360 100644
--- 
a/engine/schema/src/main/java/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java
+++ 
b/engine/schema/src/main/java/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java
@@ -75,11 +75,17 @@ public class HypervisorCapabilitiesDaoImpl extends 
GenericDaoBase<HypervisorCapa
         sc.setParameters("hypervisorType", hypervisorType);
         sc.setParameters("hypervisorVersion", hypervisorVersion);
         HypervisorCapabilitiesVO result = findOneBy(sc);
+        String parentVersion = 
CloudStackVersion.getVMwareParentVersion(hypervisorVersion);
         if (result != null || !HypervisorType.VMware.equals(hypervisorType) ||
-                CloudStackVersion.getVMwareParentVersion(hypervisorVersion) == 
null) {
+                parentVersion == null) {
             return result;
         }
-        sc.setParameters("hypervisorVersion", 
CloudStackVersion.getVMwareParentVersion(hypervisorVersion));
+        if (s_logger.isDebugEnabled()) {
+            s_logger.debug(String.format("Hypervisor capabilities for 
hypervisor: %s, version: %s can not be found. " +
+                            "Trying to find capabilities for the parent 
version: %s",
+                    hypervisorType, hypervisorVersion, parentVersion));
+        }
+        sc.setParameters("hypervisorVersion", parentVersion);
         return findOneBy(sc);
     }
 
diff --git 
a/engine/schema/src/main/resources/META-INF/db/schema-41810to41900.sql 
b/engine/schema/src/main/resources/META-INF/db/schema-41810to41900.sql
index 15307353c3f..a6f45c261ce 100644
--- a/engine/schema/src/main/resources/META-INF/db/schema-41810to41900.sql
+++ b/engine/schema/src/main/resources/META-INF/db/schema-41810to41900.sql
@@ -319,3 +319,7 @@ CREATE TABLE `cloud_usage`.`bucket_statistics` (
 
 -- Add remover account ID to quarantined IPs table.
 CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.quarantined_ips', 
'remover_account_id', 'bigint(20) unsigned DEFAULT NULL COMMENT "ID of the 
account that removed the IP from quarantine, foreign key to `account` table"');
+
+-- Explicitly add support for VMware 8.0b (8.0.0.2), 8.0c (8.0.0.3)
+INSERT IGNORE INTO `cloud`.`hypervisor_capabilities` (uuid, hypervisor_type, 
hypervisor_version, max_guests_limit, security_group_enabled, 
max_data_volumes_limit, max_hosts_per_cluster, storage_motion_supported, 
vm_snapshot_enabled) values (UUID(), 'VMware', '8.0.0.2', 1024, 0, 59, 64, 1, 
1);
+INSERT IGNORE INTO `cloud`.`hypervisor_capabilities` (uuid, hypervisor_type, 
hypervisor_version, max_guests_limit, security_group_enabled, 
max_data_volumes_limit, max_hosts_per_cluster, storage_motion_supported, 
vm_snapshot_enabled) values (UUID(), 'VMware', '8.0.0.3', 1024, 0, 59, 64, 1, 
1);

Reply via email to