Skip to content

Commit 514d2c2

Browse files
authored
schema,engine-schema: explicit VMware 8.0.0.2, 8.0.0.3 support, logs (apache#8444)
Fixes apache#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 <abhishek.mrt22@gmail.com>
1 parent 5c32a0e commit 514d2c2

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

engine/schema/src/main/java/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,17 @@ public HypervisorCapabilitiesVO findByHypervisorTypeAndVersion(HypervisorType hy
7575
sc.setParameters("hypervisorType", hypervisorType);
7676
sc.setParameters("hypervisorVersion", hypervisorVersion);
7777
HypervisorCapabilitiesVO result = findOneBy(sc);
78+
String parentVersion = CloudStackVersion.getVMwareParentVersion(hypervisorVersion);
7879
if (result != null || !HypervisorType.VMware.equals(hypervisorType) ||
79-
CloudStackVersion.getVMwareParentVersion(hypervisorVersion) == null) {
80+
parentVersion == null) {
8081
return result;
8182
}
82-
sc.setParameters("hypervisorVersion", CloudStackVersion.getVMwareParentVersion(hypervisorVersion));
83+
if (s_logger.isDebugEnabled()) {
84+
s_logger.debug(String.format("Hypervisor capabilities for hypervisor: %s, version: %s can not be found. " +
85+
"Trying to find capabilities for the parent version: %s",
86+
hypervisorType, hypervisorVersion, parentVersion));
87+
}
88+
sc.setParameters("hypervisorVersion", parentVersion);
8389
return findOneBy(sc);
8490
}
8591

engine/schema/src/main/resources/META-INF/db/schema-41810to41900.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,3 +319,7 @@ CREATE TABLE `cloud_usage`.`bucket_statistics` (
319319

320320
-- Add remover account ID to quarantined IPs table.
321321
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"');
322+
323+
-- Explicitly add support for VMware 8.0b (8.0.0.2), 8.0c (8.0.0.3)
324+
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);
325+
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);

0 commit comments

Comments
 (0)