From f3b5a6ebc70d5bfb2c77b6aa359d7eb79b4507e5 Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Wed, 10 Sep 2014 17:46:33 -0700 Subject: [PATCH] CLOUDSTACK-7533: Wrong download URL is generated when using multiple SSVMs in a zone. The public ip of the url would sometime point to the wrong ssvm when the url was created on another one. Fix the bug by removing the command CreateEntityDownloadURLCommand from the host delegation. This results in same ssvm for creating the symlink on ssvm and same public ip being used for generating the url on MS. --- .../src/com/cloud/hypervisor/guru/VMwareGuru.java | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java index abc7cdba509..ef7479446cf 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java @@ -48,7 +48,6 @@ import com.cloud.agent.api.CreatePrivateTemplateFromVolumeCommand; import com.cloud.agent.api.CreateVolumeFromSnapshotCommand; import com.cloud.agent.api.UnregisterNicCommand; import com.cloud.agent.api.storage.CopyVolumeCommand; -import com.cloud.agent.api.storage.CreateEntityDownloadURLCommand; import com.cloud.agent.api.storage.CreateVolumeOVACommand; import com.cloud.agent.api.storage.PrepareOVAPackingCommand; import com.cloud.agent.api.to.DataObjectType; @@ -394,20 +393,8 @@ public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru, Co } else { needDelegation = true; } - } else if (cmd instanceof CreateEntityDownloadURLCommand) { - DataTO srcData = ((CreateEntityDownloadURLCommand)cmd).getData(); - if ((HypervisorType.VMware == srcData.getHypervisorType())) { - needDelegation = true; - } - if (srcData.getObjectType() == DataObjectType.VOLUME) { - VolumeObjectTO volumeObjectTO = (VolumeObjectTO)srcData; - if (Storage.ImageFormat.OVA == volumeObjectTO.getFormat()) { - needDelegation = true; - } - } } - - if (!needDelegation) { + if(!needDelegation) { return new Pair(Boolean.FALSE, new Long(hostId)); } HostVO host = _hostDao.findById(hostId);