rhtyd closed pull request #2840: Fix for Vmware full clones update URL: https://github.com/apache/cloudstack/pull/2840
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java index e5e0bbfed59..7435a3eaf23 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java @@ -1399,7 +1399,7 @@ public void prepare(VirtualMachineProfile vm, DeployDestination dest) throws Sto if (cloneSettingVO != null) { if (!cloneSettingVO.getCloneType().equals(cloneType.toString())) { cloneSettingVO.setCloneType(cloneType.toString()); - _vmCloneSettingDao.update(cloneSettingVO.getVmId(), cloneSettingVO); + _vmCloneSettingDao.update(cloneSettingVO.getId(), cloneSettingVO); } } else { UserVmCloneSettingVO vmCloneSettingVO = new UserVmCloneSettingVO(vm.getId(), cloneType.toString()); diff --git a/engine/schema/resources/META-INF/db/schema-41110to41120.sql b/engine/schema/resources/META-INF/db/schema-41110to41120.sql index 4c85bd133e8..8b1b9d9cc31 100644 --- a/engine/schema/resources/META-INF/db/schema-41110to41120.sql +++ b/engine/schema/resources/META-INF/db/schema-41110to41120.sql @@ -22,3 +22,9 @@ -- XenServer 7.5 INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(uuid, hypervisor_type, hypervisor_version, max_guests_limit, max_data_volumes_limit, storage_motion_supported) values (UUID(), 'XenServer', '7.5.0', 500, 13, 1); INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) SELECT UUID(),'Xenserver', '7.5.0', guest_os_name, guest_os_id, utc_timestamp(), 0 FROM `cloud`.`guest_os_hypervisor` WHERE hypervisor_type='Xenserver' AND hypervisor_version='7.4.0'; + +-- Fix Vmware full clones issue +ALTER TABLE `cloud`.`user_vm_clone_setting` +ADD COLUMN `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT FIRST, +DROP PRIMARY KEY, +ADD PRIMARY KEY (`id`); \ No newline at end of file diff --git a/engine/schema/src/com/cloud/vm/UserVmCloneSettingVO.java b/engine/schema/src/com/cloud/vm/UserVmCloneSettingVO.java index adca686db57..f50807e4ed3 100644 --- a/engine/schema/src/com/cloud/vm/UserVmCloneSettingVO.java +++ b/engine/schema/src/com/cloud/vm/UserVmCloneSettingVO.java @@ -16,13 +16,23 @@ // under the License. package com.cloud.vm; +import org.apache.cloudstack.api.InternalIdentity; + import javax.persistence.Column; import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "user_vm_clone_setting") -public class UserVmCloneSettingVO { +public class UserVmCloneSettingVO implements InternalIdentity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private long id; @Column(name = "vm_id") private Long vmId; @@ -50,4 +60,9 @@ public String getCloneType() { public void setCloneType(String cloneType) { this.cloneType = cloneType; } + + @Override + public long getId() { + return id; + } } ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services