From b85d8df85799fe54b09f830816881305fbf35837 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 4 Jan 2024 17:14:39 +0530 Subject: [PATCH 1/3] schema: add vmware 8.0.0.2 support explicitly Fixes #8412 Add support for 8.0.0.2 explicitly to prevent falling over to the parent version Signed-off-by: Abhishek Kumar --- .../src/main/resources/META-INF/db/schema-41810to41900.sql | 3 +++ 1 file changed, 3 insertions(+) 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 15307353c3fd..539d4c523e62 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,6 @@ 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.0.0.2 +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); From 9e3edb2957ff3359b374771bb874dc3e9c50c2c4 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 4 Jan 2024 17:19:58 +0530 Subject: [PATCH 2/3] add logs Signed-off-by: Abhishek Kumar --- .../hypervisor/dao/HypervisorCapabilitiesDaoImpl.java | 10 ++++++++-- 1 file changed, 8 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 e8272825213b..a4ec0a663609 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 HypervisorCapabilitiesVO findByHypervisorTypeAndVersion(HypervisorType hy 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); } From 093658042fca1ed3d2e56879ab01b9b9f2126b3b Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 8 Jan 2024 13:38:23 +0530 Subject: [PATCH 3/3] add 8.0c --- .../src/main/resources/META-INF/db/schema-41810to41900.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 539d4c523e62..a6f45c261ce2 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 @@ -320,5 +320,6 @@ 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.0.0.2 +-- 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);